More of fix for 14026; call through to the controller for edit menu items, now that it does the right thing. r=saari

This commit is contained in:
sfraser%netscape.com 2000-01-18 21:07:54 +00:00
parent 959dc964ce
commit fd5ce2c430

View File

@ -3950,11 +3950,8 @@ NS_IMETHODIMP nsDOMWindowController::IsCommandEnabled(const PRUnichar *aCommand,
if (PR_TRUE== nsAutoString(sCopyString).Equals(aCommand))
{
//1rv = editInterface->GetCopyable( aResult );
rv = NS_OK;
*aResult = PR_TRUE;//hack for now
rv = editInterface->GetCopyable( aResult );
}
#if 0
else if (PR_TRUE==nsAutoString(sCutString).Equals(aCommand))
{
rv = editInterface->GetCutable( aResult);
@ -3968,7 +3965,6 @@ NS_IMETHODIMP nsDOMWindowController::IsCommandEnabled(const PRUnichar *aCommand,
*aResult = PR_TRUE;
rv = NS_OK;
}
#endif
return rv;
}
@ -4035,21 +4031,17 @@ NS_IMETHODIMP nsDOMWindowController::DoCommand(const PRUnichar *aCommand)
if (PR_TRUE== nsAutoString(sCopyString).Equals(aCommand))
{
//rv = editInterface->CopySelection();
if (NS_SUCCEEDED(GetPresShell(getter_AddRefs(presShell))) && presShell)
{
rv = presShell->DoCopy();
}
rv = editInterface->CopySelection();
}
else if (PR_TRUE== nsAutoString(sSelectAllString).Equals(aCommand))
else if (PR_TRUE== nsAutoString(sCutString).Equals(aCommand))
{
rv = editInterface->CutSelection();
}
else if (PR_TRUE== nsAutoString( sSelectAllString ).Equals(aCommand))
else if (PR_TRUE== nsAutoString(sPasteString).Equals(aCommand))
{
rv = editInterface->Paste();
}
else if (PR_TRUE== nsAutoString( sSelectAllString ).Equals(aCommand))
else if (PR_TRUE== nsAutoString(sSelectAllString).Equals(aCommand))
{
rv = editInterface->SelectAll();
}