diff --git a/mozilla/editor/base/nsEditorShell.cpp b/mozilla/editor/base/nsEditorShell.cpp index 959e5cf6c54..0198e93425c 100644 --- a/mozilla/editor/base/nsEditorShell.cpp +++ b/mozilla/editor/base/nsEditorShell.cpp @@ -2131,6 +2131,7 @@ nsEditorShell::InsertAsQuotation(const PRUnichar *quotedText, NS_IMETHODIMP nsEditorShell::InsertAsCitedQuotation(const PRUnichar *quotedText, const PRUnichar *cite, + PRBool aInsertHTML, const PRUnichar *charset, nsIDOMNode** aNodeInserted) { @@ -2152,6 +2153,7 @@ nsEditorShell::InsertAsCitedQuotation(const PRUnichar *quotedText, case eHTMLTextEditorType: err = mailEditor->InsertAsCitedQuotation(aQuotedText, aCiteString, + aInsertHTML, aCharset, aNodeInserted); break; diff --git a/mozilla/editor/base/nsHTMLEditor.cpp b/mozilla/editor/base/nsHTMLEditor.cpp index d3fc33b5794..d549c634aec 100644 --- a/mozilla/editor/base/nsHTMLEditor.cpp +++ b/mozilla/editor/base/nsHTMLEditor.cpp @@ -4094,7 +4094,8 @@ NS_IMETHODIMP nsHTMLEditor::InsertAsQuotation(const nsString& aQuotedText, nsAutoString citation (""); nsAutoString charset (""); - return InsertAsCitedQuotation(aQuotedText, citation, charset, aNodeInserted); + return InsertAsCitedQuotation(aQuotedText, citation, PR_FALSE, + charset, aNodeInserted); } // text insert. @@ -4189,6 +4190,7 @@ nsHTMLEditor::InsertAsPlaintextQuotation(const nsString& aQuotedText, NS_IMETHODIMP nsHTMLEditor::InsertAsCitedQuotation(const nsString& aQuotedText, const nsString& aCitation, + PRBool aInsertHTML, const nsString& aCharset, nsIDOMNode **aNodeInserted) { @@ -4230,7 +4232,12 @@ nsHTMLEditor::InsertAsCitedQuotation(const nsString& aQuotedText, selection->Collapse(newNode, 0); } - res = InsertHTMLWithCharset(aQuotedText, aCharset); + if (aInsertHTML) + res = InsertHTMLWithCharset(aQuotedText, aCharset); + + else + res = InsertText(aQuotedText); // XXX ignore charset + if (aNodeInserted) { if (NS_SUCCEEDED(res)) diff --git a/mozilla/editor/base/nsHTMLEditor.h b/mozilla/editor/base/nsHTMLEditor.h index e1c635a80cb..ed7336c8313 100644 --- a/mozilla/editor/base/nsHTMLEditor.h +++ b/mozilla/editor/base/nsHTMLEditor.h @@ -168,6 +168,7 @@ public: NS_IMETHOD PasteAsCitedQuotation(const nsString& aCitation); NS_IMETHOD InsertAsCitedQuotation(const nsString& aQuotedText, const nsString& aCitation, + PRBool aInsertHTML, const nsString& aCharset, nsIDOMNode **aNodeInserted); NS_IMETHOD GetEmbeddedObjects(nsISupportsArray** aNodeList); diff --git a/mozilla/editor/base/nsHTMLEditorLog.cpp b/mozilla/editor/base/nsHTMLEditorLog.cpp index ef95d6fb919..80e2ef0639f 100644 --- a/mozilla/editor/base/nsHTMLEditorLog.cpp +++ b/mozilla/editor/base/nsHTMLEditorLog.cpp @@ -444,6 +444,7 @@ nsHTMLEditorLog::InsertAsPlaintextQuotation(const nsString& aQuotedText, NS_IMETHODIMP nsHTMLEditorLog::InsertAsCitedQuotation(const nsString& aQuotedText, const nsString& aCitation, + PRBool aInsertHTML, const nsString& aCharset, nsIDOMNode **aNodeInserted) { @@ -460,7 +461,7 @@ nsHTMLEditorLog::InsertAsCitedQuotation(const nsString& aQuotedText, Flush(); } - return nsHTMLEditor::InsertAsCitedQuotation(aQuotedText, aCitation, + return nsHTMLEditor::InsertAsCitedQuotation(aQuotedText, aCitation, aInsertHTML, aCharset, aNodeInserted); } diff --git a/mozilla/editor/base/nsHTMLEditorLog.h b/mozilla/editor/base/nsHTMLEditorLog.h index dd296c57388..f35236fe9c0 100644 --- a/mozilla/editor/base/nsHTMLEditorLog.h +++ b/mozilla/editor/base/nsHTMLEditorLog.h @@ -77,7 +77,7 @@ public: NS_IMETHOD PasteAsCitedQuotation(const nsString& aCitation); NS_IMETHOD InsertAsQuotation(const nsString& aQuotedText, nsIDOMNode** aNodeInserted); NS_IMETHOD InsertAsPlaintextQuotation(const nsString& aQuotedText, nsIDOMNode** aNodeInserted); - NS_IMETHOD InsertAsCitedQuotation(const nsString& aQuotedText, const nsString& aCitation, const nsString& aCharset, nsIDOMNode** aNodeInserted); + NS_IMETHOD InsertAsCitedQuotation(const nsString& aQuotedText, const nsString& aCitation, PRBool aInsertHTML, const nsString& aCharset, nsIDOMNode** aNodeInserted); NS_IMETHOD ApplyStyleSheet(const nsString& aURL); diff --git a/mozilla/editor/composer/src/nsEditorShell.cpp b/mozilla/editor/composer/src/nsEditorShell.cpp index 959e5cf6c54..0198e93425c 100644 --- a/mozilla/editor/composer/src/nsEditorShell.cpp +++ b/mozilla/editor/composer/src/nsEditorShell.cpp @@ -2131,6 +2131,7 @@ nsEditorShell::InsertAsQuotation(const PRUnichar *quotedText, NS_IMETHODIMP nsEditorShell::InsertAsCitedQuotation(const PRUnichar *quotedText, const PRUnichar *cite, + PRBool aInsertHTML, const PRUnichar *charset, nsIDOMNode** aNodeInserted) { @@ -2152,6 +2153,7 @@ nsEditorShell::InsertAsCitedQuotation(const PRUnichar *quotedText, case eHTMLTextEditorType: err = mailEditor->InsertAsCitedQuotation(aQuotedText, aCiteString, + aInsertHTML, aCharset, aNodeInserted); break; diff --git a/mozilla/editor/idl/nsIEditorShell.idl b/mozilla/editor/idl/nsIEditorShell.idl index 62616c6c3a8..11418114106 100644 --- a/mozilla/editor/idl/nsIEditorShell.idl +++ b/mozilla/editor/idl/nsIEditorShell.idl @@ -148,7 +148,7 @@ interface nsIEditorShell : nsISupports void InsertAsQuotation(in wstring quotedText, out nsIDOMNode nodeInserted); void InsertAsCitedQuotation(in wstring quotedText, in wstring cite, - in wstring charset, + in boolean insertHTML, in wstring charset, out nsIDOMNode nodeInserted); void SelectAll(); diff --git a/mozilla/editor/libeditor/html/nsHTMLEditor.cpp b/mozilla/editor/libeditor/html/nsHTMLEditor.cpp index d3fc33b5794..d549c634aec 100644 --- a/mozilla/editor/libeditor/html/nsHTMLEditor.cpp +++ b/mozilla/editor/libeditor/html/nsHTMLEditor.cpp @@ -4094,7 +4094,8 @@ NS_IMETHODIMP nsHTMLEditor::InsertAsQuotation(const nsString& aQuotedText, nsAutoString citation (""); nsAutoString charset (""); - return InsertAsCitedQuotation(aQuotedText, citation, charset, aNodeInserted); + return InsertAsCitedQuotation(aQuotedText, citation, PR_FALSE, + charset, aNodeInserted); } // text insert. @@ -4189,6 +4190,7 @@ nsHTMLEditor::InsertAsPlaintextQuotation(const nsString& aQuotedText, NS_IMETHODIMP nsHTMLEditor::InsertAsCitedQuotation(const nsString& aQuotedText, const nsString& aCitation, + PRBool aInsertHTML, const nsString& aCharset, nsIDOMNode **aNodeInserted) { @@ -4230,7 +4232,12 @@ nsHTMLEditor::InsertAsCitedQuotation(const nsString& aQuotedText, selection->Collapse(newNode, 0); } - res = InsertHTMLWithCharset(aQuotedText, aCharset); + if (aInsertHTML) + res = InsertHTMLWithCharset(aQuotedText, aCharset); + + else + res = InsertText(aQuotedText); // XXX ignore charset + if (aNodeInserted) { if (NS_SUCCEEDED(res)) diff --git a/mozilla/editor/libeditor/html/nsHTMLEditor.h b/mozilla/editor/libeditor/html/nsHTMLEditor.h index e1c635a80cb..ed7336c8313 100644 --- a/mozilla/editor/libeditor/html/nsHTMLEditor.h +++ b/mozilla/editor/libeditor/html/nsHTMLEditor.h @@ -168,6 +168,7 @@ public: NS_IMETHOD PasteAsCitedQuotation(const nsString& aCitation); NS_IMETHOD InsertAsCitedQuotation(const nsString& aQuotedText, const nsString& aCitation, + PRBool aInsertHTML, const nsString& aCharset, nsIDOMNode **aNodeInserted); NS_IMETHOD GetEmbeddedObjects(nsISupportsArray** aNodeList); diff --git a/mozilla/editor/libeditor/html/nsHTMLEditorLog.cpp b/mozilla/editor/libeditor/html/nsHTMLEditorLog.cpp index ef95d6fb919..80e2ef0639f 100644 --- a/mozilla/editor/libeditor/html/nsHTMLEditorLog.cpp +++ b/mozilla/editor/libeditor/html/nsHTMLEditorLog.cpp @@ -444,6 +444,7 @@ nsHTMLEditorLog::InsertAsPlaintextQuotation(const nsString& aQuotedText, NS_IMETHODIMP nsHTMLEditorLog::InsertAsCitedQuotation(const nsString& aQuotedText, const nsString& aCitation, + PRBool aInsertHTML, const nsString& aCharset, nsIDOMNode **aNodeInserted) { @@ -460,7 +461,7 @@ nsHTMLEditorLog::InsertAsCitedQuotation(const nsString& aQuotedText, Flush(); } - return nsHTMLEditor::InsertAsCitedQuotation(aQuotedText, aCitation, + return nsHTMLEditor::InsertAsCitedQuotation(aQuotedText, aCitation, aInsertHTML, aCharset, aNodeInserted); } diff --git a/mozilla/editor/libeditor/html/nsHTMLEditorLog.h b/mozilla/editor/libeditor/html/nsHTMLEditorLog.h index dd296c57388..f35236fe9c0 100644 --- a/mozilla/editor/libeditor/html/nsHTMLEditorLog.h +++ b/mozilla/editor/libeditor/html/nsHTMLEditorLog.h @@ -77,7 +77,7 @@ public: NS_IMETHOD PasteAsCitedQuotation(const nsString& aCitation); NS_IMETHOD InsertAsQuotation(const nsString& aQuotedText, nsIDOMNode** aNodeInserted); NS_IMETHOD InsertAsPlaintextQuotation(const nsString& aQuotedText, nsIDOMNode** aNodeInserted); - NS_IMETHOD InsertAsCitedQuotation(const nsString& aQuotedText, const nsString& aCitation, const nsString& aCharset, nsIDOMNode** aNodeInserted); + NS_IMETHOD InsertAsCitedQuotation(const nsString& aQuotedText, const nsString& aCitation, PRBool aInsertHTML, const nsString& aCharset, nsIDOMNode** aNodeInserted); NS_IMETHOD ApplyStyleSheet(const nsString& aURL); diff --git a/mozilla/editor/public/nsIEditorMailSupport.h b/mozilla/editor/public/nsIEditorMailSupport.h index 6e815fa81df..9f96e5f4325 100644 --- a/mozilla/editor/public/nsIEditorMailSupport.h +++ b/mozilla/editor/public/nsIEditorMailSupport.h @@ -80,6 +80,7 @@ public: */ NS_IMETHOD InsertAsCitedQuotation(const nsString& aQuotedText, const nsString& aCitation, + PRBool aInsertHTML, const nsString& aCharset, nsIDOMNode** aNodeInserted)=0; diff --git a/mozilla/editor/ui/composer/content/EditorCommands.js b/mozilla/editor/ui/composer/content/EditorCommands.js index c794f2bb136..c1eb1475588 100644 --- a/mozilla/editor/ui/composer/content/EditorCommands.js +++ b/mozilla/editor/ui/composer/content/EditorCommands.js @@ -413,12 +413,6 @@ function EditorPasteAsQuotation() contentWindow.focus(); } -function EditorPasteAsQuotationCited(citeString) -{ - editorShell.PasteAsCitedQuotation(CiteString); - contentWindow.focus(); -} - function EditorSelectAll() { editorShell.SelectAll(); @@ -438,7 +432,7 @@ function EditorFindNext() function EditorShowClipboard() { - dump("In EditorShowClipboard...\n"); + dump("EditorShowClipboard not implemented\n"); } // --------------------------- View menu --------------------------- diff --git a/mozilla/mailnews/compose/src/nsMsgCompose.cpp b/mozilla/mailnews/compose/src/nsMsgCompose.cpp index 3e099755ba5..68f627f6fd2 100644 --- a/mozilla/mailnews/compose/src/nsMsgCompose.cpp +++ b/mozilla/mailnews/compose/src/nsMsgCompose.cpp @@ -252,6 +252,7 @@ nsresult nsMsgCompose::ConvertAndLoadComposeWindow(nsIEditorShell *aEditorShell, { if (mCiteReference != "") aEditorShell->InsertAsCitedQuotation(aBuf.GetUnicode(), mCiteReference.GetUnicode(), + PR_TRUE, nsString("UTF-8").GetUnicode(), getter_AddRefs(nodeInserted)); else aEditorShell->InsertAsQuotation(aBuf.GetUnicode(), getter_AddRefs(nodeInserted));