Bug 221719 Disable Composer's Paste As Quotation menuitem in the subject and address fields r=brade sr=alecf

This commit is contained in:
neil%parkwaycc.co.uk 2003-10-10 19:02:28 +00:00
Родитель 368912e7d1
Коммит 2d04a18bbc
1 изменённых файлов: 8 добавлений и 13 удалений

Просмотреть файл

@ -416,16 +416,7 @@ nsPasteCommand::DoCommand(const char *aCommandName, nsISupports *aCommandRefCon)
if (!editor)
return NS_ERROR_FAILURE;
if (!nsCRT::strcmp("cmd_paste",aCommandName))
return editor->Paste(nsIClipboard::kGlobalClipboard);
else if (!nsCRT::strcmp("cmd_pasteQuote",aCommandName))
{
nsCOMPtr<nsIEditorMailSupport> mailEditor = do_QueryInterface(editor);
if (mailEditor)
return mailEditor->PasteAsQuotation(nsIClipboard::kGlobalClipboard);
}
return NS_ERROR_FAILURE;
return editor->Paste(nsIClipboard::kGlobalClipboard);
}
NS_IMETHODIMP
@ -772,11 +763,15 @@ nsPasteQuotationCommand::IsCommandEnabled(const char * aCommandName,
nsCOMPtr<nsIEditor> editor = do_QueryInterface(refCon);
nsCOMPtr<nsIEditorMailSupport> mailEditor = do_QueryInterface(refCon);
if (editor && mailEditor)
return editor->CanPaste(nsIClipboard::kGlobalClipboard, outCmdEnabled);
if (editor && mailEditor) {
PRUint32 flags;
editor->GetFlags(&flags);
if (!(flags & nsIPlaintextEditor::eEditorSingleLineMask))
return editor->CanPaste(nsIClipboard::kGlobalClipboard, outCmdEnabled);
}
*outCmdEnabled = PR_FALSE;
return NS_ERROR_NOT_IMPLEMENTED;
return NS_OK;
}