diff --git a/mozilla/editor/base/nsEditor.cpp b/mozilla/editor/base/nsEditor.cpp index bced719e5c7..4a5e1c69110 100644 --- a/mozilla/editor/base/nsEditor.cpp +++ b/mozilla/editor/base/nsEditor.cpp @@ -2503,7 +2503,7 @@ nsEditor::CloneAttributes(nsIDOMNode *aDestNode, nsIDOMNode *aSourceNode) { nsAutoString sourceAttrValue; if (NS_SUCCEEDED(sourceAttribute->GetValue(sourceAttrValue)) && - sourceAttrValue != "") + !sourceAttrValue.IsEmpty()) { destElement->SetAttribute(sourceAttrName, sourceAttrValue); } else { diff --git a/mozilla/editor/base/nsEditorCommands.cpp b/mozilla/editor/base/nsEditorCommands.cpp index 6d733c36212..fcc84a448a5 100644 --- a/mozilla/editor/base/nsEditorCommands.cpp +++ b/mozilla/editor/base/nsEditorCommands.cpp @@ -162,9 +162,9 @@ nsPasteCommand::DoCommand(const PRUnichar *aCommand, nsISupports * refCon) nsresult rv = NS_OK; nsAutoString cmdString(aCommand); - if (cmdString == "cmd_paste") + if (cmdString.Equals("cmd_paste")) rv = aEditor->Paste(); - else if (cmdString == "cmd_pasteQuote") + else if (cmdString.Equals("cmd_pasteQuote")) { nsCOMPtr mailEditor = do_QueryInterface(aEditor, &rv); if (mailEditor) @@ -187,19 +187,19 @@ nsDeleteCommand::IsCommandEnabled(const PRUnichar *aCommand, nsISupports * refCo nsAutoString cmdString(aCommand); - if (cmdString == "cmd_delete") + if (cmdString.Equals("cmd_delete")) rv = aEditor->CanCut(*outCmdEnabled); - else if (cmdString == "cmd_deleteCharBackward") + else if (cmdString.Equals("cmd_deleteCharBackward")) *outCmdEnabled = PR_TRUE; - else if (cmdString == "cmd_deleteCharForward") + else if (cmdString.Equals("cmd_deleteCharForward")) *outCmdEnabled = PR_TRUE; - else if (cmdString == "cmd_deleteWordBackward") + else if (cmdString.Equals("cmd_deleteWordBackward")) *outCmdEnabled = PR_TRUE; - else if (cmdString == "cmd_deleteWordForward") + else if (cmdString.Equals("cmd_deleteWordForward")) *outCmdEnabled = PR_TRUE; - else if (cmdString == "cmd_deleteToBeginningOfLine") + else if (cmdString.Equals("cmd_deleteToBeginningOfLine")) *outCmdEnabled = PR_TRUE; - else if (cmdString == "cmd_deleteToEndOfLine") + else if (cmdString.Equals("cmd_deleteToEndOfLine")) *outCmdEnabled = PR_TRUE; return rv; @@ -217,19 +217,19 @@ nsDeleteCommand::DoCommand(const PRUnichar *aCommand, nsISupports * refCon) nsIEditor::EDirection deleteDir = nsIEditor::eNone; - if (cmdString == "cmd_delete") + if (cmdString.Equals("cmd_delete")) deleteDir = nsIEditor::ePrevious; - else if (cmdString == "cmd_deleteCharBackward") + else if (cmdString.Equals("cmd_deleteCharBackward")) deleteDir = nsIEditor::ePrevious; - else if (cmdString == "cmd_deleteCharForward") + else if (cmdString.Equals("cmd_deleteCharForward")) deleteDir = nsIEditor::eNext; - else if (cmdString == "cmd_deleteWordBackward") + else if (cmdString.Equals("cmd_deleteWordBackward")) deleteDir = nsIEditor::ePreviousWord; - else if (cmdString == "cmd_deleteWordForward") + else if (cmdString.Equals("cmd_deleteWordForward")) deleteDir = nsIEditor::eNextWord; - else if (cmdString == "cmd_deleteToBeginningOfLine") + else if (cmdString.Equals("cmd_deleteToBeginningOfLine")) deleteDir = nsIEditor::eToBeginningOfLine; - else if (cmdString == "cmd_deleteToEndOfLine") + else if (cmdString.Equals("cmd_deleteToEndOfLine")) deleteDir = nsIEditor::eToEndOfLine; return aEditor->DeleteSelection(deleteDir); @@ -291,81 +291,81 @@ nsSelectionMoveCommands::DoCommand(const PRUnichar *aCommand, nsISupports * refC nsAutoString cmdString(aCommand); // complete scroll commands - if (cmdString == "cmd_scrollTop") + if (cmdString.Equals("cmd_scrollTop")) return selCont->CompleteScroll(PR_FALSE); - else if (cmdString == "cmd_scrollBottom") + else if (cmdString.Equals("cmd_scrollBottom")) return selCont->CompleteScroll(PR_TRUE); // complete move commands - else if (cmdString == "cmd_moveTop") + else if (cmdString.Equals("cmd_moveTop")) return selCont->CompleteMove(PR_FALSE, PR_FALSE); - else if (cmdString == "cmd_moveBottom") + else if (cmdString.Equals("cmd_moveBottom")) return selCont->CompleteMove(PR_TRUE, PR_FALSE); - else if (cmdString == "cmd_selectTop") + else if (cmdString.Equals("cmd_selectTop")) return selCont->CompleteMove(PR_FALSE, PR_TRUE); - else if (cmdString == "cmd_selectBottom") + else if (cmdString.Equals("cmd_selectBottom")) return selCont->CompleteMove(PR_TRUE, PR_TRUE); // line move commands - else if (cmdString == "cmd_lineNext") + else if (cmdString.Equals("cmd_lineNext")) return selCont->LineMove(PR_TRUE, PR_FALSE); - else if (cmdString == "cmd_linePrevious") + else if (cmdString.Equals("cmd_linePrevious")) return selCont->LineMove(PR_FALSE, PR_FALSE); - else if (cmdString == "cmd_selectLineNext") + else if (cmdString.Equals("cmd_selectLineNext")) return selCont->LineMove(PR_TRUE, PR_TRUE); - else if (cmdString == "cmd_selectLinePrevious") + else if (cmdString.Equals("cmd_selectLinePrevious")) return selCont->LineMove(PR_FALSE, PR_TRUE); // character move commands - else if (cmdString == "cmd_charPrevious") + else if (cmdString.Equals("cmd_charPrevious")) return selCont->CharacterMove(PR_FALSE, PR_FALSE); - else if (cmdString == "cmd_charNext") + else if (cmdString.Equals("cmd_charNext")) return selCont->CharacterMove(PR_TRUE, PR_FALSE); - else if (cmdString == "cmd_selectCharPrevious") + else if (cmdString.Equals("cmd_selectCharPrevious")) return selCont->CharacterMove(PR_FALSE, PR_TRUE); - else if (cmdString == "cmd_selectCharNext") + else if (cmdString.Equals("cmd_selectCharNext")) return selCont->CharacterMove(PR_TRUE, PR_TRUE); // intra line move commands - else if (cmdString == "cmd_beginLine") + else if (cmdString.Equals("cmd_beginLine")) return selCont->IntraLineMove(PR_FALSE, PR_FALSE); - else if (cmdString == "cmd_endLine") + else if (cmdString.Equals("cmd_endLine")) return selCont->IntraLineMove(PR_TRUE, PR_FALSE); - else if (cmdString == "cmd_selectBeginLine") + else if (cmdString.Equals("cmd_selectBeginLine")) return selCont->IntraLineMove(PR_FALSE, PR_TRUE); - else if (cmdString == "cmd_selectEndLine") + else if (cmdString.Equals("cmd_selectEndLine")) return selCont->IntraLineMove(PR_TRUE, PR_TRUE); // word move commands - else if (cmdString == "cmd_wordPrevious") + else if (cmdString.Equals("cmd_wordPrevious")) return selCont->WordMove(PR_FALSE, PR_FALSE); - else if (cmdString == "cmd_wordNext") + else if (cmdString.Equals("cmd_wordNext")) return selCont->WordMove(PR_TRUE, PR_FALSE); - else if (cmdString == "cmd_selectWordPrevious") + else if (cmdString.Equals("cmd_selectWordPrevious")) return selCont->WordMove(PR_FALSE, PR_TRUE); - else if (cmdString == "cmd_selectWordNext") + else if (cmdString.Equals("cmd_selectWordNext")) return selCont->WordMove(PR_TRUE, PR_TRUE); // scroll page commands - else if (cmdString == "cmd_scrollPageUp") + else if (cmdString.Equals("cmd_scrollPageUp")) return selCont->ScrollPage(PR_FALSE); - else if (cmdString == "cmd_scrollPageDown") + else if (cmdString.Equals("cmd_scrollPageDown")) return selCont->ScrollPage(PR_TRUE); // scroll line commands - else if (cmdString == "cmd_scrollLineUp") + else if (cmdString.Equals("cmd_scrollLineUp")) return selCont->ScrollLine(PR_FALSE); - else if (cmdString == "cmd_scrollLineDown") + else if (cmdString.Equals("cmd_scrollLineDown")) return selCont->ScrollLine(PR_TRUE); // page move commands - else if (cmdString == "cmd_scrollPageUp") + else if (cmdString.Equals("cmd_scrollPageUp")) return selCont->PageMove(PR_FALSE, PR_FALSE); - else if (cmdString == "cmd_scrollPageDown") + else if (cmdString.Equals("cmd_scrollPageDown")) return selCont->PageMove(PR_TRUE, PR_FALSE); - else if (cmdString == "cmd_selectPageUp") + else if (cmdString.Equals("cmd_selectPageUp")) return selCont->PageMove(PR_FALSE, PR_TRUE); - else if (cmdString == "cmd_selectPageDown") + else if (cmdString.Equals("cmd_selectPageDown")) return selCont->PageMove(PR_TRUE, PR_TRUE); return NS_ERROR_FAILURE; diff --git a/mozilla/editor/base/nsEditorController.cpp b/mozilla/editor/base/nsEditorController.cpp index 5bd48baa7ad..3c6d8bc075c 100644 --- a/mozilla/editor/base/nsEditorController.cpp +++ b/mozilla/editor/base/nsEditorController.cpp @@ -218,7 +218,7 @@ NS_IMETHODIMP nsEditorController::IsCommandEnabled(const PRUnichar *aCommand, PR { #if DEBUG nsCAutoString msg("EditorController asked about a command that it does not handle -- "); - msg += aCommand; + msg.Append(aCommand); NS_WARNING(msg); #endif return NS_OK; // we don't handle this command @@ -264,7 +264,7 @@ NS_IMETHODIMP nsEditorController::DoCommand(const PRUnichar *aCommand) { #if DEBUG nsCAutoString msg("EditorController asked to do a command that it does not handle -- "); - msg += aCommand; + msg.Append(aCommand); NS_WARNING(msg); #endif return NS_OK; // we don't handle this command diff --git a/mozilla/editor/base/nsEditorShell.cpp b/mozilla/editor/base/nsEditorShell.cpp index 48a80a017d4..bd1395e9583 100644 --- a/mozilla/editor/base/nsEditorShell.cpp +++ b/mozilla/editor/base/nsEditorShell.cpp @@ -574,7 +574,7 @@ nsEditorShell::SetEditorType(const PRUnichar *editorType) nsAutoString theType = editorType; theType.ToLowerCase(); - if (theType == "text" || theType == "html" || theType == "" || theType == "htmlmail") + if (theType.Equals("text") || theType.Equals("html") || theType.IsEmpty() || theType.Equals("htmlmail")) { mEditorTypeString = theType; return NS_OK; @@ -606,17 +606,17 @@ nsEditorShell::InstantiateEditor(nsIDOMDocument *aDoc, nsIPresShell *aPresShell) if (NS_SUCCEEDED(err)) { - if (mEditorTypeString == "text") + if (mEditorTypeString.Equals("text")) { err = editor->Init(aDoc, aPresShell, nsIHTMLEditor::eEditorPlaintextMask); mEditorType = ePlainTextEditorType; } - else if (mEditorTypeString == "html" || mEditorTypeString == "") // empty string default to HTML editor + else if (mEditorTypeString.Equals("html") || mEditorTypeString.IsEmpty()) // empty string default to HTML editor { err = editor->Init(aDoc, aPresShell, 0); mEditorType = eHTMLTextEditorType; } - else if (mEditorTypeString == "htmlmail") // HTML editor with special mail rules + else if (mEditorTypeString.Equals("htmlmail")) // HTML editor with special mail rules { err = editor->Init(aDoc, aPresShell, nsIHTMLEditor::eEditorMailMask); mEditorType = eHTMLTextEditorType; @@ -876,7 +876,7 @@ nsEditorShell::RemoveTextProperty(const PRUnichar *prop, const PRUnichar *attr) nsAutoString aAttr(attr); allStr.ToLowerCase(); - PRBool doingAll = (allStr == "all"); + PRBool doingAll = (allStr.Equals("all")); nsresult err = NS_OK; if (doingAll) @@ -1439,7 +1439,7 @@ nsEditorShell::SaveDocument(PRBool saveAs, PRBool saveCopy, PRBool *_retval) { // remove cruft before file name including '/' // if the url ends with a '/' then the whole string will be cut - urlstring = urlstring.Cut(0, index + 1); + urlstring.Cut(0, index + 1); if (urlstring.Length() > 0) fileName = urlstring; } @@ -1462,7 +1462,8 @@ nsEditorShell::SaveDocument(PRBool saveAs, PRBool saveCopy, PRBool *_retval) title = title.ReplaceChar(fslash, underscore); title = title.ReplaceChar(at, underscore); title = title.ReplaceChar(colon, underscore); - fileName = title + nsString(".html"); + fileName = title; + fileName.Append(".html"); } } else @@ -2727,7 +2728,7 @@ nsEditorShell::MakeOrChangeList(const PRUnichar *listType) switch (mEditorType) { case eHTMLTextEditorType: - if (aListType == "") + if (aListType.IsEmpty()) { err = mEditor->RemoveList("ol"); if(NS_SUCCEEDED(err)) @@ -2759,7 +2760,7 @@ nsEditorShell::RemoveList(const PRUnichar *listType) switch (mEditorType) { case eHTMLTextEditorType: - if (aListType == "") + if (aListType.IsEmpty()) { err = mEditor->RemoveList("ol"); if(NS_SUCCEEDED(err)) diff --git a/mozilla/editor/base/nsHTMLEditRules.cpp b/mozilla/editor/base/nsHTMLEditRules.cpp index a7e506eac97..394a62c1868 100644 --- a/mozilla/editor/base/nsHTMLEditRules.cpp +++ b/mozilla/editor/base/nsHTMLEditRules.cpp @@ -468,7 +468,7 @@ nsHTMLEditRules::WillInsertText(PRInt32 aAction, theString.Left(partialString, pos); theString.Cut(0, pos); // is it a return? - if (partialString == "\n") + if (partialString.Equals("\n")) { res = mEditor->JoeCreateBR(&curNode, &curOffset, &unused, nsIEditor::eNone); } @@ -492,13 +492,13 @@ nsHTMLEditRules::WillInsertText(PRInt32 aAction, theString.Left(partialString, pos); theString.Cut(0, pos); // is it a tab? - if (partialString == "\t") + if (partialString.Equals("\t")) { partialString = " "; res = mEditor->JoeInsertTextImpl(tabString, &curNode, &curOffset, doc); } // is it a return? - else if (partialString == "\n") + else if (partialString.Equals("\n")) { res = mEditor->JoeCreateBR(&curNode, &curOffset, &unused, nsIEditor::eNone); } @@ -3136,7 +3136,7 @@ nsHTMLEditRules::ApplyBlockStyle(nsISupportsArray *arrayOfNodes, const nsString // we special case an empty tag name to mean "remove block parents". // This is used for the "normal" paragraph style in mail-compose - if (aBlockTag->IsEmpty() || *aBlockTag=="normal") bNoParent = PR_TRUE; + if (aBlockTag->IsEmpty() || aBlockTag->Equals("normal")) bNoParent = PR_TRUE; arrayOfNodes->Count(&listCount); @@ -3163,15 +3163,15 @@ nsHTMLEditRules::ApplyBlockStyle(nsISupportsArray *arrayOfNodes, const nsString // it with a new block of correct type. // xxx floppy moose: pre cant hold everything the others can if (nsHTMLEditUtils::IsMozDiv(curNode) || - (curNodeTag == "pre") || - (curNodeTag == "p") || - (curNodeTag == "h1") || - (curNodeTag == "h2") || - (curNodeTag == "h3") || - (curNodeTag == "h4") || - (curNodeTag == "h5") || - (curNodeTag == "h6") || - (curNodeTag == "address")) + (curNodeTag.Equals("pre")) || + (curNodeTag.Equals("p")) || + (curNodeTag.Equals("h1")) || + (curNodeTag.Equals("h2")) || + (curNodeTag.Equals("h3")) || + (curNodeTag.Equals("h4")) || + (curNodeTag.Equals("h5")) || + (curNodeTag.Equals("h6")) || + (curNodeTag.Equals("address"))) { curBlock = 0; // forget any previous block used for previous inline nodes if (bNoParent) @@ -3187,15 +3187,15 @@ nsHTMLEditRules::ApplyBlockStyle(nsISupportsArray *arrayOfNodes, const nsString } if (NS_FAILED(res)) return res; } - else if ((curNodeTag == "table") || - (curNodeTag == "tbody") || - (curNodeTag == "tr") || - (curNodeTag == "td") || - (curNodeTag == "ol") || - (curNodeTag == "ul") || - (curNodeTag == "li") || - (curNodeTag == "blockquote") || - (curNodeTag == "div")) // div's other than mozdivs + else if ((curNodeTag.Equals("table")) || + (curNodeTag.Equals("tbody")) || + (curNodeTag.Equals("tr")) || + (curNodeTag.Equals("td")) || + (curNodeTag.Equals("ol")) || + (curNodeTag.Equals("ul")) || + (curNodeTag.Equals("li")) || + (curNodeTag.Equals("blockquote")) || + (curNodeTag.Equals("div"))) // div's other than mozdivs { curBlock = 0; // forget any previous block used for previous inline nodes // recursion time @@ -3207,7 +3207,7 @@ nsHTMLEditRules::ApplyBlockStyle(nsISupportsArray *arrayOfNodes, const nsString } // if the node is a break, we honor it by putting further nodes in a new parent - else if (curNodeTag == "br") + else if (curNodeTag.Equals("br")) { curBlock = 0; // forget any previous block used for previous inline nodes if (!bNoParent) @@ -3228,7 +3228,7 @@ nsHTMLEditRules::ApplyBlockStyle(nsISupportsArray *arrayOfNodes, const nsString else if (nsEditor::IsInlineNode(curNode) && !bNoParent) { // if curNode is a non editable, drop it if we are going to
-      if ((*aBlockTag == "pre") && (!mEditor->IsEditable(curNode)))
+      if ((aBlockTag->Equals("pre")) && (!mEditor->IsEditable(curNode)))
         continue; // do nothing to this block
       
       // if no curBlock, make one
@@ -3946,7 +3946,7 @@ nsHTMLEditRules::ConvertWhitespace(const nsString & inString, nsString & outStri
       outString = "";
       return NS_OK;
     case 1:
-      if (inString == "\n")   // a bit of a hack: don't convert single newlines that 
+      if (inString.Equals("\n"))   // a bit of a hack: don't convert single newlines that 
         outString = "\n";     // dont have whitespace adjacent.  This is to preserve 
       else                    // html source formatting to some degree.
         outString = " ";
diff --git a/mozilla/editor/base/nsHTMLEditUtils.cpp b/mozilla/editor/base/nsHTMLEditUtils.cpp
index 8eaf70b5a40..6dd7ee91f0f 100644
--- a/mozilla/editor/base/nsHTMLEditUtils.cpp
+++ b/mozilla/editor/base/nsHTMLEditUtils.cpp
@@ -41,7 +41,7 @@ nsHTMLEditUtils::IsBody(nsIDOMNode *node)
   nsAutoString tag;
   nsEditor::GetTagString(node,tag);
   tag.ToLowerCase();
-  if (tag == "body")
+  if (tag.Equals("body"))
   {
     return PR_TRUE;
   }
@@ -60,7 +60,7 @@ nsHTMLEditUtils::IsBreak(nsIDOMNode *node)
   nsAutoString tag;
   nsEditor::GetTagString(node,tag);
   tag.ToLowerCase();
-  if (tag == "br")
+  if (tag.Equals("br"))
   {
     return PR_TRUE;
   }
@@ -78,7 +78,7 @@ nsHTMLEditUtils::IsBig(nsIDOMNode *node)
   nsAutoString tag;
   nsEditor::GetTagString(node,tag);
   tag.ToLowerCase();
-  if (tag == "big")
+  if (tag.Equals("big"))
   {
     return PR_TRUE;
   }
@@ -96,7 +96,7 @@ nsHTMLEditUtils::IsSmall(nsIDOMNode *node)
   nsAutoString tag;
   nsEditor::GetTagString(node,tag);
   tag.ToLowerCase();
-  if (tag == "small")
+  if (tag.Equals("small"))
   {
     return PR_TRUE;
   }
@@ -132,7 +132,7 @@ nsHTMLEditUtils::HasMozAttr(nsIDOMNode *node)
     nsAutoString typeAttrVal;
     nsresult res = elem->GetAttribute(typeAttrName, typeAttrVal);
     typeAttrVal.ToLowerCase();
-    if (NS_SUCCEEDED(res) && (typeAttrVal == "_moz"))
+    if (NS_SUCCEEDED(res) && (typeAttrVal.Equals("_moz")))
       return PR_TRUE;
   }
   return PR_FALSE;
@@ -174,12 +174,12 @@ nsHTMLEditUtils::IsHeader(nsIDOMNode *node)
   nsAutoString tag;
   nsEditor::GetTagString(node,tag);
   tag.ToLowerCase();
-  if ( (tag == "h1") ||
-       (tag == "h2") ||
-       (tag == "h3") ||
-       (tag == "h4") ||
-       (tag == "h5") ||
-       (tag == "h6") )
+  if ( (tag.Equals("h1")) ||
+       (tag.Equals("h2")) ||
+       (tag.Equals("h3")) ||
+       (tag.Equals("h4")) ||
+       (tag.Equals("h5")) ||
+       (tag.Equals("h6")) )
   {
     return PR_TRUE;
   }
@@ -197,7 +197,7 @@ nsHTMLEditUtils::IsParagraph(nsIDOMNode *node)
   nsAutoString tag;
   nsEditor::GetTagString(node,tag);
   tag.ToLowerCase();
-  if (tag == "p")
+  if (tag.Equals("p"))
   {
     return PR_TRUE;
   }
@@ -215,7 +215,7 @@ nsHTMLEditUtils::IsListItem(nsIDOMNode *node)
   nsAutoString tag;
   nsEditor::GetTagString(node,tag);
   tag.ToLowerCase();
-  if (tag == "li")
+  if (tag.Equals("li"))
   {
     return PR_TRUE;
   }
@@ -232,7 +232,7 @@ nsHTMLEditUtils::IsTable(nsIDOMNode *node)
   NS_PRECONDITION(node, "null node passed to nsHTMLEditor::IsTable");
   nsAutoString tag;
   nsEditor::GetTagString(node,tag);
-  if (tag == "table")
+  if (tag.Equals("table"))
     return PR_TRUE;
 
   return PR_FALSE;
@@ -248,7 +248,7 @@ nsHTMLEditUtils::IsTableRow(nsIDOMNode *node)
   nsAutoString tag;
   nsEditor::GetTagString(node,tag);
   tag.ToLowerCase();
-  if (tag == "tr")
+  if (tag.Equals("tr"))
   {
     return PR_TRUE;
   }
@@ -266,7 +266,7 @@ nsHTMLEditUtils::IsTableCell(nsIDOMNode *node)
   nsAutoString tag;
   nsEditor::GetTagString(node,tag);
   tag.ToLowerCase();
-  if (tag == "td" || tag == "th")
+  if (tag.Equals("td") || tag.Equals("th"))
   {
     return PR_TRUE;
   }
@@ -284,8 +284,8 @@ nsHTMLEditUtils::IsList(nsIDOMNode *node)
   nsAutoString tag;
   nsEditor::GetTagString(node,tag);
   tag.ToLowerCase();
-  if ( (tag == "ol") ||
-       (tag == "ul") )
+  if ( (tag.Equals("ol")) ||
+       (tag.Equals("ul")) )
   {
     return PR_TRUE;
   }
@@ -303,7 +303,7 @@ nsHTMLEditUtils::IsOrderedList(nsIDOMNode *node)
   nsAutoString tag;
   nsEditor::GetTagString(node,tag);
   tag.ToLowerCase();
-  if (tag == "ol")
+  if (tag.Equals("ol"))
   {
     return PR_TRUE;
   }
@@ -321,7 +321,7 @@ nsHTMLEditUtils::IsUnorderedList(nsIDOMNode *node)
   nsAutoString tag;
   nsEditor::GetTagString(node,tag);
   tag.ToLowerCase();
-  if (tag == "ul")
+  if (tag.Equals("ul"))
   {
     return PR_TRUE;
   }
@@ -339,7 +339,7 @@ nsHTMLEditUtils::IsBlockquote(nsIDOMNode *node)
   nsAutoString tag;
   nsEditor::GetTagString(node,tag);
   tag.ToLowerCase();
-  if (tag == "blockquote")
+  if (tag.Equals("blockquote"))
   {
     return PR_TRUE;
   }
@@ -357,7 +357,7 @@ nsHTMLEditUtils::IsPre(nsIDOMNode *node)
   nsAutoString tag;
   nsEditor::GetTagString(node,tag);
   tag.ToLowerCase();
-  if (tag == "pre")
+  if (tag.Equals("pre"))
   {
     return PR_TRUE;
   }
@@ -375,7 +375,7 @@ nsHTMLEditUtils::IsAddress(nsIDOMNode *node)
   nsAutoString tag;
   nsEditor::GetTagString(node,tag);
   tag.ToLowerCase();
-  if (tag == "address")
+  if (tag.Equals("address"))
   {
     return PR_TRUE;
   }
@@ -393,7 +393,7 @@ nsHTMLEditUtils::IsAnchor(nsIDOMNode *node)
   nsAutoString tag;
   nsEditor::GetTagString(node,tag);
   tag.ToLowerCase();
-  if (tag == "a")
+  if (tag.Equals("a"))
   {
     return PR_TRUE;
   }
@@ -411,7 +411,7 @@ nsHTMLEditUtils::IsImage(nsIDOMNode *node)
   nsAutoString tag;
   nsEditor::GetTagString(node,tag);
   tag.ToLowerCase();
-  if (tag == "img")
+  if (tag.Equals("img"))
   {
     return PR_TRUE;
   }
@@ -429,7 +429,7 @@ nsHTMLEditUtils::IsDiv(nsIDOMNode *node)
   nsAutoString tag;
   nsEditor::GetTagString(node,tag);
   tag.ToLowerCase();
-  if (tag == "div")
+  if (tag.Equals("div"))
   {
     return PR_TRUE;
   }
diff --git a/mozilla/editor/base/nsHTMLEditor.cpp b/mozilla/editor/base/nsHTMLEditor.cpp
index 2f16ab35a8d..0f1f82c4ec3 100644
--- a/mozilla/editor/base/nsHTMLEditor.cpp
+++ b/mozilla/editor/base/nsHTMLEditor.cpp
@@ -468,8 +468,8 @@ nsHTMLEditor::SetDocumentCharacterSet(const PRUnichar* characterSet)
             if (NS_FAILED(metaElement->GetAttribute("content", currentValue))) continue; 
 
             PRInt32 offset = currentValue.Find(content.GetUnicode(), PR_TRUE); 
-            if (kNotFound != offset) { 
-              newMetaString.Assign(currentValue, offset); // copy current value before "charset=" (e.g. text/html) 
+            if (kNotFound != offset) {
+              currentValue.Left(newMetaString, offset); // copy current value before "charset=" (e.g. text/html) 
               newMetaString.Append(content); 
               newMetaString.Append(characterSet); 
               result = nsEditor::SetAttribute(metaElement, "content", newMetaString); 
@@ -1407,7 +1407,7 @@ PRBool nsHTMLEditor::IsOnlyAttribute(nsIDOMNode *aNode,
     if (attrString.EqualsIgnoreCase(*aAttribute)) continue;
     // if it's a special _moz... attribute, keep looking
     attrString.Left(tmp,4);
-    if (tmp=="_moz") continue;
+    if (tmp.Equals("_moz")) continue;
     // otherwise, it's another attribute, so return false
     return PR_FALSE;
   }
@@ -1439,7 +1439,7 @@ nsHTMLEditor::HasMatchingAttributes(nsIDOMNode *aNode1,
     attrName->ToString(attrString);
     // if it's a special _moz... attribute, keep going
     attrString.Left(tmp,4);
-    if (tmp=="_moz") continue;
+    if (tmp.Equals("_moz")) continue;
     // otherwise, it's another attribute, so count it
     realCount1++;
     // and compare it to element2's attributes
@@ -1457,7 +1457,7 @@ nsHTMLEditor::HasMatchingAttributes(nsIDOMNode *aNode1,
     attrName->ToString(attrString);
     // if it's a special _moz... attribute, keep going
     attrString.Left(tmp,4);
-    if (tmp=="_moz") continue;
+    if (tmp.Equals("_moz")) continue;
     // otherwise, it's another attribute, so count it
     realCount2++;
   }
@@ -2850,7 +2850,7 @@ nsHTMLEditor::MakeOrChangeList(const nsString& aListType)
   if (!selection) return NS_ERROR_NULL_POINTER;
 
   nsTextRulesInfo ruleInfo(nsHTMLEditRules::kMakeList);
-  if (aListType == "ol") ruleInfo.bOrdered = PR_TRUE;
+  if (aListType.Equals("ol")) ruleInfo.bOrdered = PR_TRUE;
   else  ruleInfo.bOrdered = PR_FALSE;
   res = mRules->WillDoAction(selection, &ruleInfo, &cancel, &handled);
   if (cancel || (NS_FAILED(res))) return res;
@@ -2940,7 +2940,7 @@ nsHTMLEditor::RemoveList(const nsString& aListType)
   if (!selection) return NS_ERROR_NULL_POINTER;
 
   nsTextRulesInfo ruleInfo(nsHTMLEditRules::kRemoveList);
-  if (aListType == "ol") ruleInfo.bOrdered = PR_TRUE;
+  if (aListType.Equals("ol")) ruleInfo.bOrdered = PR_TRUE;
   else  ruleInfo.bOrdered = PR_FALSE;
   res = mRules->WillDoAction(selection, &ruleInfo, &cancel, &handled);
   if (cancel || (NS_FAILED(res))) return res;
@@ -3033,7 +3033,7 @@ nsHTMLEditor::Indent(const nsString& aIndent)
   PRBool cancel, handled;
   PRInt32 theAction = nsHTMLEditRules::kIndent;
   PRInt32 opID = kOpIndent;
-  if (aIndent == "outdent")
+  if (aIndent.Equals("outdent"))
   {
     theAction = nsHTMLEditRules::kOutdent;
     opID = kOpOutdent;
@@ -3271,7 +3271,7 @@ nsHTMLEditor::GetSelectedElement(const nsString& aTagName, nsIDOMElement** aRetu
   nsAutoString TagName = aTagName;
   TagName.ToLowerCase();
   // Empty string indicates we should match any element tag
-  PRBool anyTag = (TagName == "");
+  PRBool anyTag = (TagName.IsEmpty());
   
   //Note that this doesn't need to go through the transaction system
 
@@ -3468,7 +3468,7 @@ nsHTMLEditor::CreateElementWithDefaults(const nsString& aTagName, nsIDOMElement*
   if (aReturn)
     *aReturn = nsnull;
 
-  if (aTagName == "" || !aReturn)
+  if (aTagName.IsEmpty() || !aReturn)
     return NS_ERROR_NULL_POINTER;
     
   nsAutoString TagName = aTagName;
@@ -4131,9 +4131,9 @@ nsHTMLEditor::GetEmbeddedObjects(nsISupportsArray** aNodeList)
         tagName.ToLowerCase();
 
         // See if it's an image or an embed
-        if (tagName == "img" || tagName == "embed")
+        if (tagName.Equals("img") || tagName.Equals("embed"))
           (*aNodeList)->AppendElement(node);
-        else if (tagName == "a")
+        else if (tagName.Equals("a"))
         {
           // XXX Only include links if they're links to file: URLs
           nsCOMPtr anchor (do_QueryInterface(content));
@@ -4727,7 +4727,7 @@ NS_IMETHODIMP nsHTMLEditor::OutputToString(nsString& aOutputString,
     
     // special-case for empty document when requesting plain text,
     // to account for the bogus text node
-    if (aFormatType == "text/plain")
+    if (aFormatType.Equals("text/plain"))
     {
       PRBool docEmpty;
       rv = GetDocumentIsEmpty(&docEmpty);
@@ -4813,7 +4813,7 @@ NS_IMETHODIMP nsHTMLEditor::OutputToStream(nsIOutputStream* aOutputStream,
 
   // special-case for empty document when requesting plain text,
   // to account for the bogus text node
-  if (aFormatType == "text/plain")
+  if (aFormatType.Equals("text/plain"))
   {
     PRBool docEmpty;
     rv = GetDocumentIsEmpty(&docEmpty);
@@ -5063,7 +5063,7 @@ nsHTMLEditor::CanContainTag(nsIDOMNode* aParent, const nsString &aTag)
 {
   // CNavDTD gives some unwanted results.  We override them here.
   // if parent is a list and tag is text, say "no". 
-  if (IsListNode(aParent) && (aTag == "__moz_text"))
+  if (IsListNode(aParent) && (aTag.Equals("__moz_text")))
     return PR_FALSE;
   // else fall thru
   return nsEditor::CanContainTag(aParent, aTag);
@@ -6239,7 +6239,7 @@ nsHTMLEditor::IsTable(nsIDOMNode *node)
   NS_PRECONDITION(node, "null node passed to nsHTMLEditor::IsTable");
   nsAutoString tag;
   nsEditor::GetTagString(node,tag);
-  if (tag == "table")
+  if (tag.Equals("table"))
   {
     return PR_TRUE;
   }
@@ -6256,7 +6256,7 @@ nsHTMLEditor::IsTableCell(nsIDOMNode *node)
   NS_PRECONDITION(node, "null node passed to nsHTMLEditor::IsTableCell");
   nsAutoString tag;
   nsEditor::GetTagString(node,tag);
-  if (tag == "td" || tag == "th")
+  if (tag.Equals("td") || tag.Equals("th"))
   {
     return PR_TRUE;
   }
@@ -6273,10 +6273,10 @@ nsHTMLEditor::IsTableElement(nsIDOMNode *node)
   NS_PRECONDITION(node, "null node passed to nsHTMLEditor::IsTableElement");
   nsAutoString tagName;
   nsEditor::GetTagString(node,tagName);
-  if (tagName == "table" || tagName == "tr" || 
-      tagName == "td"    || tagName == "th" ||
-      tagName == "thead" || tagName == "tfoot" ||
-      tagName == "tbody" || tagName == "caption")
+  if (tagName.Equals("table") || tagName.Equals("tr") || 
+      tagName.Equals("td")    || tagName.Equals("th") ||
+      tagName.Equals("thead") || tagName.Equals("tfoot") ||
+      tagName.Equals("tbody") || tagName.Equals("caption"))
   {
     return PR_TRUE;
   }
diff --git a/mozilla/editor/base/nsTextEditRules.cpp b/mozilla/editor/base/nsTextEditRules.cpp
index 803d0cf1de9..744ef7dafd8 100644
--- a/mozilla/editor/base/nsTextEditRules.cpp
+++ b/mozilla/editor/base/nsTextEditRules.cpp
@@ -624,7 +624,7 @@ nsTextEditRules::WillInsertText(PRInt32          aAction,
     theString.Cut(0, pos);
 
     // is it a solo return?
-    if (partialString == "\n")
+    if (partialString.Equals("\n"))
     {
       res = mEditor->InsertBreak();
     }
diff --git a/mozilla/editor/composer/src/nsEditorShell.cpp b/mozilla/editor/composer/src/nsEditorShell.cpp
index 48a80a017d4..bd1395e9583 100644
--- a/mozilla/editor/composer/src/nsEditorShell.cpp
+++ b/mozilla/editor/composer/src/nsEditorShell.cpp
@@ -574,7 +574,7 @@ nsEditorShell::SetEditorType(const PRUnichar *editorType)
     
   nsAutoString  theType = editorType;
   theType.ToLowerCase();
-  if (theType == "text" || theType == "html" || theType == "" || theType == "htmlmail")
+  if (theType.Equals("text") || theType.Equals("html") || theType.IsEmpty() || theType.Equals("htmlmail"))
   {
     mEditorTypeString = theType;
     return NS_OK;
@@ -606,17 +606,17 @@ nsEditorShell::InstantiateEditor(nsIDOMDocument *aDoc, nsIPresShell *aPresShell)
     
   if (NS_SUCCEEDED(err))
   {
-    if (mEditorTypeString == "text")
+    if (mEditorTypeString.Equals("text"))
     {
       err = editor->Init(aDoc, aPresShell, nsIHTMLEditor::eEditorPlaintextMask);
       mEditorType = ePlainTextEditorType;
     }
-    else if (mEditorTypeString == "html" || mEditorTypeString == "")  // empty string default to HTML editor
+    else if (mEditorTypeString.Equals("html") || mEditorTypeString.IsEmpty())  // empty string default to HTML editor
     {
       err = editor->Init(aDoc, aPresShell, 0);
       mEditorType = eHTMLTextEditorType;
     }
-    else if (mEditorTypeString == "htmlmail")  //  HTML editor with special mail rules
+    else if (mEditorTypeString.Equals("htmlmail"))  //  HTML editor with special mail rules
     {
       err = editor->Init(aDoc, aPresShell, nsIHTMLEditor::eEditorMailMask);
       mEditorType = eHTMLTextEditorType;
@@ -876,7 +876,7 @@ nsEditorShell::RemoveTextProperty(const PRUnichar *prop, const PRUnichar *attr)
   nsAutoString  aAttr(attr);
   
   allStr.ToLowerCase();
-  PRBool    doingAll = (allStr == "all");
+  PRBool    doingAll = (allStr.Equals("all"));
   nsresult  err = NS_OK;
 
   if (doingAll)
@@ -1439,7 +1439,7 @@ nsEditorShell::SaveDocument(PRBool saveAs, PRBool saveCopy, PRBool *_retval)
                 {
                   // remove cruft before file name including '/'
                   // if the url ends with a '/' then the whole string will be cut
-                  urlstring = urlstring.Cut(0, index + 1);
+                  urlstring.Cut(0, index + 1);
                   if (urlstring.Length() > 0)
                     fileName = urlstring;
                 }
@@ -1462,7 +1462,8 @@ nsEditorShell::SaveDocument(PRBool saveAs, PRBool saveCopy, PRBool *_retval)
                 title = title.ReplaceChar(fslash, underscore);
                 title = title.ReplaceChar(at, underscore);
                 title = title.ReplaceChar(colon, underscore);
-                fileName = title + nsString(".html");
+                fileName = title;
+                fileName.Append(".html");
               }
             } 
             else
@@ -2727,7 +2728,7 @@ nsEditorShell::MakeOrChangeList(const PRUnichar *listType)
   switch (mEditorType)
   {
     case eHTMLTextEditorType:
-      if (aListType == "")
+      if (aListType.IsEmpty())
       {
         err = mEditor->RemoveList("ol");
         if(NS_SUCCEEDED(err))
@@ -2759,7 +2760,7 @@ nsEditorShell::RemoveList(const PRUnichar *listType)
   switch (mEditorType)
   {
     case eHTMLTextEditorType:
-      if (aListType == "")
+      if (aListType.IsEmpty())
       {
         err = mEditor->RemoveList("ol");
         if(NS_SUCCEEDED(err))
diff --git a/mozilla/editor/libeditor/base/nsEditor.cpp b/mozilla/editor/libeditor/base/nsEditor.cpp
index bced719e5c7..4a5e1c69110 100644
--- a/mozilla/editor/libeditor/base/nsEditor.cpp
+++ b/mozilla/editor/libeditor/base/nsEditor.cpp
@@ -2503,7 +2503,7 @@ nsEditor::CloneAttributes(nsIDOMNode *aDestNode, nsIDOMNode *aSourceNode)
         {
           nsAutoString sourceAttrValue;
           if (NS_SUCCEEDED(sourceAttribute->GetValue(sourceAttrValue)) &&
-              sourceAttrValue != "")
+              !sourceAttrValue.IsEmpty())
           {
             destElement->SetAttribute(sourceAttrName, sourceAttrValue);
           } else {
diff --git a/mozilla/editor/libeditor/base/nsEditorCommands.cpp b/mozilla/editor/libeditor/base/nsEditorCommands.cpp
index 6d733c36212..fcc84a448a5 100644
--- a/mozilla/editor/libeditor/base/nsEditorCommands.cpp
+++ b/mozilla/editor/libeditor/base/nsEditorCommands.cpp
@@ -162,9 +162,9 @@ nsPasteCommand::DoCommand(const PRUnichar *aCommand, nsISupports * refCon)
   
   nsresult rv = NS_OK;
   nsAutoString cmdString(aCommand);
-  if (cmdString == "cmd_paste")
+  if (cmdString.Equals("cmd_paste"))
     rv = aEditor->Paste();
-  else if (cmdString == "cmd_pasteQuote")
+  else if (cmdString.Equals("cmd_pasteQuote"))
   {
     nsCOMPtr mailEditor = do_QueryInterface(aEditor, &rv);
     if (mailEditor)
@@ -187,19 +187,19 @@ nsDeleteCommand::IsCommandEnabled(const PRUnichar *aCommand, nsISupports * refCo
   
   nsAutoString cmdString(aCommand);
 
-  if (cmdString == "cmd_delete")
+  if (cmdString.Equals("cmd_delete"))
     rv = aEditor->CanCut(*outCmdEnabled);
-  else if (cmdString == "cmd_deleteCharBackward")
+  else if (cmdString.Equals("cmd_deleteCharBackward"))
     *outCmdEnabled = PR_TRUE;
-  else if (cmdString == "cmd_deleteCharForward")
+  else if (cmdString.Equals("cmd_deleteCharForward"))
     *outCmdEnabled = PR_TRUE;
-  else if (cmdString == "cmd_deleteWordBackward")
+  else if (cmdString.Equals("cmd_deleteWordBackward"))
     *outCmdEnabled = PR_TRUE;
-  else if (cmdString == "cmd_deleteWordForward")
+  else if (cmdString.Equals("cmd_deleteWordForward"))
     *outCmdEnabled = PR_TRUE;
-  else if (cmdString == "cmd_deleteToBeginningOfLine")
+  else if (cmdString.Equals("cmd_deleteToBeginningOfLine"))
     *outCmdEnabled = PR_TRUE;
-  else if (cmdString == "cmd_deleteToEndOfLine")
+  else if (cmdString.Equals("cmd_deleteToEndOfLine"))
     *outCmdEnabled = PR_TRUE;  
 
   return rv;
@@ -217,19 +217,19 @@ nsDeleteCommand::DoCommand(const PRUnichar *aCommand, nsISupports * refCon)
 
   nsIEditor::EDirection deleteDir = nsIEditor::eNone;
   
-  if (cmdString == "cmd_delete")
+  if (cmdString.Equals("cmd_delete"))
     deleteDir = nsIEditor::ePrevious;
-  else if (cmdString == "cmd_deleteCharBackward")
+  else if (cmdString.Equals("cmd_deleteCharBackward"))
     deleteDir = nsIEditor::ePrevious;
-  else if (cmdString == "cmd_deleteCharForward")
+  else if (cmdString.Equals("cmd_deleteCharForward"))
     deleteDir = nsIEditor::eNext;
-  else if (cmdString == "cmd_deleteWordBackward")
+  else if (cmdString.Equals("cmd_deleteWordBackward"))
     deleteDir = nsIEditor::ePreviousWord;
-  else if (cmdString == "cmd_deleteWordForward")
+  else if (cmdString.Equals("cmd_deleteWordForward"))
     deleteDir = nsIEditor::eNextWord;
-  else if (cmdString == "cmd_deleteToBeginningOfLine")
+  else if (cmdString.Equals("cmd_deleteToBeginningOfLine"))
     deleteDir = nsIEditor::eToBeginningOfLine;
-  else if (cmdString == "cmd_deleteToEndOfLine")
+  else if (cmdString.Equals("cmd_deleteToEndOfLine"))
     deleteDir = nsIEditor::eToEndOfLine;
 
   return aEditor->DeleteSelection(deleteDir);
@@ -291,81 +291,81 @@ nsSelectionMoveCommands::DoCommand(const PRUnichar *aCommand, nsISupports * refC
   nsAutoString cmdString(aCommand);
   
   // complete scroll commands
-  if (cmdString == "cmd_scrollTop")
+  if (cmdString.Equals("cmd_scrollTop"))
     return selCont->CompleteScroll(PR_FALSE);
-  else if (cmdString == "cmd_scrollBottom")
+  else if (cmdString.Equals("cmd_scrollBottom"))
     return selCont->CompleteScroll(PR_TRUE);
 
   // complete move commands
-  else if (cmdString == "cmd_moveTop")
+  else if (cmdString.Equals("cmd_moveTop"))
     return selCont->CompleteMove(PR_FALSE, PR_FALSE);
-  else if (cmdString == "cmd_moveBottom")
+  else if (cmdString.Equals("cmd_moveBottom"))
     return selCont->CompleteMove(PR_TRUE, PR_FALSE);
-  else if (cmdString == "cmd_selectTop")
+  else if (cmdString.Equals("cmd_selectTop"))
     return selCont->CompleteMove(PR_FALSE, PR_TRUE);
-  else if (cmdString == "cmd_selectBottom")
+  else if (cmdString.Equals("cmd_selectBottom"))
     return selCont->CompleteMove(PR_TRUE, PR_TRUE);
 
   // line move commands
-  else if (cmdString == "cmd_lineNext")
+  else if (cmdString.Equals("cmd_lineNext"))
     return selCont->LineMove(PR_TRUE, PR_FALSE);
-  else if (cmdString == "cmd_linePrevious")
+  else if (cmdString.Equals("cmd_linePrevious"))
     return selCont->LineMove(PR_FALSE, PR_FALSE);
-  else if (cmdString == "cmd_selectLineNext")
+  else if (cmdString.Equals("cmd_selectLineNext"))
     return selCont->LineMove(PR_TRUE, PR_TRUE);
-  else if (cmdString == "cmd_selectLinePrevious")
+  else if (cmdString.Equals("cmd_selectLinePrevious"))
     return selCont->LineMove(PR_FALSE, PR_TRUE);
 
   // character move commands
-  else if (cmdString == "cmd_charPrevious")
+  else if (cmdString.Equals("cmd_charPrevious"))
     return selCont->CharacterMove(PR_FALSE, PR_FALSE);
-  else if (cmdString == "cmd_charNext")
+  else if (cmdString.Equals("cmd_charNext"))
     return selCont->CharacterMove(PR_TRUE, PR_FALSE);
-  else if (cmdString == "cmd_selectCharPrevious")
+  else if (cmdString.Equals("cmd_selectCharPrevious"))
     return selCont->CharacterMove(PR_FALSE, PR_TRUE);
-  else if (cmdString == "cmd_selectCharNext")
+  else if (cmdString.Equals("cmd_selectCharNext"))
     return selCont->CharacterMove(PR_TRUE, PR_TRUE);
 
   // intra line move commands
-  else if (cmdString == "cmd_beginLine")
+  else if (cmdString.Equals("cmd_beginLine"))
     return selCont->IntraLineMove(PR_FALSE, PR_FALSE);
-  else if (cmdString == "cmd_endLine")
+  else if (cmdString.Equals("cmd_endLine"))
     return selCont->IntraLineMove(PR_TRUE, PR_FALSE);
-  else if (cmdString == "cmd_selectBeginLine")
+  else if (cmdString.Equals("cmd_selectBeginLine"))
     return selCont->IntraLineMove(PR_FALSE, PR_TRUE);
-  else if (cmdString == "cmd_selectEndLine")
+  else if (cmdString.Equals("cmd_selectEndLine"))
     return selCont->IntraLineMove(PR_TRUE, PR_TRUE);
   
   // word move commands
-  else if (cmdString == "cmd_wordPrevious")
+  else if (cmdString.Equals("cmd_wordPrevious"))
     return selCont->WordMove(PR_FALSE, PR_FALSE);
-  else if (cmdString == "cmd_wordNext")
+  else if (cmdString.Equals("cmd_wordNext"))
     return selCont->WordMove(PR_TRUE, PR_FALSE);
-  else if (cmdString == "cmd_selectWordPrevious")
+  else if (cmdString.Equals("cmd_selectWordPrevious"))
     return selCont->WordMove(PR_FALSE, PR_TRUE);
-  else if (cmdString == "cmd_selectWordNext")
+  else if (cmdString.Equals("cmd_selectWordNext"))
     return selCont->WordMove(PR_TRUE, PR_TRUE);
   
   // scroll page commands
-  else if (cmdString == "cmd_scrollPageUp")
+  else if (cmdString.Equals("cmd_scrollPageUp"))
     return selCont->ScrollPage(PR_FALSE);
-  else if (cmdString == "cmd_scrollPageDown")
+  else if (cmdString.Equals("cmd_scrollPageDown"))
     return selCont->ScrollPage(PR_TRUE);
   
   // scroll line commands
-  else if (cmdString == "cmd_scrollLineUp")
+  else if (cmdString.Equals("cmd_scrollLineUp"))
     return selCont->ScrollLine(PR_FALSE);
-  else if (cmdString == "cmd_scrollLineDown")
+  else if (cmdString.Equals("cmd_scrollLineDown"))
     return selCont->ScrollLine(PR_TRUE);
   
   // page move commands
-  else if (cmdString == "cmd_scrollPageUp")
+  else if (cmdString.Equals("cmd_scrollPageUp"))
     return selCont->PageMove(PR_FALSE, PR_FALSE);
-  else if (cmdString == "cmd_scrollPageDown")
+  else if (cmdString.Equals("cmd_scrollPageDown"))
     return selCont->PageMove(PR_TRUE, PR_FALSE);
-  else if (cmdString == "cmd_selectPageUp")
+  else if (cmdString.Equals("cmd_selectPageUp"))
     return selCont->PageMove(PR_FALSE, PR_TRUE);
-  else if (cmdString == "cmd_selectPageDown")
+  else if (cmdString.Equals("cmd_selectPageDown"))
     return selCont->PageMove(PR_TRUE, PR_TRUE);
     
   return NS_ERROR_FAILURE;
diff --git a/mozilla/editor/libeditor/base/nsEditorController.cpp b/mozilla/editor/libeditor/base/nsEditorController.cpp
index 5bd48baa7ad..3c6d8bc075c 100644
--- a/mozilla/editor/libeditor/base/nsEditorController.cpp
+++ b/mozilla/editor/libeditor/base/nsEditorController.cpp
@@ -218,7 +218,7 @@ NS_IMETHODIMP nsEditorController::IsCommandEnabled(const PRUnichar *aCommand, PR
   {
 #if DEBUG
     nsCAutoString msg("EditorController asked about a command that it does not handle -- ");
-    msg += aCommand;
+    msg.Append(aCommand);
     NS_WARNING(msg);
 #endif
     return NS_OK;    // we don't handle this command
@@ -264,7 +264,7 @@ NS_IMETHODIMP nsEditorController::DoCommand(const PRUnichar *aCommand)
   {
 #if DEBUG
     nsCAutoString msg("EditorController asked to do a command that it does not handle -- ");
-    msg += aCommand;
+    msg.Append(aCommand);
     NS_WARNING(msg);
 #endif
     return NS_OK;    // we don't handle this command
diff --git a/mozilla/editor/libeditor/html/nsHTMLEditRules.cpp b/mozilla/editor/libeditor/html/nsHTMLEditRules.cpp
index a7e506eac97..394a62c1868 100644
--- a/mozilla/editor/libeditor/html/nsHTMLEditRules.cpp
+++ b/mozilla/editor/libeditor/html/nsHTMLEditRules.cpp
@@ -468,7 +468,7 @@ nsHTMLEditRules::WillInsertText(PRInt32          aAction,
         theString.Left(partialString, pos);
         theString.Cut(0, pos);
         // is it a return?
-        if (partialString == "\n")
+        if (partialString.Equals("\n"))
         {
           res = mEditor->JoeCreateBR(&curNode, &curOffset, &unused, nsIEditor::eNone);
         }
@@ -492,13 +492,13 @@ nsHTMLEditRules::WillInsertText(PRInt32          aAction,
         theString.Left(partialString, pos);
         theString.Cut(0, pos);
         // is it a tab?
-        if (partialString == "\t")
+        if (partialString.Equals("\t"))
         {
           partialString = "    ";
           res = mEditor->JoeInsertTextImpl(tabString, &curNode, &curOffset, doc);
         }
         // is it a return?
-        else if (partialString == "\n")
+        else if (partialString.Equals("\n"))
         {
           res = mEditor->JoeCreateBR(&curNode, &curOffset, &unused, nsIEditor::eNone);
         }
@@ -3136,7 +3136,7 @@ nsHTMLEditRules::ApplyBlockStyle(nsISupportsArray *arrayOfNodes, const nsString
   
   // we special case an empty tag name to mean "remove block parents".
   // This is used for the "normal" paragraph style in mail-compose
-  if (aBlockTag->IsEmpty() || *aBlockTag=="normal") bNoParent = PR_TRUE;
+  if (aBlockTag->IsEmpty() || aBlockTag->Equals("normal")) bNoParent = PR_TRUE;
   
   arrayOfNodes->Count(&listCount);
   
@@ -3163,15 +3163,15 @@ nsHTMLEditRules::ApplyBlockStyle(nsISupportsArray *arrayOfNodes, const nsString
     // it with a new block of correct type.
     // xxx floppy moose: pre cant hold everything the others can
     if (nsHTMLEditUtils::IsMozDiv(curNode)     ||
-        (curNodeTag == "pre") || 
-        (curNodeTag == "p")   ||
-        (curNodeTag == "h1")  ||
-        (curNodeTag == "h2")  ||
-        (curNodeTag == "h3")  ||
-        (curNodeTag == "h4")  ||
-        (curNodeTag == "h5")  ||
-        (curNodeTag == "h6")  ||
-        (curNodeTag == "address"))
+        (curNodeTag.Equals("pre")) || 
+        (curNodeTag.Equals("p"))   ||
+        (curNodeTag.Equals("h1"))  ||
+        (curNodeTag.Equals("h2"))  ||
+        (curNodeTag.Equals("h3"))  ||
+        (curNodeTag.Equals("h4"))  ||
+        (curNodeTag.Equals("h5"))  ||
+        (curNodeTag.Equals("h6"))  ||
+        (curNodeTag.Equals("address")))
     {
       curBlock = 0;  // forget any previous block used for previous inline nodes
       if (bNoParent)
@@ -3187,15 +3187,15 @@ nsHTMLEditRules::ApplyBlockStyle(nsISupportsArray *arrayOfNodes, const nsString
       }
       if (NS_FAILED(res)) return res;
     }
-    else if ((curNodeTag == "table")      || 
-             (curNodeTag == "tbody")      ||
-             (curNodeTag == "tr")         ||
-             (curNodeTag == "td")         ||
-             (curNodeTag == "ol")         ||
-             (curNodeTag == "ul")         ||
-             (curNodeTag == "li")         ||
-             (curNodeTag == "blockquote") ||
-             (curNodeTag == "div"))  // div's other than mozdivs
+    else if ((curNodeTag.Equals("table"))      || 
+             (curNodeTag.Equals("tbody"))      ||
+             (curNodeTag.Equals("tr"))         ||
+             (curNodeTag.Equals("td"))         ||
+             (curNodeTag.Equals("ol"))         ||
+             (curNodeTag.Equals("ul"))         ||
+             (curNodeTag.Equals("li"))         ||
+             (curNodeTag.Equals("blockquote")) ||
+             (curNodeTag.Equals("div")))  // div's other than mozdivs
     {
       curBlock = 0;  // forget any previous block used for previous inline nodes
       // recursion time
@@ -3207,7 +3207,7 @@ nsHTMLEditRules::ApplyBlockStyle(nsISupportsArray *arrayOfNodes, const nsString
     }
     
     // if the node is a break, we honor it by putting further nodes in a new parent
-    else if (curNodeTag == "br")
+    else if (curNodeTag.Equals("br"))
     {
       curBlock = 0;  // forget any previous block used for previous inline nodes
       if (!bNoParent)
@@ -3228,7 +3228,7 @@ nsHTMLEditRules::ApplyBlockStyle(nsISupportsArray *arrayOfNodes, const nsString
     else if (nsEditor::IsInlineNode(curNode) && !bNoParent)
     {
       // if curNode is a non editable, drop it if we are going to 
-      if ((*aBlockTag == "pre") && (!mEditor->IsEditable(curNode)))
+      if ((aBlockTag->Equals("pre")) && (!mEditor->IsEditable(curNode)))
         continue; // do nothing to this block
       
       // if no curBlock, make one
@@ -3946,7 +3946,7 @@ nsHTMLEditRules::ConvertWhitespace(const nsString & inString, nsString & outStri
       outString = "";
       return NS_OK;
     case 1:
-      if (inString == "\n")   // a bit of a hack: don't convert single newlines that 
+      if (inString.Equals("\n"))   // a bit of a hack: don't convert single newlines that 
         outString = "\n";     // dont have whitespace adjacent.  This is to preserve 
       else                    // html source formatting to some degree.
         outString = " ";
diff --git a/mozilla/editor/libeditor/html/nsHTMLEditUtils.cpp b/mozilla/editor/libeditor/html/nsHTMLEditUtils.cpp
index 8eaf70b5a40..6dd7ee91f0f 100644
--- a/mozilla/editor/libeditor/html/nsHTMLEditUtils.cpp
+++ b/mozilla/editor/libeditor/html/nsHTMLEditUtils.cpp
@@ -41,7 +41,7 @@ nsHTMLEditUtils::IsBody(nsIDOMNode *node)
   nsAutoString tag;
   nsEditor::GetTagString(node,tag);
   tag.ToLowerCase();
-  if (tag == "body")
+  if (tag.Equals("body"))
   {
     return PR_TRUE;
   }
@@ -60,7 +60,7 @@ nsHTMLEditUtils::IsBreak(nsIDOMNode *node)
   nsAutoString tag;
   nsEditor::GetTagString(node,tag);
   tag.ToLowerCase();
-  if (tag == "br")
+  if (tag.Equals("br"))
   {
     return PR_TRUE;
   }
@@ -78,7 +78,7 @@ nsHTMLEditUtils::IsBig(nsIDOMNode *node)
   nsAutoString tag;
   nsEditor::GetTagString(node,tag);
   tag.ToLowerCase();
-  if (tag == "big")
+  if (tag.Equals("big"))
   {
     return PR_TRUE;
   }
@@ -96,7 +96,7 @@ nsHTMLEditUtils::IsSmall(nsIDOMNode *node)
   nsAutoString tag;
   nsEditor::GetTagString(node,tag);
   tag.ToLowerCase();
-  if (tag == "small")
+  if (tag.Equals("small"))
   {
     return PR_TRUE;
   }
@@ -132,7 +132,7 @@ nsHTMLEditUtils::HasMozAttr(nsIDOMNode *node)
     nsAutoString typeAttrVal;
     nsresult res = elem->GetAttribute(typeAttrName, typeAttrVal);
     typeAttrVal.ToLowerCase();
-    if (NS_SUCCEEDED(res) && (typeAttrVal == "_moz"))
+    if (NS_SUCCEEDED(res) && (typeAttrVal.Equals("_moz")))
       return PR_TRUE;
   }
   return PR_FALSE;
@@ -174,12 +174,12 @@ nsHTMLEditUtils::IsHeader(nsIDOMNode *node)
   nsAutoString tag;
   nsEditor::GetTagString(node,tag);
   tag.ToLowerCase();
-  if ( (tag == "h1") ||
-       (tag == "h2") ||
-       (tag == "h3") ||
-       (tag == "h4") ||
-       (tag == "h5") ||
-       (tag == "h6") )
+  if ( (tag.Equals("h1")) ||
+       (tag.Equals("h2")) ||
+       (tag.Equals("h3")) ||
+       (tag.Equals("h4")) ||
+       (tag.Equals("h5")) ||
+       (tag.Equals("h6")) )
   {
     return PR_TRUE;
   }
@@ -197,7 +197,7 @@ nsHTMLEditUtils::IsParagraph(nsIDOMNode *node)
   nsAutoString tag;
   nsEditor::GetTagString(node,tag);
   tag.ToLowerCase();
-  if (tag == "p")
+  if (tag.Equals("p"))
   {
     return PR_TRUE;
   }
@@ -215,7 +215,7 @@ nsHTMLEditUtils::IsListItem(nsIDOMNode *node)
   nsAutoString tag;
   nsEditor::GetTagString(node,tag);
   tag.ToLowerCase();
-  if (tag == "li")
+  if (tag.Equals("li"))
   {
     return PR_TRUE;
   }
@@ -232,7 +232,7 @@ nsHTMLEditUtils::IsTable(nsIDOMNode *node)
   NS_PRECONDITION(node, "null node passed to nsHTMLEditor::IsTable");
   nsAutoString tag;
   nsEditor::GetTagString(node,tag);
-  if (tag == "table")
+  if (tag.Equals("table"))
     return PR_TRUE;
 
   return PR_FALSE;
@@ -248,7 +248,7 @@ nsHTMLEditUtils::IsTableRow(nsIDOMNode *node)
   nsAutoString tag;
   nsEditor::GetTagString(node,tag);
   tag.ToLowerCase();
-  if (tag == "tr")
+  if (tag.Equals("tr"))
   {
     return PR_TRUE;
   }
@@ -266,7 +266,7 @@ nsHTMLEditUtils::IsTableCell(nsIDOMNode *node)
   nsAutoString tag;
   nsEditor::GetTagString(node,tag);
   tag.ToLowerCase();
-  if (tag == "td" || tag == "th")
+  if (tag.Equals("td") || tag.Equals("th"))
   {
     return PR_TRUE;
   }
@@ -284,8 +284,8 @@ nsHTMLEditUtils::IsList(nsIDOMNode *node)
   nsAutoString tag;
   nsEditor::GetTagString(node,tag);
   tag.ToLowerCase();
-  if ( (tag == "ol") ||
-       (tag == "ul") )
+  if ( (tag.Equals("ol")) ||
+       (tag.Equals("ul")) )
   {
     return PR_TRUE;
   }
@@ -303,7 +303,7 @@ nsHTMLEditUtils::IsOrderedList(nsIDOMNode *node)
   nsAutoString tag;
   nsEditor::GetTagString(node,tag);
   tag.ToLowerCase();
-  if (tag == "ol")
+  if (tag.Equals("ol"))
   {
     return PR_TRUE;
   }
@@ -321,7 +321,7 @@ nsHTMLEditUtils::IsUnorderedList(nsIDOMNode *node)
   nsAutoString tag;
   nsEditor::GetTagString(node,tag);
   tag.ToLowerCase();
-  if (tag == "ul")
+  if (tag.Equals("ul"))
   {
     return PR_TRUE;
   }
@@ -339,7 +339,7 @@ nsHTMLEditUtils::IsBlockquote(nsIDOMNode *node)
   nsAutoString tag;
   nsEditor::GetTagString(node,tag);
   tag.ToLowerCase();
-  if (tag == "blockquote")
+  if (tag.Equals("blockquote"))
   {
     return PR_TRUE;
   }
@@ -357,7 +357,7 @@ nsHTMLEditUtils::IsPre(nsIDOMNode *node)
   nsAutoString tag;
   nsEditor::GetTagString(node,tag);
   tag.ToLowerCase();
-  if (tag == "pre")
+  if (tag.Equals("pre"))
   {
     return PR_TRUE;
   }
@@ -375,7 +375,7 @@ nsHTMLEditUtils::IsAddress(nsIDOMNode *node)
   nsAutoString tag;
   nsEditor::GetTagString(node,tag);
   tag.ToLowerCase();
-  if (tag == "address")
+  if (tag.Equals("address"))
   {
     return PR_TRUE;
   }
@@ -393,7 +393,7 @@ nsHTMLEditUtils::IsAnchor(nsIDOMNode *node)
   nsAutoString tag;
   nsEditor::GetTagString(node,tag);
   tag.ToLowerCase();
-  if (tag == "a")
+  if (tag.Equals("a"))
   {
     return PR_TRUE;
   }
@@ -411,7 +411,7 @@ nsHTMLEditUtils::IsImage(nsIDOMNode *node)
   nsAutoString tag;
   nsEditor::GetTagString(node,tag);
   tag.ToLowerCase();
-  if (tag == "img")
+  if (tag.Equals("img"))
   {
     return PR_TRUE;
   }
@@ -429,7 +429,7 @@ nsHTMLEditUtils::IsDiv(nsIDOMNode *node)
   nsAutoString tag;
   nsEditor::GetTagString(node,tag);
   tag.ToLowerCase();
-  if (tag == "div")
+  if (tag.Equals("div"))
   {
     return PR_TRUE;
   }
diff --git a/mozilla/editor/libeditor/html/nsHTMLEditor.cpp b/mozilla/editor/libeditor/html/nsHTMLEditor.cpp
index 2f16ab35a8d..0f1f82c4ec3 100644
--- a/mozilla/editor/libeditor/html/nsHTMLEditor.cpp
+++ b/mozilla/editor/libeditor/html/nsHTMLEditor.cpp
@@ -468,8 +468,8 @@ nsHTMLEditor::SetDocumentCharacterSet(const PRUnichar* characterSet)
             if (NS_FAILED(metaElement->GetAttribute("content", currentValue))) continue; 
 
             PRInt32 offset = currentValue.Find(content.GetUnicode(), PR_TRUE); 
-            if (kNotFound != offset) { 
-              newMetaString.Assign(currentValue, offset); // copy current value before "charset=" (e.g. text/html) 
+            if (kNotFound != offset) {
+              currentValue.Left(newMetaString, offset); // copy current value before "charset=" (e.g. text/html) 
               newMetaString.Append(content); 
               newMetaString.Append(characterSet); 
               result = nsEditor::SetAttribute(metaElement, "content", newMetaString); 
@@ -1407,7 +1407,7 @@ PRBool nsHTMLEditor::IsOnlyAttribute(nsIDOMNode *aNode,
     if (attrString.EqualsIgnoreCase(*aAttribute)) continue;
     // if it's a special _moz... attribute, keep looking
     attrString.Left(tmp,4);
-    if (tmp=="_moz") continue;
+    if (tmp.Equals("_moz")) continue;
     // otherwise, it's another attribute, so return false
     return PR_FALSE;
   }
@@ -1439,7 +1439,7 @@ nsHTMLEditor::HasMatchingAttributes(nsIDOMNode *aNode1,
     attrName->ToString(attrString);
     // if it's a special _moz... attribute, keep going
     attrString.Left(tmp,4);
-    if (tmp=="_moz") continue;
+    if (tmp.Equals("_moz")) continue;
     // otherwise, it's another attribute, so count it
     realCount1++;
     // and compare it to element2's attributes
@@ -1457,7 +1457,7 @@ nsHTMLEditor::HasMatchingAttributes(nsIDOMNode *aNode1,
     attrName->ToString(attrString);
     // if it's a special _moz... attribute, keep going
     attrString.Left(tmp,4);
-    if (tmp=="_moz") continue;
+    if (tmp.Equals("_moz")) continue;
     // otherwise, it's another attribute, so count it
     realCount2++;
   }
@@ -2850,7 +2850,7 @@ nsHTMLEditor::MakeOrChangeList(const nsString& aListType)
   if (!selection) return NS_ERROR_NULL_POINTER;
 
   nsTextRulesInfo ruleInfo(nsHTMLEditRules::kMakeList);
-  if (aListType == "ol") ruleInfo.bOrdered = PR_TRUE;
+  if (aListType.Equals("ol")) ruleInfo.bOrdered = PR_TRUE;
   else  ruleInfo.bOrdered = PR_FALSE;
   res = mRules->WillDoAction(selection, &ruleInfo, &cancel, &handled);
   if (cancel || (NS_FAILED(res))) return res;
@@ -2940,7 +2940,7 @@ nsHTMLEditor::RemoveList(const nsString& aListType)
   if (!selection) return NS_ERROR_NULL_POINTER;
 
   nsTextRulesInfo ruleInfo(nsHTMLEditRules::kRemoveList);
-  if (aListType == "ol") ruleInfo.bOrdered = PR_TRUE;
+  if (aListType.Equals("ol")) ruleInfo.bOrdered = PR_TRUE;
   else  ruleInfo.bOrdered = PR_FALSE;
   res = mRules->WillDoAction(selection, &ruleInfo, &cancel, &handled);
   if (cancel || (NS_FAILED(res))) return res;
@@ -3033,7 +3033,7 @@ nsHTMLEditor::Indent(const nsString& aIndent)
   PRBool cancel, handled;
   PRInt32 theAction = nsHTMLEditRules::kIndent;
   PRInt32 opID = kOpIndent;
-  if (aIndent == "outdent")
+  if (aIndent.Equals("outdent"))
   {
     theAction = nsHTMLEditRules::kOutdent;
     opID = kOpOutdent;
@@ -3271,7 +3271,7 @@ nsHTMLEditor::GetSelectedElement(const nsString& aTagName, nsIDOMElement** aRetu
   nsAutoString TagName = aTagName;
   TagName.ToLowerCase();
   // Empty string indicates we should match any element tag
-  PRBool anyTag = (TagName == "");
+  PRBool anyTag = (TagName.IsEmpty());
   
   //Note that this doesn't need to go through the transaction system
 
@@ -3468,7 +3468,7 @@ nsHTMLEditor::CreateElementWithDefaults(const nsString& aTagName, nsIDOMElement*
   if (aReturn)
     *aReturn = nsnull;
 
-  if (aTagName == "" || !aReturn)
+  if (aTagName.IsEmpty() || !aReturn)
     return NS_ERROR_NULL_POINTER;
     
   nsAutoString TagName = aTagName;
@@ -4131,9 +4131,9 @@ nsHTMLEditor::GetEmbeddedObjects(nsISupportsArray** aNodeList)
         tagName.ToLowerCase();
 
         // See if it's an image or an embed
-        if (tagName == "img" || tagName == "embed")
+        if (tagName.Equals("img") || tagName.Equals("embed"))
           (*aNodeList)->AppendElement(node);
-        else if (tagName == "a")
+        else if (tagName.Equals("a"))
         {
           // XXX Only include links if they're links to file: URLs
           nsCOMPtr anchor (do_QueryInterface(content));
@@ -4727,7 +4727,7 @@ NS_IMETHODIMP nsHTMLEditor::OutputToString(nsString& aOutputString,
     
     // special-case for empty document when requesting plain text,
     // to account for the bogus text node
-    if (aFormatType == "text/plain")
+    if (aFormatType.Equals("text/plain"))
     {
       PRBool docEmpty;
       rv = GetDocumentIsEmpty(&docEmpty);
@@ -4813,7 +4813,7 @@ NS_IMETHODIMP nsHTMLEditor::OutputToStream(nsIOutputStream* aOutputStream,
 
   // special-case for empty document when requesting plain text,
   // to account for the bogus text node
-  if (aFormatType == "text/plain")
+  if (aFormatType.Equals("text/plain"))
   {
     PRBool docEmpty;
     rv = GetDocumentIsEmpty(&docEmpty);
@@ -5063,7 +5063,7 @@ nsHTMLEditor::CanContainTag(nsIDOMNode* aParent, const nsString &aTag)
 {
   // CNavDTD gives some unwanted results.  We override them here.
   // if parent is a list and tag is text, say "no". 
-  if (IsListNode(aParent) && (aTag == "__moz_text"))
+  if (IsListNode(aParent) && (aTag.Equals("__moz_text")))
     return PR_FALSE;
   // else fall thru
   return nsEditor::CanContainTag(aParent, aTag);
@@ -6239,7 +6239,7 @@ nsHTMLEditor::IsTable(nsIDOMNode *node)
   NS_PRECONDITION(node, "null node passed to nsHTMLEditor::IsTable");
   nsAutoString tag;
   nsEditor::GetTagString(node,tag);
-  if (tag == "table")
+  if (tag.Equals("table"))
   {
     return PR_TRUE;
   }
@@ -6256,7 +6256,7 @@ nsHTMLEditor::IsTableCell(nsIDOMNode *node)
   NS_PRECONDITION(node, "null node passed to nsHTMLEditor::IsTableCell");
   nsAutoString tag;
   nsEditor::GetTagString(node,tag);
-  if (tag == "td" || tag == "th")
+  if (tag.Equals("td") || tag.Equals("th"))
   {
     return PR_TRUE;
   }
@@ -6273,10 +6273,10 @@ nsHTMLEditor::IsTableElement(nsIDOMNode *node)
   NS_PRECONDITION(node, "null node passed to nsHTMLEditor::IsTableElement");
   nsAutoString tagName;
   nsEditor::GetTagString(node,tagName);
-  if (tagName == "table" || tagName == "tr" || 
-      tagName == "td"    || tagName == "th" ||
-      tagName == "thead" || tagName == "tfoot" ||
-      tagName == "tbody" || tagName == "caption")
+  if (tagName.Equals("table") || tagName.Equals("tr") || 
+      tagName.Equals("td")    || tagName.Equals("th") ||
+      tagName.Equals("thead") || tagName.Equals("tfoot") ||
+      tagName.Equals("tbody") || tagName.Equals("caption"))
   {
     return PR_TRUE;
   }
diff --git a/mozilla/editor/libeditor/text/nsTextEditRules.cpp b/mozilla/editor/libeditor/text/nsTextEditRules.cpp
index 803d0cf1de9..744ef7dafd8 100644
--- a/mozilla/editor/libeditor/text/nsTextEditRules.cpp
+++ b/mozilla/editor/libeditor/text/nsTextEditRules.cpp
@@ -624,7 +624,7 @@ nsTextEditRules::WillInsertText(PRInt32          aAction,
     theString.Cut(0, pos);
 
     // is it a solo return?
-    if (partialString == "\n")
+    if (partialString.Equals("\n"))
     {
       res = mEditor->InsertBreak();
     }
diff --git a/mozilla/webshell/tests/viewer/nsBrowserWindow.cpp b/mozilla/webshell/tests/viewer/nsBrowserWindow.cpp
index c7c19d2aa6c..3bad31af1e5 100644
--- a/mozilla/webshell/tests/viewer/nsBrowserWindow.cpp
+++ b/mozilla/webshell/tests/viewer/nsBrowserWindow.cpp
@@ -2782,7 +2782,7 @@ static void DumpAWebShell(nsIDocShellTreeItem* aShellItem, FILE* out, PRInt32 aI
   fprintf(out, "%p '", aShellItem);
   aShellItem->GetName(getter_Copies(name));
   aShellItem->GetSameTypeParent(getter_AddRefs(parent));
-  str = name;
+  str.Assign(name);
   fputs(str, out);
   fprintf(out, "' parent=%p <\n", parent.get());