зеркало из https://github.com/mozilla/pjs.git
30311: add a plain-vs-html flag to InsertAsCitedQuotation. r=rhp
This commit is contained in:
Родитель
955b2bc7e3
Коммит
6eaddd7332
|
@ -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;
|
||||
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -80,6 +80,7 @@ public:
|
|||
*/
|
||||
NS_IMETHOD InsertAsCitedQuotation(const nsString& aQuotedText,
|
||||
const nsString& aCitation,
|
||||
PRBool aInsertHTML,
|
||||
const nsString& aCharset,
|
||||
nsIDOMNode** aNodeInserted)=0;
|
||||
|
||||
|
|
|
@ -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 ---------------------------
|
||||
|
|
|
@ -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));
|
||||
|
|
Загрузка…
Ссылка в новой задаче