From 2d1f6513434e8abf324619f7b9ebc041bc513267 Mon Sep 17 00:00:00 2001 From: "brade%netscape.com" Date: Thu, 12 Jun 2003 14:51:37 +0000 Subject: [PATCH] remove unused params; r=akkana, sr=kin, bienvenu, bug=208967 git-svn-id: svn://10.0.0.236/trunk@143639 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/editor/idl/nsIEditorMailSupport.idl | 3 +- mozilla/editor/idl/nsIHTMLEditor.idl | 20 +++--- .../libeditor/html/nsHTMLDataTransfer.cpp | 69 ++++++++----------- mozilla/editor/libeditor/html/nsHTMLEditor.h | 20 +++--- .../editor/libeditor/html/nsHTMLEditorLog.cpp | 5 +- .../editor/libeditor/html/nsHTMLEditorLog.h | 2 +- .../libeditor/html/nsHTMLEditorStyle.cpp | 1 + .../libeditor/text/nsPlaintextEditor.cpp | 1 - .../editor/libeditor/text/nsPlaintextEditor.h | 1 - mozilla/mailnews/compose/src/nsMsgCompose.cpp | 2 - 10 files changed, 50 insertions(+), 74 deletions(-) diff --git a/mozilla/editor/idl/nsIEditorMailSupport.idl b/mozilla/editor/idl/nsIEditorMailSupport.idl index 20c4e7e1bb2..ec7d7f123df 100644 --- a/mozilla/editor/idl/nsIEditorMailSupport.idl +++ b/mozilla/editor/idl/nsIEditorMailSupport.idl @@ -94,8 +94,7 @@ interface nsIEditorMailSupport : nsISupports */ nsIDOMNode insertAsCitedQuotation(in AString aQuotedText, in AString aCitation, - in boolean aInsertHTML, - in AString aCharset); + in boolean aInsertHTML); /** * Rewrap the selected part of the document, re-quoting if necessary. diff --git a/mozilla/editor/idl/nsIHTMLEditor.idl b/mozilla/editor/idl/nsIHTMLEditor.idl index e96da3aa54e..8afaee71774 100644 --- a/mozilla/editor/idl/nsIHTMLEditor.idl +++ b/mozilla/editor/idl/nsIHTMLEditor.idl @@ -251,10 +251,9 @@ interface nsIHTMLEditor : nsISupports /** * Insert some HTML source, interpreting - * the string argument according to the given charset. + * the string argument according to the given context. * * @param aInputString the string to be inserted - * @param aCharset Charset of string * @param aContextStr Context of insertion * @param aInfoStr Related info to aInputString * @param aFlavor Transferable flavor, can be "" @@ -264,15 +263,14 @@ interface nsIHTMLEditor : nsISupports * @param aDeleteSelection used with aDestNode during drag&drop * @param aCollapseSelection used with aDestNode during drag&drop */ - void insertHTMLWithCharsetAndContext(in AString aInputString, - in AString aCharset, - in AString aContextStr, - in AString aInfoStr, - in AString aFlavor, - in nsIDOMDocument aSourceDoc, - in nsIDOMNode aDestinationNode, - in long aDestinationOffset, - in boolean aDeleteSelection); + void insertHTMLWithContext(in AString aInputString, + in AString aContextStr, + in AString aInfoStr, + in AString aFlavor, + in nsIDOMDocument aSourceDoc, + in nsIDOMNode aDestinationNode, + in long aDestinationOffset, + in boolean aDeleteSelection); /** diff --git a/mozilla/editor/libeditor/html/nsHTMLDataTransfer.cpp b/mozilla/editor/libeditor/html/nsHTMLDataTransfer.cpp index eacbfd27030..7de5b49258a 100644 --- a/mozilla/editor/libeditor/html/nsHTMLDataTransfer.cpp +++ b/mozilla/editor/libeditor/html/nsHTMLDataTransfer.cpp @@ -166,15 +166,8 @@ static nsCOMPtr GetTableParent(nsIDOMNode* aNode) } -NS_IMETHODIMP nsHTMLEditor::LoadHTML(const nsAString & aInString) +NS_IMETHODIMP nsHTMLEditor::LoadHTML(const nsAString & aInputString) { - nsAutoString charset; - return LoadHTMLWithCharset(aInString, charset); -} - -NS_IMETHODIMP nsHTMLEditor::LoadHTMLWithCharset(const nsAString & aInputString, const nsAString & aCharset) -{ - nsresult res = NS_OK; if (!mRules) return NS_ERROR_NOT_INITIALIZED; // force IME commit; set up rules sniffing and batching @@ -184,7 +177,7 @@ NS_IMETHODIMP nsHTMLEditor::LoadHTMLWithCharset(const nsAString & aInputString, // Get selection nsCOMPtrselection; - res = GetSelection(getter_AddRefs(selection)); + nsresult res = GetSelection(getter_AddRefs(selection)); if (NS_FAILED(res)) return res; nsTextRulesInfo ruleInfo(nsTextEditRules::kLoadHTML); @@ -247,22 +240,20 @@ NS_IMETHODIMP nsHTMLEditor::LoadHTMLWithCharset(const nsAString & aInputString, NS_IMETHODIMP nsHTMLEditor::InsertHTML(const nsAString & aInString) { - return InsertHTMLWithCharsetAndContext(aInString, nsString(), nsString(), - nsString(), nsString(), - nsnull, nsnull, 0, PR_TRUE); + return InsertHTMLWithContext(aInString, nsString(), nsString(), nsString(), + nsnull, nsnull, 0, PR_TRUE); } nsresult -nsHTMLEditor::InsertHTMLWithCharsetAndContext(const nsAString & aInputString, - const nsAString & aCharset, - const nsAString & aContextStr, - const nsAString & aInfoStr, - const nsAString & aFlavor, - nsIDOMDocument *aSourceDoc, - nsIDOMNode *aDestNode, - PRInt32 aDestOffset, - PRBool aDeleteSelection) +nsHTMLEditor::InsertHTMLWithContext(const nsAString & aInputString, + const nsAString & aContextStr, + const nsAString & aInfoStr, + const nsAString & aFlavor, + nsIDOMDocument *aSourceDoc, + nsIDOMNode *aDestNode, + PRInt32 aDestOffset, + PRBool aDeleteSelection) { if (!mRules) return NS_ERROR_NOT_INITIALIZED; @@ -1040,11 +1031,11 @@ NS_IMETHODIMP nsHTMLEditor::InsertFromTransferable(nsITransferable *transferable if (NS_SUCCEEDED(rv) && !cffragment.IsEmpty()) { nsAutoEditBatch beginBatching(this); - rv = InsertHTMLWithCharsetAndContext(cffragment, nsString(), - cfcontext, cfselection, flavor, - aSourceDoc, - aDestinationNode, aDestOffset, - aDoDeleteSelection); + rv = InsertHTMLWithContext(cffragment, + cfcontext, cfselection, flavor, + aSourceDoc, + aDestinationNode, aDestOffset, + aDoDeleteSelection); } } } @@ -1058,11 +1049,11 @@ NS_IMETHODIMP nsHTMLEditor::InsertFromTransferable(nsITransferable *transferable NS_ASSERTION(text.Length() <= (len/2), "Invalid length!"); stuffToPaste.Assign(text.get(), len / 2); nsAutoEditBatch beginBatching(this); - rv = InsertHTMLWithCharsetAndContext(stuffToPaste, nsString(), - aContextStr, aInfoStr, flavor, - aSourceDoc, - aDestinationNode, aDestOffset, - aDoDeleteSelection); + rv = InsertHTMLWithContext(stuffToPaste, + aContextStr, aInfoStr, flavor, + aSourceDoc, + aDestinationNode, aDestOffset, + aDoDeleteSelection); } } else if (flavor.Equals(NS_LITERAL_STRING(kUnicodeMime))) @@ -1126,11 +1117,11 @@ NS_IMETHODIMP nsHTMLEditor::InsertFromTransferable(nsITransferable *transferable stuffToPaste.Append(NS_LITERAL_STRING("")); } nsAutoEditBatch beginBatching(this); - rv = InsertHTMLWithCharsetAndContext(stuffToPaste, nsString(), - nsString(), nsString(), flavor, - aSourceDoc, - aDestinationNode, aDestOffset, - aDoDeleteSelection); + rv = InsertHTMLWithContext(stuffToPaste, + nsString(), nsString(), flavor, + aSourceDoc, + aDestinationNode, aDestOffset, + aDoDeleteSelection); } } } @@ -1914,9 +1905,8 @@ NS_IMETHODIMP nsHTMLEditor::InsertAsQuotation(const nsAString & aQuotedText, return InsertAsPlaintextQuotation(aQuotedText, PR_TRUE, aNodeInserted); nsAutoString citation; - nsAutoString charset; return InsertAsCitedQuotation(aQuotedText, citation, PR_FALSE, - charset, aNodeInserted); + aNodeInserted); } // Insert plaintext as a quotation, with cite marks (e.g. "> "). @@ -2031,7 +2021,6 @@ NS_IMETHODIMP nsHTMLEditor::InsertAsCitedQuotation(const nsAString & aQuotedText, const nsAString & aCitation, PRBool aInsertHTML, - const nsAString & aCharset, nsIDOMNode **aNodeInserted) { // Don't let anyone insert html into a "plaintext" editor: @@ -2081,7 +2070,7 @@ nsHTMLEditor::InsertAsCitedQuotation(const nsAString & aQuotedText, } if (aInsertHTML) - res = LoadHTMLWithCharset(aQuotedText, aCharset); + res = LoadHTML(aQuotedText); else res = InsertText(aQuotedText); // XXX ignore charset diff --git a/mozilla/editor/libeditor/html/nsHTMLEditor.h b/mozilla/editor/libeditor/html/nsHTMLEditor.h index 4d5174e3e5d..e6acad1c306 100644 --- a/mozilla/editor/libeditor/html/nsHTMLEditor.h +++ b/mozilla/editor/libeditor/html/nsHTMLEditor.h @@ -189,19 +189,16 @@ public: NS_IMETHOD PasteNoFormatting(PRInt32 aSelectionType); NS_IMETHOD InsertHTML(const nsAString &aInputString); - NS_IMETHOD InsertHTMLWithCharsetAndContext(const nsAString & aInputString, - const nsAString & aCharset, - const nsAString & aContextStr, - const nsAString & aInfoStr, - const nsAString & aFlavor, - nsIDOMDocument *aSourceDoc, - nsIDOMNode *aDestinationNode, - PRInt32 aDestinationOffset, - PRBool aDeleteSelection); + NS_IMETHOD InsertHTMLWithContext(const nsAString & aInputString, + const nsAString & aContextStr, + const nsAString & aInfoStr, + const nsAString & aFlavor, + nsIDOMDocument *aSourceDoc, + nsIDOMNode *aDestinationNode, + PRInt32 aDestinationOffset, + PRBool aDeleteSelection); NS_IMETHOD LoadHTML(const nsAString &aInputString); - NS_IMETHOD LoadHTMLWithCharset(const nsAString& aInputString, - const nsAString& aCharset); NS_IMETHOD RebuildDocumentFromSource(const nsAString& aSourceString); NS_IMETHOD InsertElementAtSelection(nsIDOMElement* aElement, PRBool aDeleteSelection); @@ -273,7 +270,6 @@ public: NS_IMETHOD InsertAsCitedQuotation(const nsAString & aQuotedText, const nsAString & aCitation, PRBool aInsertHTML, - const nsAString & 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 98594f685c0..86e78a181be 100644 --- a/mozilla/editor/libeditor/html/nsHTMLEditorLog.cpp +++ b/mozilla/editor/libeditor/html/nsHTMLEditorLog.cpp @@ -444,7 +444,6 @@ NS_IMETHODIMP nsHTMLEditorLog::InsertAsCitedQuotation(const nsAString& aQuotedText, const nsAString& aCitation, PRBool aInsertHTML, - const nsAString& aCharset, nsIDOMNode **aNodeInserted) { nsAutoHTMLEditorLogLock logLock(this); @@ -458,14 +457,12 @@ nsHTMLEditorLog::InsertAsCitedQuotation(const nsAString& aQuotedText, PrintUnicode(aCitation); Write("\", "); Write(aInsertHTML ? "true" : "false"); - Write(", \""); - PrintUnicode(aCharset); Write("\");\n"); Flush(); } return nsHTMLEditor::InsertAsCitedQuotation(aQuotedText, aCitation, aInsertHTML, - aCharset, aNodeInserted); + aNodeInserted); } NS_IMETHODIMP diff --git a/mozilla/editor/libeditor/html/nsHTMLEditorLog.h b/mozilla/editor/libeditor/html/nsHTMLEditorLog.h index a6e4da6e59c..cfdc3c3578a 100644 --- a/mozilla/editor/libeditor/html/nsHTMLEditorLog.h +++ b/mozilla/editor/libeditor/html/nsHTMLEditorLog.h @@ -97,7 +97,7 @@ public: PRBool aAddCites, nsIDOMNode** aNodeInserted); NS_IMETHOD InsertAsCitedQuotation(const nsAString& aQuotedText, const nsAString& aCitation, - PRBool aInsertHTML, const nsAString& aCharset, + PRBool aInsertHTML, nsIDOMNode** aNodeInserted); NS_IMETHOD SetDocumentTitle(const nsAString& aTitle); diff --git a/mozilla/editor/libeditor/html/nsHTMLEditorStyle.cpp b/mozilla/editor/libeditor/html/nsHTMLEditorStyle.cpp index 5922acee5e7..ea95f8fcc1c 100644 --- a/mozilla/editor/libeditor/html/nsHTMLEditorStyle.cpp +++ b/mozilla/editor/libeditor/html/nsHTMLEditorStyle.cpp @@ -1849,6 +1849,7 @@ nsHTMLEditor::GetFontFaceState(PRBool *aMixed, nsAString &outFace) return res; } + // if there is no font face, check for tt res = GetInlinePropertyBase(nsEditProperty::tt, nsnull, nsnull, &first, &any, &all,nsnull); if (NS_FAILED(res)) return res; if (any && !all) return res; // mixed diff --git a/mozilla/editor/libeditor/text/nsPlaintextEditor.cpp b/mozilla/editor/libeditor/text/nsPlaintextEditor.cpp index 51bf956ad72..3f9ea0561a0 100644 --- a/mozilla/editor/libeditor/text/nsPlaintextEditor.cpp +++ b/mozilla/editor/libeditor/text/nsPlaintextEditor.cpp @@ -1736,7 +1736,6 @@ NS_IMETHODIMP nsPlaintextEditor::InsertAsCitedQuotation(const nsAString& aQuotedText, const nsAString& aCitation, PRBool aInsertHTML, - const nsAString& aCharset, nsIDOMNode **aNodeInserted) { return InsertAsQuotation(aQuotedText, aNodeInserted); diff --git a/mozilla/editor/libeditor/text/nsPlaintextEditor.h b/mozilla/editor/libeditor/text/nsPlaintextEditor.h index b1c4bf31e64..499a85aff8f 100644 --- a/mozilla/editor/libeditor/text/nsPlaintextEditor.h +++ b/mozilla/editor/libeditor/text/nsPlaintextEditor.h @@ -95,7 +95,6 @@ public: NS_IMETHOD InsertAsCitedQuotation(const nsAString& aQuotedText, const nsAString& aCitation, PRBool aInsertHTML, - const nsAString& aCharset, nsIDOMNode** aNodeInserted); NS_IMETHOD Rewrap(PRBool aRespectNewlines); NS_IMETHOD StripCites(); diff --git a/mozilla/mailnews/compose/src/nsMsgCompose.cpp b/mozilla/mailnews/compose/src/nsMsgCompose.cpp index 544d264e32e..a21c55c93fc 100644 --- a/mozilla/mailnews/compose/src/nsMsgCompose.cpp +++ b/mozilla/mailnews/compose/src/nsMsgCompose.cpp @@ -518,7 +518,6 @@ nsMsgCompose::ConvertAndLoadComposeWindow(nsString& aPrefix, mailEditor->InsertAsCitedQuotation(aBuf, mCiteReference, PR_TRUE, - NS_LITERAL_STRING("UTF-8"), getter_AddRefs(nodeInserted)); else mailEditor->InsertAsQuotation(aBuf, @@ -2331,7 +2330,6 @@ QuotingOutputStreamListener::InsertToCompose(nsIEditor *aEditor, mailEditor->InsertAsCitedQuotation(mMsgBody, NS_LITERAL_STRING(""), PR_TRUE, - NS_LITERAL_STRING("UTF-8"), getter_AddRefs(nodeInserted)); else mailEditor->InsertAsQuotation(mMsgBody, getter_AddRefs(nodeInserted));