diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index 722f0529d38..cea8c63a1c1 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -1050,8 +1050,8 @@ nsDocument::SetHeaderData(nsIAtom* aHeaderField, const nsAReadableString& aData) sheet->GetTitle(title); if (!title.IsEmpty()) { // if sheet has title PRBool disabled = (aData.IsEmpty() || - Compare(title, aData, - nsCaseInsensitiveStringComparator()) != 0); + !title.Equals(aData, + nsCaseInsensitiveStringComparator())); SetStyleSheetDisabledState(sheet, disabled); } } diff --git a/content/base/src/nsGenericElement.cpp b/content/base/src/nsGenericElement.cpp index b69cb929477..ea527ab844b 100644 --- a/content/base/src/nsGenericElement.cpp +++ b/content/base/src/nsGenericElement.cpp @@ -839,23 +839,23 @@ nsGenericElement::InternalIsSupported(const nsAReadableString& aFeature, *aReturn = PR_FALSE; nsAutoString feature(aFeature); - if (!Compare(feature, NS_LITERAL_STRING("XML"), nsCaseInsensitiveStringComparator()) || - !Compare(feature, NS_LITERAL_STRING("HTML"), nsCaseInsensitiveStringComparator())) { + if (feature.Equals(NS_LITERAL_STRING("XML"), nsCaseInsensitiveStringComparator()) || + feature.Equals(NS_LITERAL_STRING("HTML"), nsCaseInsensitiveStringComparator())) { if (aVersion.IsEmpty() || aVersion.Equals(NS_LITERAL_STRING("1.0")) || aVersion.Equals(NS_LITERAL_STRING("2.0"))) { *aReturn = PR_TRUE; } - } else if (!Compare(feature, NS_LITERAL_STRING("Views"), nsCaseInsensitiveStringComparator()) || - !Compare(feature, NS_LITERAL_STRING("StyleSheets"), nsCaseInsensitiveStringComparator()) || - !Compare(feature, NS_LITERAL_STRING("CSS"), nsCaseInsensitiveStringComparator()) || -// !Compare(feature, NS_LITERAL_STRING("CSS2"), nsCaseInsensitiveStringComparator()) || - !Compare(feature, NS_LITERAL_STRING("Events"), nsCaseInsensitiveStringComparator()) || -// !Compare(feature, NS_LITERAL_STRING("UIEvents"), nsCaseInsensitiveStringComparator()) || - !Compare(feature, NS_LITERAL_STRING("MouseEvents"), nsCaseInsensitiveStringComparator()) || - !Compare(feature, NS_LITERAL_STRING("MouseScrollEvents"), nsCaseInsensitiveStringComparator()) || - !Compare(feature, NS_LITERAL_STRING("HTMLEvents"), nsCaseInsensitiveStringComparator()) || - !Compare(feature, NS_LITERAL_STRING("Range"), nsCaseInsensitiveStringComparator())) { + } else if (feature.Equals(NS_LITERAL_STRING("Views"), nsCaseInsensitiveStringComparator()) || + feature.Equals(NS_LITERAL_STRING("StyleSheets"), nsCaseInsensitiveStringComparator()) || + feature.Equals(NS_LITERAL_STRING("CSS"), nsCaseInsensitiveStringComparator()) || +// feature.Equals(NS_LITERAL_STRING("CSS2"), nsCaseInsensitiveStringComparator()) || + feature.Equals(NS_LITERAL_STRING("Events"), nsCaseInsensitiveStringComparator()) || +// feature.Equals(NS_LITERAL_STRING("UIEvents"), nsCaseInsensitiveStringComparator()) || + feature.Equals(NS_LITERAL_STRING("MouseEvents"), nsCaseInsensitiveStringComparator()) || + feature.Equals(NS_LITERAL_STRING("MouseScrollEvents"), nsCaseInsensitiveStringComparator()) || + feature.Equals(NS_LITERAL_STRING("HTMLEvents"), nsCaseInsensitiveStringComparator()) || + feature.Equals(NS_LITERAL_STRING("Range"), nsCaseInsensitiveStringComparator())) { if (aVersion.IsEmpty() || aVersion.Equals(NS_LITERAL_STRING("2.0"))) { *aReturn = PR_TRUE; } diff --git a/content/base/src/nsHTMLValue.cpp b/content/base/src/nsHTMLValue.cpp index 48e1b765f2f..3ed6e80a11f 100644 --- a/content/base/src/nsHTMLValue.cpp +++ b/content/base/src/nsHTMLValue.cpp @@ -172,9 +172,8 @@ PRBool nsHTMLValue::operator==(const nsHTMLValue& aOther) const } } else if (nsnull != aOther.mValue.mString) { - return 0 == Compare(nsDependentString(mValue.mString), - nsDependentString(aOther.mValue.mString), - nsCaseInsensitiveStringComparator()); + return nsDependentString(mValue.mString).Equals(nsDependentString(aOther.mValue.mString), + nsCaseInsensitiveStringComparator()); } } else if (eHTMLUnit_ISupports == mUnit) { diff --git a/content/html/content/src/nsHTMLAnchorElement.cpp b/content/html/content/src/nsHTMLAnchorElement.cpp index 5f3ce60390f..ab2f9c370ba 100644 --- a/content/html/content/src/nsHTMLAnchorElement.cpp +++ b/content/html/content/src/nsHTMLAnchorElement.cpp @@ -398,8 +398,8 @@ nsHTMLAnchorElement::StringToAttribute(nsIAtom* aAttribute, } } else if (aAttribute == nsHTMLAtoms::suppress) { - if (Compare(aValue,NS_LITERAL_STRING("true"), - nsCaseInsensitiveStringComparator())) { + if (!aValue.Equals(NS_LITERAL_STRING("true"), + nsCaseInsensitiveStringComparator())) { aResult.SetEmptyValue(); // XXX? shouldn't just leave "true" return NS_CONTENT_ATTR_HAS_VALUE; } diff --git a/content/html/content/src/nsHTMLButtonElement.cpp b/content/html/content/src/nsHTMLButtonElement.cpp index 637231f9907..0e3269ef279 100644 --- a/content/html/content/src/nsHTMLButtonElement.cpp +++ b/content/html/content/src/nsHTMLButtonElement.cpp @@ -212,7 +212,7 @@ nsHTMLButtonElement::SetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName, nsAutoString value(aValue); if (aName == nsHTMLAtoms::disabled && - !Compare(value, NS_LITERAL_STRING("false"), nsCaseInsensitiveStringComparator())) { + value.Equals(NS_LITERAL_STRING("false"), nsCaseInsensitiveStringComparator())) { return UnsetAttr(aNameSpaceID, aName, aNotify); } diff --git a/content/html/style/src/nsCSSDeclaration.cpp b/content/html/style/src/nsCSSDeclaration.cpp index a04f0fd9a59..20675c406d1 100644 --- a/content/html/style/src/nsCSSDeclaration.cpp +++ b/content/html/style/src/nsCSSDeclaration.cpp @@ -5521,7 +5521,7 @@ nsCSSDeclaration::TryBackgroundPosition(nsAWritableString & aString, AppendValueToString(eCSSProperty_background_x_position, backgroundXValue); AppendValueToString(eCSSProperty_background_y_position, backgroundYValue); aString.Append(backgroundYValue); - if (Compare(backgroundXValue, backgroundYValue, nsCaseInsensitiveStringComparator())) { + if (!backgroundXValue.Equals(backgroundYValue, nsCaseInsensitiveStringComparator())) { // the two values are different aString.Append(PRUnichar(' ')); aString.Append(backgroundXValue); diff --git a/content/html/style/src/nsCSSLoader.cpp b/content/html/style/src/nsCSSLoader.cpp index 6a6b7dc2d6d..d3d482f1aca 100644 --- a/content/html/style/src/nsCSSLoader.cpp +++ b/content/html/style/src/nsCSSLoader.cpp @@ -638,9 +638,8 @@ SheetLoadData::OnStreamComplete(nsIStreamLoader* aLoader, } } if (mLoader->mNavQuirkMode || - Compare(contentType, - NS_LITERAL_CSTRING("text/css"), - nsCaseInsensitiveCStringComparator()) == 0 || + contentType.Equals(NS_LITERAL_CSTRING("text/css"), + nsCaseInsensitiveCStringComparator()) || contentType.IsEmpty()) { /* * First determine the charset (if one is indicated) diff --git a/content/html/style/src/nsCSSStruct.cpp b/content/html/style/src/nsCSSStruct.cpp index a04f0fd9a59..20675c406d1 100644 --- a/content/html/style/src/nsCSSStruct.cpp +++ b/content/html/style/src/nsCSSStruct.cpp @@ -5521,7 +5521,7 @@ nsCSSDeclaration::TryBackgroundPosition(nsAWritableString & aString, AppendValueToString(eCSSProperty_background_x_position, backgroundXValue); AppendValueToString(eCSSProperty_background_y_position, backgroundYValue); aString.Append(backgroundYValue); - if (Compare(backgroundXValue, backgroundYValue, nsCaseInsensitiveStringComparator())) { + if (!backgroundXValue.Equals(backgroundYValue, nsCaseInsensitiveStringComparator())) { // the two values are different aString.Append(PRUnichar(' ')); aString.Append(backgroundXValue); diff --git a/content/html/style/src/nsCSSStyleSheet.cpp b/content/html/style/src/nsCSSStyleSheet.cpp index 3cce72167e6..952aad603de 100644 --- a/content/html/style/src/nsCSSStyleSheet.cpp +++ b/content/html/style/src/nsCSSStyleSheet.cpp @@ -201,9 +201,8 @@ PRBool AtomKey_base::Equals(const nsHashKey* aKey) const const PRUnichar *theirStr = nsnull; theirAtom->GetUnicode(&theirStr); - return Compare(nsDependentString(myStr), - nsDependentString(theirStr), - nsCaseInsensitiveStringComparator()) == 0; + return nsDependentString(myStr).Equals(nsDependentString(theirStr), + nsCaseInsensitiveStringComparator()); } @@ -3352,9 +3351,8 @@ static PRBool ValueIncludes(const nsString& aValueList, const nsString& aValue, } } else { - if (!Compare(nsDependentString(value), - nsDependentString(start), - nsCaseInsensitiveStringComparator())) { + if (nsDependentString(value).Equals(nsDependentString(start), + nsCaseInsensitiveStringComparator())) { return PR_TRUE; } } @@ -3648,9 +3646,9 @@ static PRBool SelectorMatches(RuleProcessorData &data, break; } if (isCaseSensitive) - result = PRBool(localTrue == !Compare(Substring(value, 0, selLen), attr->mValue, nsDefaultStringComparator())); + result = PRBool(localTrue == Substring(value, 0, selLen).Equals(attr->mValue, nsDefaultStringComparator())); else - result = PRBool(localTrue == !Compare(Substring(value, 0, selLen), attr->mValue, nsCaseInsensitiveStringComparator())); + result = PRBool(localTrue == Substring(value, 0, selLen).Equals(attr->mValue, nsCaseInsensitiveStringComparator())); } } break; @@ -3662,9 +3660,9 @@ static PRBool SelectorMatches(RuleProcessorData &data, result = localFalse; } else { if (isCaseSensitive) - result = PRBool(localTrue == !Compare(Substring(value, valLen - selLen, selLen), attr->mValue, nsDefaultStringComparator())); + result = PRBool(localTrue == Substring(value, valLen - selLen, selLen).Equals(attr->mValue, nsDefaultStringComparator())); else - result = PRBool(localTrue == !Compare(Substring(value, valLen - selLen, selLen), attr->mValue, nsCaseInsensitiveStringComparator())); + result = PRBool(localTrue == Substring(value, valLen - selLen, selLen).Equals(attr->mValue, nsCaseInsensitiveStringComparator())); } } break; @@ -3676,9 +3674,9 @@ static PRBool SelectorMatches(RuleProcessorData &data, result = localFalse; } else { if (isCaseSensitive) - result = PRBool(localTrue == !Compare(Substring(value, 0, selLen), attr->mValue, nsDefaultStringComparator())); + result = PRBool(localTrue == Substring(value, 0, selLen).Equals(attr->mValue, nsDefaultStringComparator())); else - result = PRBool(localTrue == !Compare(Substring(value, 0, selLen), attr->mValue, nsCaseInsensitiveStringComparator())); + result = PRBool(localTrue == Substring(value, 0, selLen).Equals(attr->mValue, nsCaseInsensitiveStringComparator())); } } break; @@ -3718,8 +3716,8 @@ static PRBool SelectorMatches(RuleProcessorData &data, const PRUnichar* id2Str; IDList->mAtom->GetUnicode(&id2Str); nsDependentString id2(id2Str); - if (localTrue == - (Compare(id1, id2, nsCaseInsensitiveStringComparator()) != 0)) { + if (localTrue != + id1.Equals(id2, nsCaseInsensitiveStringComparator())) { result = PR_FALSE; break; } diff --git a/content/html/style/src/nsHTMLAttributes.cpp b/content/html/style/src/nsHTMLAttributes.cpp index 1a412dc09b0..2c329015a74 100644 --- a/content/html/style/src/nsHTMLAttributes.cpp +++ b/content/html/style/src/nsHTMLAttributes.cpp @@ -1447,7 +1447,7 @@ HTMLAttributesImpl::HasClass(nsIAtom* aClass, PRBool aCaseSensitive) const const PRUnichar* class2Buf; classList->mAtom->GetUnicode(&class2Buf); nsDependentString class2(class2Buf); - if (Compare(class1, class2, nsCaseInsensitiveStringComparator()) == 0) + if (class1.Equals(class2, nsCaseInsensitiveStringComparator())) return NS_OK; classList = classList->mNext; } while (classList); diff --git a/content/shared/src/nsHTMLValue.cpp b/content/shared/src/nsHTMLValue.cpp index 48e1b765f2f..3ed6e80a11f 100644 --- a/content/shared/src/nsHTMLValue.cpp +++ b/content/shared/src/nsHTMLValue.cpp @@ -172,9 +172,8 @@ PRBool nsHTMLValue::operator==(const nsHTMLValue& aOther) const } } else if (nsnull != aOther.mValue.mString) { - return 0 == Compare(nsDependentString(mValue.mString), - nsDependentString(aOther.mValue.mString), - nsCaseInsensitiveStringComparator()); + return nsDependentString(mValue.mString).Equals(nsDependentString(aOther.mValue.mString), + nsCaseInsensitiveStringComparator()); } } else if (eHTMLUnit_ISupports == mUnit) { diff --git a/content/xbl/src/nsXBLPrototypeHandler.cpp b/content/xbl/src/nsXBLPrototypeHandler.cpp index 8756b7ccda1..7e31d38625d 100644 --- a/content/xbl/src/nsXBLPrototypeHandler.cpp +++ b/content/xbl/src/nsXBLPrototypeHandler.cpp @@ -852,16 +852,17 @@ nsXBLPrototypeHandler::ConstructPrototype(nsIContent* aKeyElement, mEventName = getter_AddRefs(NS_NewAtom(event)); if (aPhase) { - if (Compare(nsDependentString(aPhase), NS_LITERAL_STRING("capturing")) == 0) + const nsDependentString phase(aPhase); + if (phase.Equals(NS_LITERAL_STRING("capturing"))) mPhase = NS_PHASE_CAPTURING; - else if (Compare(nsDependentString(aPhase), NS_LITERAL_STRING("target")) == 0) + else if (phase.Equals(NS_LITERAL_STRING("target"))) mPhase = NS_PHASE_TARGET; } // Button and clickcount apply only to XBL handlers and don't apply to XUL key // handlers. - nsAutoString button(aButton); - nsAutoString clickcount(aClickCount); + const nsDependentString button(aButton); + const nsDependentString clickcount(aClickCount); if (!button.IsEmpty()) mDetail = button.First() - '0'; if (!clickcount.IsEmpty()) diff --git a/content/xul/document/src/nsXULContentSink.cpp b/content/xul/document/src/nsXULContentSink.cpp index aec6bc8438f..abe16b6b227 100644 --- a/content/xul/document/src/nsXULContentSink.cpp +++ b/content/xul/document/src/nsXULContentSink.cpp @@ -1444,10 +1444,12 @@ XULContentSinkImpl::OpenScript(const PRUnichar** aAttributes, nsAutoString src; while (*aAttributes) { const nsDependentString key(aAttributes[0]); - if (Compare(key, NS_LITERAL_STRING("src"),nsCaseInsensitiveStringComparator()) == 0) { + if (key.Equals(NS_LITERAL_STRING("src"), + nsCaseInsensitiveStringComparator())) { src.Assign(aAttributes[1]); } - else if (Compare(key, NS_LITERAL_STRING("type"),nsCaseInsensitiveStringComparator()) == 0) { + else if (key.Equals(NS_LITERAL_STRING("type"), + nsCaseInsensitiveStringComparator())) { nsAutoString type(aAttributes[1]); nsAutoString mimeType; nsAutoString params; @@ -1473,7 +1475,8 @@ XULContentSinkImpl::OpenScript(const PRUnichar** aAttributes, jsVersionString = JS_VersionToString(jsVersion); } } - else if (Compare(key, NS_LITERAL_STRING("language"),nsCaseInsensitiveStringComparator()) == 0) { + else if (key.Equals(NS_LITERAL_STRING("language"), + nsCaseInsensitiveStringComparator())) { nsAutoString lang(aAttributes[1]); isJavaScript = nsParserUtils::IsJavaScriptLanguage(lang, &jsVersionString); } diff --git a/editor/libeditor/base/ChangeCSSInlineStyleTxn.cpp b/editor/libeditor/base/ChangeCSSInlineStyleTxn.cpp index b11bcd2b4d6..e58c5b0a1a6 100644 --- a/editor/libeditor/base/ChangeCSSInlineStyleTxn.cpp +++ b/editor/libeditor/base/ChangeCSSInlineStyleTxn.cpp @@ -92,9 +92,8 @@ ChangeCSSInlineStyleTxn::ValueIncludes(const nsAReadableString &aValueList, cons } } else { - if (!Compare(nsDependentString(value), - nsDependentString(start), - nsCaseInsensitiveStringComparator())) { + if (nsDependentString(value).Equals(nsDependentString(start), + nsCaseInsensitiveStringComparator())) { result = PR_TRUE; break; } @@ -370,8 +369,9 @@ ChangeCSSInlineStyleTxn::AcceptsMoreThanOneValue(nsIAtom *aCSSProperty) NS_IMETHODIMP ChangeCSSInlineStyleTxn::AddValueToMultivalueProperty(nsAWritableString & aValues, const nsAReadableString & aNewValue) { - if (!aValues.Length() - || !Compare(aValues, NS_LITERAL_STRING("none"), nsCaseInsensitiveStringComparator())) { + if (aValues.IsEmpty() + || aValues.Equals(NS_LITERAL_STRING("none"), + nsCaseInsensitiveStringComparator())) { // the list of values is empty of the value is 'none' aValues.Assign(aNewValue); } diff --git a/editor/libeditor/html/nsHTMLCSSUtils.cpp b/editor/libeditor/html/nsHTMLCSSUtils.cpp index 3e6632db933..a78614f7628 100644 --- a/editor/libeditor/html/nsHTMLCSSUtils.cpp +++ b/editor/libeditor/html/nsHTMLCSSUtils.cpp @@ -1179,7 +1179,8 @@ nsHTMLCSSUtils::IsCSSEquivalentToHTMLInlineStyleSet(nsIDOMNode * aNode, if (!htmlValueString.Equals(NS_LITERAL_STRING(""))) { nsAutoString leftHTMLValue; htmlValueString.Left(leftHTMLValue, 5); - aIsSet = PRBool(!Compare(leftHTMLValue, leftCSSValue, nsCaseInsensitiveStringComparator())); + aIsSet = leftHTMLValue.Equals(leftCSSValue, + nsCaseInsensitiveStringComparator()); } else { aIsSet = (leftCSSValue.Equals(NS_LITERAL_STRING("times")) || @@ -1202,7 +1203,8 @@ nsHTMLCSSUtils::IsCSSEquivalentToHTMLInlineStyleSet(nsIDOMNode * aNode, } if (!htmlValueString.Equals(NS_LITERAL_STRING(""))) { - if (!Compare(htmlValueString, valueString, nsCaseInsensitiveStringComparator())) { + if (htmlValueString.Equals(valueString, + nsCaseInsensitiveStringComparator())) { aIsSet = PR_TRUE; } } diff --git a/editor/libeditor/html/nsHTMLEditRules.cpp b/editor/libeditor/html/nsHTMLEditRules.cpp index 8b5cb5b0a48..09d7f982535 100644 --- a/editor/libeditor/html/nsHTMLEditRules.cpp +++ b/editor/libeditor/html/nsHTMLEditRules.cpp @@ -2436,7 +2436,7 @@ nsHTMLEditRules::WillMakeList(nsISelection *aSelection, nsAutoString itemType; if (aItemType) itemType = *aItemType; - else if (!Compare(*aListType,NS_LITERAL_STRING("dl"),nsCaseInsensitiveStringComparator())) + else if (aListType->Equals(NS_LITERAL_STRING("dl"),nsCaseInsensitiveStringComparator())) itemType.Assign(NS_LITERAL_STRING("dd")); else itemType.Assign(NS_LITERAL_STRING("li")); @@ -6079,7 +6079,7 @@ nsHTMLEditRules::ApplyBlockStyle(nsISupportsArray *arrayOfNodes, const nsAReadab else if (IsInlineNode(curNode)) { // if curNode is a non editable, drop it if we are going to
-      if (!Compare(tString,NS_LITERAL_STRING("pre"),nsCaseInsensitiveStringComparator()) 
+      if (tString.Equals(NS_LITERAL_STRING("pre"),nsCaseInsensitiveStringComparator()) 
         && (!mHTMLEditor->IsEditable(curNode)))
         continue; // do nothing to this block
       
diff --git a/editor/libeditor/html/nsHTMLEditor.cpp b/editor/libeditor/html/nsHTMLEditor.cpp
index 1a4a9cb386c..99294508016 100644
--- a/editor/libeditor/html/nsHTMLEditor.cpp
+++ b/editor/libeditor/html/nsHTMLEditor.cpp
@@ -2459,7 +2459,7 @@ nsHTMLEditor::RemoveList(const nsAReadableString& aListType)
   if (!selection) return NS_ERROR_NULL_POINTER;
 
   nsTextRulesInfo ruleInfo(nsTextEditRules::kRemoveList);
-  if (!Compare(aListType,NS_LITERAL_STRING("ol"),nsCaseInsensitiveStringComparator()))
+  if (aListType.Equals(NS_LITERAL_STRING("ol"),nsCaseInsensitiveStringComparator()))
     ruleInfo.bOrdered = PR_TRUE;
   else  ruleInfo.bOrdered = PR_FALSE;
   res = mRules->WillDoAction(selection, &ruleInfo, &cancel, &handled);
@@ -2582,7 +2582,7 @@ nsHTMLEditor::Indent(const nsAReadableString& aIndent)
   PRBool cancel, handled;
   PRInt32 theAction = nsTextEditRules::kIndent;
   PRInt32 opID = kOpIndent;
-  if (!Compare(aIndent,NS_LITERAL_STRING("outdent"),nsCaseInsensitiveStringComparator()))
+  if (aIndent.Equals(NS_LITERAL_STRING("outdent"),nsCaseInsensitiveStringComparator()))
   {
     theAction = nsTextEditRules::kOutdent;
     opID = kOpOutdent;
@@ -3569,7 +3569,8 @@ nsHTMLEditor::GetEmbeddedObjects(nsISupportsArray** aNodeList)
           {
             nsAutoString href;
             if (NS_SUCCEEDED(anchor->GetHref(href)))
-              if (Compare(Substring(href, 0, 5), NS_LITERAL_STRING("file:"), nsCaseInsensitiveStringComparator()) == 0)
+              if (Substring(href, 0, 5).Equals(NS_LITERAL_STRING("file:"),
+                                               nsCaseInsensitiveStringComparator()))
                 (*aNodeList)->AppendElement(node);
           }
         }
@@ -3861,20 +3862,20 @@ PRBool
 nsHTMLEditor::TagCanContainTag(const nsAReadableString& aParentTag, const nsAReadableString& aChildTag)  
 {
   // COtherDTD gives some unwanted results.  We override them here.
-  if (!Compare(aParentTag,NS_LITERAL_STRING("ol"),nsCaseInsensitiveStringComparator()) ||
-    !Compare(aParentTag,NS_LITERAL_STRING("ul"),nsCaseInsensitiveStringComparator()))
+  if (aParentTag.Equals(NS_LITERAL_STRING("ol"),nsCaseInsensitiveStringComparator()) ||
+      aParentTag.Equals(NS_LITERAL_STRING("ul"),nsCaseInsensitiveStringComparator()))
   {
     // if parent is a list and tag is also a list, say "yes".
     // This is because the editor does sublists illegally for now. 
-      if (!Compare(aChildTag,NS_LITERAL_STRING("ol"),nsCaseInsensitiveStringComparator()) ||
-        !Compare(aChildTag,NS_LITERAL_STRING("ul"),nsCaseInsensitiveStringComparator()))
+      if (aChildTag.Equals(NS_LITERAL_STRING("ol"),nsCaseInsensitiveStringComparator()) ||
+          aChildTag.Equals(NS_LITERAL_STRING("ul"),nsCaseInsensitiveStringComparator()))
       return PR_TRUE;
   }
 
-  if (!Compare(aParentTag,NS_LITERAL_STRING("li"),nsCaseInsensitiveStringComparator()))
+  if (aParentTag.Equals(NS_LITERAL_STRING("li"),nsCaseInsensitiveStringComparator()))
   {
     // list items cant contain list items
-    if (!Compare(aChildTag,NS_LITERAL_STRING("li"),nsCaseInsensitiveStringComparator()))
+    if (aChildTag.Equals(NS_LITERAL_STRING("li"),nsCaseInsensitiveStringComparator()))
       return PR_FALSE;
   }
 
diff --git a/editor/libeditor/html/nsHTMLEditorStyle.cpp b/editor/libeditor/html/nsHTMLEditorStyle.cpp
index 82d5a4d7200..0ea49f6d656 100644
--- a/editor/libeditor/html/nsHTMLEditorStyle.cpp
+++ b/editor/libeditor/html/nsHTMLEditorStyle.cpp
@@ -715,7 +715,7 @@ nsresult nsHTMLEditor::RemoveStyleInside(nsIDOMNode *aNode,
   }  
   if ( aProperty == nsIEditProperty::font &&    // or node is big or small and we are setting font size
        (NodeIsType(aNode, nsIEditProperty::big) || NodeIsType(aNode, nsIEditProperty::small)) &&
-       !Compare(*aAttribute,NS_LITERAL_STRING("size"),nsCaseInsensitiveStringComparator()))       
+       aAttribute->Equals(NS_LITERAL_STRING("size"),nsCaseInsensitiveStringComparator()))       
   {
     res = RemoveContainer(aNode);  // if we are setting font size, remove any nested bigs and smalls
   }
@@ -741,10 +741,10 @@ PRBool nsHTMLEditor::IsOnlyAttribute(nsIDOMNode *aNode,
     if (!attrName) continue;  // ooops
     attrName->ToString(attrString);
     // if it's the attribute we know about, keep looking
-    if (!Compare(attrString,*aAttribute,nsCaseInsensitiveStringComparator())) continue;
+    if (attrString.Equals(*aAttribute,nsCaseInsensitiveStringComparator())) continue;
     // if it's a special _moz... attribute, keep looking
     attrString.Left(tmp,4);
-    if (!Compare(tmp,NS_LITERAL_STRING("_moz"),nsCaseInsensitiveStringComparator())) continue;
+    if (tmp.Equals(NS_LITERAL_STRING("_moz"),nsCaseInsensitiveStringComparator())) continue;
     // otherwise, it's another attribute, so return false
     return PR_FALSE;
   }
@@ -798,7 +798,7 @@ PRBool nsHTMLEditor::HasAttrVal(nsIDOMNode *aNode,
   attNode->GetValue(attrVal);
   
   // do values match?
-  if (!Compare(attrVal,*aValue,nsCaseInsensitiveStringComparator())) return PR_TRUE;
+  if (attrVal.Equals(*aValue,nsCaseInsensitiveStringComparator())) return PR_TRUE;
   return PR_FALSE;
 }
 
diff --git a/editor/libeditor/text/nsAOLCiter.cpp b/editor/libeditor/text/nsAOLCiter.cpp
index a00a98f26c9..259a50dcbe0 100644
--- a/editor/libeditor/text/nsAOLCiter.cpp
+++ b/editor/libeditor/text/nsAOLCiter.cpp
@@ -107,7 +107,7 @@ nsAOLCiter::StripCites(const nsAReadableString& aInString, nsAWritableString& aO
   nsReadingIterator  iter,enditer;
   aInString.BeginReading(iter);
   aInString.EndReading(enditer);
-  if (!Compare(Substring(aInString,0,2),NS_LITERAL_STRING(">>")))
+  if (Substring(aInString,0,2).Equals(NS_LITERAL_STRING(">>")))
   {
     iter.advance(2);
     while (nsCRT::IsAsciiSpace(*iter))
diff --git a/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp b/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp
index 13b1a48d4af..2cafc426f7e 100644
--- a/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp
+++ b/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp
@@ -1467,27 +1467,27 @@ ChromeContextMenuListener :: ContextMenu ( nsIDOMEvent* aMouseEvent )
       element->GetTagName(tag);
 
       // Test what kind of element we're dealing with here
-      if (!Compare(tag, NS_LITERAL_STRING("img"), nsCaseInsensitiveStringComparator()))
+      if (tag.Equals(NS_LITERAL_STRING("img"), nsCaseInsensitiveStringComparator()))
       {
         flags |= nsIContextMenuListener::CONTEXT_IMAGE;
         targetDOMnode = node;
         // if we see an image, keep searching for a possible anchor
       }
-      else if (!Compare(tag, NS_LITERAL_STRING("input"), nsCaseInsensitiveStringComparator()))
+      else if (tag.Equals(NS_LITERAL_STRING("input"), nsCaseInsensitiveStringComparator()))
       {
         // INPUT element - button, combo, checkbox, text etc.
         flags |= nsIContextMenuListener::CONTEXT_INPUT;
         targetDOMnode = node;
         break; // exit do-while
       }
-      else if (!Compare(tag, NS_LITERAL_STRING("textarea"), nsCaseInsensitiveStringComparator()))
+      else if (tag.Equals(NS_LITERAL_STRING("textarea"), nsCaseInsensitiveStringComparator()))
       {
         // text area
         flags |= nsIContextMenuListener::CONTEXT_TEXT;
         targetDOMnode = node;
         break; // exit do-while
       }
-      else if (!Compare(tag, NS_LITERAL_STRING("html"), nsCaseInsensitiveStringComparator()))
+      else if (tag.Equals(NS_LITERAL_STRING("html"), nsCaseInsensitiveStringComparator()))
       {
         // only care about this if no other context was found.
         if (!flags) {
@@ -1509,8 +1509,7 @@ ChromeContextMenuListener :: ContextMenu ( nsIDOMEvent* aMouseEvent )
       if (attributes)
       {
         nsCOMPtr hrefNode;
-        nsAutoString href(NS_LITERAL_STRING("href"));
-        attributes->GetNamedItem(href, getter_AddRefs(hrefNode));
+        attributes->GetNamedItem(NS_LITERAL_STRING("href"), getter_AddRefs(hrefNode));
         if (hrefNode)
         {
           flags |= nsIContextMenuListener::CONTEXT_LINK;
diff --git a/embedding/tests/mfcembed/PrintSetupDialog.cpp b/embedding/tests/mfcembed/PrintSetupDialog.cpp
index 4deb399124c..93d0b513ddd 100644
--- a/embedding/tests/mfcembed/PrintSetupDialog.cpp
+++ b/embedding/tests/mfcembed/PrintSetupDialog.cpp
@@ -183,7 +183,7 @@ int CPrintSetupDialog::GetPaperSizeIndexFromData(short aUnit, double aW, double
 int CPrintSetupDialog::GetPaperSizeIndex(const CString& aStr) 
 {
   for (int i=0;iGetType(type);
                         if (NS_SUCCEEDED(rv)) {
-                          if (Compare(type, NS_LITERAL_STRING("password"), nsCaseInsensitiveStringComparator()) == 0) {
+                          if (type.Equals(NS_LITERAL_STRING("password"), nsCaseInsensitiveStringComparator())) {
                             passwordCount++;
                           }
                         }
@@ -449,8 +449,11 @@ nsWalletlibService::OnStateChange(nsIWebProgress* aWebProgress,
                         nsAutoString type;
                         rv = inputElement->GetType(type);
                         if (NS_SUCCEEDED(rv)) {
-                          if ((type.IsEmpty()) || (Compare(type, NS_LITERAL_STRING("text"), nsCaseInsensitiveStringComparator()) == 0) ||
-                            (Compare(type, NS_LITERAL_STRING("password"), nsCaseInsensitiveStringComparator()) == 0)) {
+                          if (type.IsEmpty() ||
+                              type.Equals(NS_LITERAL_STRING("text"),
+                                          nsCaseInsensitiveStringComparator()) ||
+                              type.Equals(NS_LITERAL_STRING("password"),
+                                          nsCaseInsensitiveStringComparator())) {
                             nsAutoString field;
                             rv = inputElement->GetName(field);
                             if (NS_SUCCEEDED(rv)) {
diff --git a/extensions/wallet/src/wallet.cpp b/extensions/wallet/src/wallet.cpp
index 7a65cc99159..798504bc794 100644
--- a/extensions/wallet/src/wallet.cpp
+++ b/extensions/wallet/src/wallet.cpp
@@ -1960,14 +1960,16 @@ wallet_StepForwardOrBack
       if (goForward) {
         if (NS_SUCCEEDED(result) &&
             (type.IsEmpty() ||
-             (Compare(type, NS_LITERAL_STRING("text"), 
-                      nsCaseInsensitiveStringComparator()) == 0))) {
+             type.Equals(NS_LITERAL_STRING("text"), 
+                         nsCaseInsensitiveStringComparator()))) {
           /* at  element and it's type is either "text" or is missing ("text" by default) */
           atInputOrSelect = PR_TRUE;
           return;
         }
       } else {
-        if (NS_SUCCEEDED(result) && (Compare(type, NS_LITERAL_STRING("hidden"), nsCaseInsensitiveStringComparator()) != 0)) {
+        if (NS_SUCCEEDED(result) &&
+            !type.Equals(NS_LITERAL_STRING("hidden"),
+                         nsCaseInsensitiveStringComparator())) {
           /* at  element and it's type is not "hidden" */
           atInputOrSelect = PR_TRUE;
           return;
@@ -2402,7 +2404,10 @@ wallet_GetPrefills(
   if ((NS_SUCCEEDED(result)) && (nsnull != inputElement)) {
     nsAutoString type;
     result = inputElement->GetType(type);
-    if ((NS_SUCCEEDED(result)) && ((type.IsEmpty()) || (Compare(type, NS_LITERAL_STRING("text"), nsCaseInsensitiveStringComparator()) == 0))) {
+    if (NS_SUCCEEDED(result) &&
+        (type.IsEmpty() ||
+         type.Equals(NS_LITERAL_STRING("text"),
+                     nsCaseInsensitiveStringComparator()))) {
       nsAutoString field;
       result = inputElement->GetName(field);
       if (NS_SUCCEEDED(result)) {
@@ -3636,8 +3641,10 @@ wallet_CaptureInputElement(nsIDOMNode* elementNode, nsIDocument* doc) {
     /* it's an input element */
     nsAutoString type;
     result = inputElement->GetType(type);
-    if ((NS_SUCCEEDED(result)) &&
-        (type.IsEmpty() || (Compare(type, NS_LITERAL_STRING("text"), nsCaseInsensitiveStringComparator()) == 0))) {
+    if (NS_SUCCEEDED(result) &&
+        (type.IsEmpty() ||
+         type.Equals(NS_LITERAL_STRING("text"),
+                     nsCaseInsensitiveStringComparator()))) {
       nsAutoString field;
       result = inputElement->GetName(field);
       if (NS_SUCCEEDED(result)) {
@@ -3992,8 +3999,8 @@ WLLT_OnSubmit(nsIContent* currentForm, nsIDOMWindowInternal* window) {
                 rv = inputElement->GetType(type);
                 if (NS_SUCCEEDED(rv)) {
 
-                  PRBool isText = (type.IsEmpty() || (Compare(type, NS_LITERAL_STRING("text"), nsCaseInsensitiveStringComparator())==0));
-                  PRBool isPassword = (Compare(type, NS_LITERAL_STRING("password"), nsCaseInsensitiveStringComparator())==0);
+                  PRBool isText = (type.IsEmpty() || type.Equals(NS_LITERAL_STRING("text"), nsCaseInsensitiveStringComparator()));
+                  PRBool isPassword = type.Equals(NS_LITERAL_STRING("password"), nsCaseInsensitiveStringComparator());
 
                   // don't save password if field was left blank
                   if (isPassword) {
diff --git a/htmlparser/src/CNavDTD.cpp b/htmlparser/src/CNavDTD.cpp
index 3c5474218f0..e424a0e72bc 100644
--- a/htmlparser/src/CNavDTD.cpp
+++ b/htmlparser/src/CNavDTD.cpp
@@ -1013,12 +1013,12 @@ nsresult CNavDTD::DidHandleStartTag(nsIParserNode& aNode,eHTMLTags aChildTag){
         if(theCount) {
           PRInt32 theIndex=0;
           for(theIndex=0;theIndexGetStringValue());
-        if(Compare(theStr, NS_LITERAL_STRING("XI"), nsCaseInsensitiveStringComparator()) != 0) {
+        if(!theStr.Equals(NS_LITERAL_STRING("XI"), nsCaseInsensitiveStringComparator())) {
           PRUnichar theChar=theStr.CharAt(0);
           if((nsCRT::IsAsciiDigit(theChar)) || ('X'==theChar) || ('x'==theChar)){
             theStr.Assign(NS_LITERAL_STRING("#") + theStr);
diff --git a/intl/chardet/src/nsMetaCharsetObserver.cpp b/intl/chardet/src/nsMetaCharsetObserver.cpp
index 74073789e6a..cb2e5cbf006 100644
--- a/intl/chardet/src/nsMetaCharsetObserver.cpp
+++ b/intl/chardet/src/nsMetaCharsetObserver.cpp
@@ -106,7 +106,8 @@ NS_IMETHODIMP nsMetaCharsetObserver::Notify(
                      const PRUnichar* valueArray[])
 {
   
-    if(0 != Compare(nsDependentString(aTag), NS_LITERAL_STRING("META"), nsCaseInsensitiveStringComparator())) 
+    if(!nsDependentString(aTag).Equals(NS_LITERAL_STRING("META"),
+                                       nsCaseInsensitiveStringComparator())) 
         return NS_ERROR_ILLEGAL_VALUE;
     else
         return Notify(aDocumentID, numOfAttributes, nameArray, valueArray);
@@ -147,8 +148,8 @@ NS_IMETHODIMP nsMetaCharsetObserver::Notify(
                      const PRUnichar* aTag, 
                      const nsStringArray* keys, const nsStringArray* values)
 {
-    if(0 != Compare(nsDependentString(aTag), NS_LITERAL_STRING("META"),
-                    nsCaseInsensitiveStringComparator())) 
+    if(!nsDependentString(aTag).Equals(NS_LITERAL_STRING("META"),
+                                       nsCaseInsensitiveStringComparator())) 
         return NS_ERROR_ILLEGAL_VALUE;
     else
         return Notify(aWebShell, aChannel, keys, values);
@@ -215,17 +216,14 @@ NS_IMETHODIMP nsMetaCharsetObserver::Notify(
         while(IS_SPACE_CHARS(*keyStr)) 
           keyStr++;
 
-        if(0 == Compare(Substring(keyStr, keyStr+10),
-                        NS_LITERAL_STRING("HTTP-EQUIV"),
-                        nsCaseInsensitiveStringComparator()))
+        if(Substring(keyStr, keyStr+10).Equals(NS_LITERAL_STRING("HTTP-EQUIV"),
+                                               nsCaseInsensitiveStringComparator()))
               httpEquivValue = values->StringAt(i)->get();
-        else if(0 == Compare(Substring(keyStr, keyStr+7),
-                             NS_LITERAL_STRING("content"),
-                             nsCaseInsensitiveStringComparator()))
+        else if(Substring(keyStr, keyStr+7).Equals(NS_LITERAL_STRING("content"),
+                                                   nsCaseInsensitiveStringComparator()))
               contentValue = values->StringAt(i)->get();
-        else if (0 == Compare(Substring(keyStr, keyStr+7),
-                              NS_LITERAL_STRING("charset"),
-                              nsCaseInsensitiveStringComparator()))
+        else if (Substring(keyStr, keyStr+7).Equals(NS_LITERAL_STRING("charset"),
+                                                    nsCaseInsensitiveStringComparator()))
               charsetValue = values->StringAt(i)->get();
       }
       NS_NAMED_LITERAL_STRING(contenttype, "Content-Type");
@@ -241,26 +239,26 @@ NS_IMETHODIMP nsMetaCharsetObserver::Notify(
 
       if(
           // first try unquoted strings
-         ((0==Compare(Substring(httpEquivValue,httpEquivValue+contenttype.Length()),
-                      contenttype,
-                      nsCaseInsensitiveStringComparator())) ||
+         ((Substring(httpEquivValue,
+                     httpEquivValue+contenttype.Length()).Equals(contenttype,
+                                                                 nsCaseInsensitiveStringComparator())) ||
           // now try "quoted" or 'quoted' strings
           (( (httpEquivValue[0]=='\'') ||
              (httpEquivValue[0]=='\"') ) && 
-           (0==Compare(Substring(httpEquivValue+1, httpEquivValue+1+contenttype.Length()),
-                       contenttype,
-                       nsCaseInsensitiveStringComparator()))
+           (Substring(httpEquivValue+1,
+                      httpEquivValue+1+contenttype.Length()).Equals(contenttype,
+                                                                    nsCaseInsensitiveStringComparator()))
           )) &&
           // first try unquoted strings
-         ((0==Compare(Substring(contentValue,contentValue+texthtml.Length()),
-                      texthtml,
-                      nsCaseInsensitiveStringComparator())) ||
+         ((Substring(contentValue,
+                     contentValue+texthtml.Length()).Equals(texthtml,
+                                                            nsCaseInsensitiveStringComparator())) ||
           // now try "quoted" or 'quoted' strings
           (((contentValue[0]=='\'') ||
             (contentValue[0]=='\"'))&&
-           (0==Compare(Substring(contentValue+1, contentValue+1+texthtml.Length()),
-                       texthtml,
-                       nsCaseInsensitiveStringComparator()))
+           (Substring(contentValue+1,
+                      contentValue+1+texthtml.Length()).Equals(texthtml,
+                                                               nsCaseInsensitiveStringComparator()))
           ))
         )
       {
@@ -352,8 +350,8 @@ NS_IMETHODIMP nsMetaCharsetObserver::GetCharsetFromCompatibilityTag(
     // e.g. 
     PRInt32 numOfAttributes = keys->Count();
     if ((numOfAttributes >= 3) &&
-        (0 == Compare(*keys->StringAt(0), NS_LITERAL_STRING("charset"),
-                      nsCaseInsensitiveStringComparator())))
+        (keys->StringAt(0)->Equals(NS_LITERAL_STRING("charset"),
+                                   nsCaseInsensitiveStringComparator())))
     {
       nsAutoString srcStr((values->StringAt(numOfAttributes-2))->get());
       PRInt32 err;
diff --git a/intl/chardet/src/nsXMLEncodingObserver.cpp b/intl/chardet/src/nsXMLEncodingObserver.cpp
index fa12c04a90c..aa437feccc1 100644
--- a/intl/chardet/src/nsXMLEncodingObserver.cpp
+++ b/intl/chardet/src/nsXMLEncodingObserver.cpp
@@ -94,8 +94,8 @@ NS_IMETHODIMP nsXMLEncodingObserver::Notify(
                      const PRUnichar* nameArray[], 
                      const PRUnichar* valueArray[])
 {
-    if(0 != Compare(nsDependentString(aTag), NS_LITERAL_STRING("?XML"),
-                    nsCaseInsensitiveStringComparator())) 
+    if(!nsDependentString(aTag).Equals(NS_LITERAL_STRING("?XML"),
+                                       nsCaseInsensitiveStringComparator())) 
         return NS_ERROR_ILLEGAL_VALUE;
     else
         return Notify(aDocumentID, numOfAttributes, nameArray, valueArray);
@@ -143,8 +143,8 @@ NS_IMETHODIMP nsXMLEncodingObserver::Notify(
          } else if(0==nsCRT::strcmp(nameArray[i], NS_LITERAL_STRING("charsetSource").get())) {
            bGotCurrentCharsetSource = PR_TRUE;
            charsetSourceStr = valueArray[i];
-         } else if(0==Compare(nsDependentString(nameArray[i]), NS_LITERAL_STRING("encoding"),
-                              nsCaseInsensitiveStringComparator())) { 
+         } else if(nsDependentString(nameArray[i]).Equals(NS_LITERAL_STRING("encoding"),
+                                                          nsCaseInsensitiveStringComparator())) { 
            bGotEncoding = PR_TRUE;
            encoding = valueArray[i];
          }
diff --git a/intl/locale/src/unix/nsCollationUnix.cpp b/intl/locale/src/unix/nsCollationUnix.cpp
index a73e33c6a6a..392e0420ca4 100644
--- a/intl/locale/src/unix/nsCollationUnix.cpp
+++ b/intl/locale/src/unix/nsCollationUnix.cpp
@@ -96,7 +96,9 @@ nsresult nsCollationUnix::Initialize(nsILocale* locale)
     PRUnichar *prefValue;
     res = prefs->GetLocalizedUnicharPref("intl.collationOption", &prefValue);
     if (NS_SUCCEEDED(res)) {
-      mUseCodePointOrder = (Compare(nsDependentString(prefValue), NS_LITERAL_STRING("useCodePointOrder"), nsCaseInsensitiveStringComparator())==0);
+      mUseCodePointOrder =
+        nsDependentString(prefValue).Equals(NS_LITERAL_STRING("useCodePointOrder"),
+                                            nsCaseInsensitiveStringComparator());
       nsMemory::Free(prefValue);
     }
   }
diff --git a/intl/uconv/src/nsCharsetAliasImp.cpp b/intl/uconv/src/nsCharsetAliasImp.cpp
index a2a479348b6..813c572f8ab 100644
--- a/intl/uconv/src/nsCharsetAliasImp.cpp
+++ b/intl/uconv/src/nsCharsetAliasImp.cpp
@@ -127,7 +127,7 @@ NS_IMETHODIMP nsCharsetAlias2::Equals(const nsAReadableString& aCharset1, const
 {
    nsresult res = NS_OK;
 
-   if(Compare(aCharset1, aCharset2, nsCaseInsensitiveStringComparator()) == 0) {
+   if(aCharset1.Equals(aCharset2, nsCaseInsensitiveStringComparator())) {
       *oResult = PR_TRUE;
       return res;
    }
diff --git a/layout/generic/nsObjectFrame.cpp b/layout/generic/nsObjectFrame.cpp
index 87477451ebd..bccbd6cf1a6 100644
--- a/layout/generic/nsObjectFrame.cpp
+++ b/layout/generic/nsObjectFrame.cpp
@@ -1462,10 +1462,10 @@ nsObjectFrame::IsHidden() const
     // not to hide the  once you'd put the 'hidden' attribute
     // on the tag...
       // these |NS_ConvertASCIItoUCS2|s can't be |NS_LITERAL_STRING|s until |EqualsIgnoreCase| get's fixed
-    if (hidden.Length() &&
-        (Compare(hidden, NS_LITERAL_STRING("false"), nsCaseInsensitiveStringComparator()) != 0) &&
-        (Compare(hidden, NS_LITERAL_STRING("no"), nsCaseInsensitiveStringComparator()) != 0) &&
-        (Compare(hidden, NS_LITERAL_STRING("off"), nsCaseInsensitiveStringComparator()) != 0)) {
+    if (!hidden.IsEmpty() &&
+        !hidden.Equals(NS_LITERAL_STRING("false"), nsCaseInsensitiveStringComparator()) &&
+        !hidden.Equals(NS_LITERAL_STRING("no"), nsCaseInsensitiveStringComparator()) &&
+        !hidden.Equals(NS_LITERAL_STRING("off"), nsCaseInsensitiveStringComparator())) {
       // The  or  is hidden.
       return PR_TRUE;
     }
diff --git a/layout/html/base/src/nsObjectFrame.cpp b/layout/html/base/src/nsObjectFrame.cpp
index 87477451ebd..bccbd6cf1a6 100644
--- a/layout/html/base/src/nsObjectFrame.cpp
+++ b/layout/html/base/src/nsObjectFrame.cpp
@@ -1462,10 +1462,10 @@ nsObjectFrame::IsHidden() const
     // not to hide the  once you'd put the 'hidden' attribute
     // on the tag...
       // these |NS_ConvertASCIItoUCS2|s can't be |NS_LITERAL_STRING|s until |EqualsIgnoreCase| get's fixed
-    if (hidden.Length() &&
-        (Compare(hidden, NS_LITERAL_STRING("false"), nsCaseInsensitiveStringComparator()) != 0) &&
-        (Compare(hidden, NS_LITERAL_STRING("no"), nsCaseInsensitiveStringComparator()) != 0) &&
-        (Compare(hidden, NS_LITERAL_STRING("off"), nsCaseInsensitiveStringComparator()) != 0)) {
+    if (!hidden.IsEmpty() &&
+        !hidden.Equals(NS_LITERAL_STRING("false"), nsCaseInsensitiveStringComparator()) &&
+        !hidden.Equals(NS_LITERAL_STRING("no"), nsCaseInsensitiveStringComparator()) &&
+        !hidden.Equals(NS_LITERAL_STRING("off"), nsCaseInsensitiveStringComparator())) {
       // The  or  is hidden.
       return PR_TRUE;
     }
diff --git a/layout/style/nsCSSDeclaration.cpp b/layout/style/nsCSSDeclaration.cpp
index a04f0fd9a59..20675c406d1 100644
--- a/layout/style/nsCSSDeclaration.cpp
+++ b/layout/style/nsCSSDeclaration.cpp
@@ -5521,7 +5521,7 @@ nsCSSDeclaration::TryBackgroundPosition(nsAWritableString & aString,
     AppendValueToString(eCSSProperty_background_x_position, backgroundXValue);
     AppendValueToString(eCSSProperty_background_y_position, backgroundYValue);
     aString.Append(backgroundYValue);
-    if (Compare(backgroundXValue, backgroundYValue, nsCaseInsensitiveStringComparator())) {
+    if (!backgroundXValue.Equals(backgroundYValue, nsCaseInsensitiveStringComparator())) {
       // the two values are different
       aString.Append(PRUnichar(' '));
       aString.Append(backgroundXValue);
diff --git a/layout/style/nsCSSLoader.cpp b/layout/style/nsCSSLoader.cpp
index 6a6b7dc2d6d..d3d482f1aca 100644
--- a/layout/style/nsCSSLoader.cpp
+++ b/layout/style/nsCSSLoader.cpp
@@ -638,9 +638,8 @@ SheetLoadData::OnStreamComplete(nsIStreamLoader* aLoader,
       }
     }
     if (mLoader->mNavQuirkMode ||
-        Compare(contentType,
-                NS_LITERAL_CSTRING("text/css"),
-                nsCaseInsensitiveCStringComparator()) == 0 ||
+        contentType.Equals(NS_LITERAL_CSTRING("text/css"),
+                           nsCaseInsensitiveCStringComparator()) ||
         contentType.IsEmpty()) {
       /*
        * First determine the charset (if one is indicated)
diff --git a/layout/style/nsCSSStruct.cpp b/layout/style/nsCSSStruct.cpp
index a04f0fd9a59..20675c406d1 100644
--- a/layout/style/nsCSSStruct.cpp
+++ b/layout/style/nsCSSStruct.cpp
@@ -5521,7 +5521,7 @@ nsCSSDeclaration::TryBackgroundPosition(nsAWritableString & aString,
     AppendValueToString(eCSSProperty_background_x_position, backgroundXValue);
     AppendValueToString(eCSSProperty_background_y_position, backgroundYValue);
     aString.Append(backgroundYValue);
-    if (Compare(backgroundXValue, backgroundYValue, nsCaseInsensitiveStringComparator())) {
+    if (!backgroundXValue.Equals(backgroundYValue, nsCaseInsensitiveStringComparator())) {
       // the two values are different
       aString.Append(PRUnichar(' '));
       aString.Append(backgroundXValue);
diff --git a/layout/style/nsCSSStyleSheet.cpp b/layout/style/nsCSSStyleSheet.cpp
index 3cce72167e6..952aad603de 100644
--- a/layout/style/nsCSSStyleSheet.cpp
+++ b/layout/style/nsCSSStyleSheet.cpp
@@ -201,9 +201,8 @@ PRBool AtomKey_base::Equals(const nsHashKey* aKey) const
   const PRUnichar *theirStr = nsnull;
   theirAtom->GetUnicode(&theirStr);
 
-  return Compare(nsDependentString(myStr),
-                 nsDependentString(theirStr),
-                 nsCaseInsensitiveStringComparator()) == 0;
+  return nsDependentString(myStr).Equals(nsDependentString(theirStr),
+                                         nsCaseInsensitiveStringComparator());
 }
 
 
@@ -3352,9 +3351,8 @@ static PRBool ValueIncludes(const nsString& aValueList, const nsString& aValue,
         }
       }
       else {
-        if (!Compare(nsDependentString(value),
-                     nsDependentString(start),
-                     nsCaseInsensitiveStringComparator())) {
+        if (nsDependentString(value).Equals(nsDependentString(start),
+                                            nsCaseInsensitiveStringComparator())) {
           return PR_TRUE;
         }
       }
@@ -3648,9 +3646,9 @@ static PRBool SelectorMatches(RuleProcessorData &data,
                     break;
                   }
                   if (isCaseSensitive)
-                    result = PRBool(localTrue == !Compare(Substring(value, 0, selLen), attr->mValue, nsDefaultStringComparator()));
+                    result = PRBool(localTrue == Substring(value, 0, selLen).Equals(attr->mValue, nsDefaultStringComparator()));
                   else
-                    result = PRBool(localTrue == !Compare(Substring(value, 0, selLen), attr->mValue, nsCaseInsensitiveStringComparator()));
+                    result = PRBool(localTrue == Substring(value, 0, selLen).Equals(attr->mValue, nsCaseInsensitiveStringComparator()));
                 }
               }
               break;
@@ -3662,9 +3660,9 @@ static PRBool SelectorMatches(RuleProcessorData &data,
                   result = localFalse;
                 } else {
                   if (isCaseSensitive)
-                    result = PRBool(localTrue == !Compare(Substring(value, valLen - selLen, selLen), attr->mValue, nsDefaultStringComparator()));
+                    result = PRBool(localTrue == Substring(value, valLen - selLen, selLen).Equals(attr->mValue, nsDefaultStringComparator()));
                   else
-                    result = PRBool(localTrue == !Compare(Substring(value, valLen - selLen, selLen), attr->mValue, nsCaseInsensitiveStringComparator()));
+                    result = PRBool(localTrue == Substring(value, valLen - selLen, selLen).Equals(attr->mValue, nsCaseInsensitiveStringComparator()));
                 }
               }
               break;
@@ -3676,9 +3674,9 @@ static PRBool SelectorMatches(RuleProcessorData &data,
                   result = localFalse;
                 } else {
                   if (isCaseSensitive)
-                    result = PRBool(localTrue == !Compare(Substring(value, 0, selLen), attr->mValue, nsDefaultStringComparator()));
+                    result = PRBool(localTrue == Substring(value, 0, selLen).Equals(attr->mValue, nsDefaultStringComparator()));
                   else
-                    result = PRBool(localTrue == !Compare(Substring(value, 0, selLen), attr->mValue, nsCaseInsensitiveStringComparator()));
+                    result = PRBool(localTrue == Substring(value, 0, selLen).Equals(attr->mValue, nsCaseInsensitiveStringComparator()));
                 }
               }
               break;
@@ -3718,8 +3716,8 @@ static PRBool SelectorMatches(RuleProcessorData &data,
             const PRUnichar* id2Str;
             IDList->mAtom->GetUnicode(&id2Str);
             nsDependentString id2(id2Str);
-            if (localTrue ==
-                (Compare(id1, id2, nsCaseInsensitiveStringComparator()) != 0)) {
+            if (localTrue !=
+                id1.Equals(id2, nsCaseInsensitiveStringComparator())) {
               result = PR_FALSE;
               break;
             }
diff --git a/layout/xul/base/src/nsMenuBarFrame.cpp b/layout/xul/base/src/nsMenuBarFrame.cpp
index 326b60be9c9..accd412a0a7 100644
--- a/layout/xul/base/src/nsMenuBarFrame.cpp
+++ b/layout/xul/base/src/nsMenuBarFrame.cpp
@@ -266,7 +266,8 @@ nsMenuBarFrame::FindMenuWithShortcut(PRUint32 aLetter)
       if (!shortcutKey.IsEmpty()) {
         // We've got something.
         PRUnichar letter = PRUnichar(aLetter); // throw away the high-zero-fill
-        if ( Compare(shortcutKey, Substring(&letter, &letter+1), nsCaseInsensitiveStringComparator())==0 )  {
+        if ( shortcutKey.Equals(Substring(&letter, &letter+1),
+                                nsCaseInsensitiveStringComparator()) )  {
           // We match!
           nsCOMPtr menuFrame = do_QueryInterface(currFrame);
           if (menuFrame)
diff --git a/mailnews/absync/src/nsAbSync.cpp b/mailnews/absync/src/nsAbSync.cpp
index 842d76840a2..46f5a62e8a8 100644
--- a/mailnews/absync/src/nsAbSync.cpp
+++ b/mailnews/absync/src/nsAbSync.cpp
@@ -2816,15 +2816,20 @@ nsAbSync::GetTypeOfPhoneNumber(nsString tagName)
         continue;
       
       phoneType.Cut(0, loc+1);
-      if (!Compare(phoneType, NS_LITERAL_STRING(ABSYNC_HOME_PHONE_TYPE), nsCaseInsensitiveStringComparator()))
+      if (phoneType.Equals(NS_LITERAL_STRING(ABSYNC_HOME_PHONE_TYPE),
+                           nsCaseInsensitiveStringComparator()))
         return ABSYNC_HOME_PHONE_ID;
-      else if (!Compare(phoneType, NS_LITERAL_STRING(ABSYNC_WORK_PHONE_TYPE), nsCaseInsensitiveStringComparator()))
+      else if (phoneType.Equals(NS_LITERAL_STRING(ABSYNC_WORK_PHONE_TYPE),
+                                nsCaseInsensitiveStringComparator()))
         return ABSYNC_WORK_PHONE_ID;
-      else if (!Compare(phoneType, NS_LITERAL_STRING(ABSYNC_FAX_PHONE_TYPE), nsCaseInsensitiveStringComparator()))
+      else if (phoneType.Equals(NS_LITERAL_STRING(ABSYNC_FAX_PHONE_TYPE),
+                                nsCaseInsensitiveStringComparator()))
         return ABSYNC_FAX_PHONE_ID;
-      else if (!Compare(phoneType, NS_LITERAL_STRING(ABSYNC_PAGER_PHONE_TYPE), nsCaseInsensitiveStringComparator()))
+      else if (phoneType.Equals(NS_LITERAL_STRING(ABSYNC_PAGER_PHONE_TYPE),
+                                nsCaseInsensitiveStringComparator()))
         return ABSYNC_PAGER_PHONE_ID;
-      else if (!Compare(phoneType, NS_LITERAL_STRING(ABSYNC_CELL_PHONE_TYPE), nsCaseInsensitiveStringComparator()))
+      else if (phoneType.Equals(NS_LITERAL_STRING(ABSYNC_CELL_PHONE_TYPE),
+                                nsCaseInsensitiveStringComparator()))
         return ABSYNC_CELL_PHONE_ID;
     }
   }
@@ -2914,7 +2919,8 @@ nsAbSync::AddValueToNewCard(nsIAbCard *aCard, nsString *aTagName, nsString *aTag
     PR_FREEIF(tValue);
   }
 
-  if (!Compare(Substring(*aTagName, 0, 5), NS_LITERAL_STRING("phone"), nsCaseInsensitiveStringComparator()))
+  if (Substring(*aTagName, 0, 5).Equals(NS_LITERAL_STRING("phone"),
+                                        nsCaseInsensitiveStringComparator()))
   {
     nsString      tempVal;
     tempVal.Append(*aTagName +
diff --git a/mailnews/addrbook/src/nsAbAutoCompleteSession.cpp b/mailnews/addrbook/src/nsAbAutoCompleteSession.cpp
index 14593c67a3c..b8307ff1e60 100644
--- a/mailnews/addrbook/src/nsAbAutoCompleteSession.cpp
+++ b/mailnews/addrbook/src/nsAbAutoCompleteSession.cpp
@@ -100,8 +100,8 @@ PRBool nsAbAutoCompleteSession::ItsADuplicate(PRUnichar* fullAddrStr, nsIAutoCom
                         rv = resultItem->GetValue(valueStr);
                         if (NS_SUCCEEDED(rv) && !valueStr.IsEmpty())
                         {
-                          if (Compare(nsDependentString(fullAddrStr), valueStr,
-                                      nsCaseInsensitiveStringComparator())==0)
+                          if (nsDependentString(fullAddrStr).Equals(valueStr,
+                                                                    nsCaseInsensitiveStringComparator()))
                             return PR_TRUE;
                         }
                     }
@@ -266,9 +266,9 @@ static PRBool CommonPrefix(const PRUnichar *aString, const PRUnichar *aSubstr, P
   if (!aSubstrLen || (nsCRT::strlen(aString) < NS_STATIC_CAST(PRUint32, aSubstrLen)))
     return PR_FALSE;
 
-  return (Compare(Substring(aString, aString+aSubstrLen),
-                  Substring(aSubstr, aSubstr+aSubstrLen),
-                  nsCaseInsensitiveStringComparator()) == 0);
+  return (Substring(aString,
+                    aString+aSubstrLen).Equals(Substring(aSubstr, aSubstr+aSubstrLen),
+                                               nsCaseInsensitiveStringComparator()));
 }
 
 
@@ -295,46 +295,48 @@ nsAbAutoCompleteSession::CheckEntry(nsAbAutoCompleteSearchString* searchStr,
     fullStringLen = searchStr->mFullStringLen;
   }
 
+  nsDependentString fullStringStr(fullString, fullStringLen);
+  
   // First check for a Nickname exact match
-  if (nickName && Compare(nsDependentString(fullString),
-                          nsDependentString(nickName),
-                          nsCaseInsensitiveStringComparator()) == 0)
+  if (nickName &&
+      fullStringStr.Equals(nsDependentString(nickName),
+                           nsCaseInsensitiveStringComparator()))
   {
     *matchType = NICKNAME_EXACT_MATCH;
     return PR_TRUE;
   }
 
   // Then check for a display Name exact match
-  if (displayName && Compare(nsDependentString(fullString),
-                             nsDependentString(displayName),
-                             nsCaseInsensitiveStringComparator()) == 0)
+  if (displayName &&
+      fullStringStr.Equals(nsDependentString(displayName),
+                           nsCaseInsensitiveStringComparator()))
   {
     *matchType = NAME_EXACT_MATCH;
     return PR_TRUE;
   }
 
   // Then check for a fisrt Name exact match
-  if (firstName && Compare(nsDependentString(fullString),
-                           nsDependentString(firstName),
-                           nsCaseInsensitiveStringComparator()) == 0)
+  if (firstName &&
+      fullStringStr.Equals(nsDependentString(firstName),
+                           nsCaseInsensitiveStringComparator()))
   {
     *matchType = NAME_EXACT_MATCH;
     return PR_TRUE;
   }
 
   // Then check for a last Name exact match
-  if (lastName && Compare(nsDependentString(fullString),
-                          nsDependentString(lastName),
-                          nsCaseInsensitiveStringComparator()) == 0)
+  if (lastName &&
+      fullStringStr.Equals(nsDependentString(lastName),
+                           nsCaseInsensitiveStringComparator()))
   {
     *matchType = NAME_EXACT_MATCH;
     return PR_TRUE;
   }
 
   // Then check for a Email exact match
-  if (emailAddress && Compare(nsDependentString(fullString),
-                              nsDependentString(emailAddress),
-                              nsCaseInsensitiveStringComparator()) == 0)
+  if (emailAddress &&
+      fullStringStr.Equals(nsDependentString(emailAddress),
+                           nsCaseInsensitiveStringComparator()))
   {
     *matchType = EMAIL_EXACT_MATCH;
     return PR_TRUE;
diff --git a/mailnews/base/src/nsMsgAccountManager.cpp b/mailnews/base/src/nsMsgAccountManager.cpp
index 4766138c598..5186722d3c7 100644
--- a/mailnews/base/src/nsMsgAccountManager.cpp
+++ b/mailnews/base/src/nsMsgAccountManager.cpp
@@ -1037,7 +1037,9 @@ PRBool PR_CALLBACK nsMsgAccountManager::cleanupOnExit(nsHashKey *aKey, void *aDa
                nsCOMPtrinboxFolder = do_QueryInterface(aSupport);
                nsXPIDLString folderName;
                inboxFolder->GetName(getter_Copies(folderName));
-               if (folderName && Compare(folderName, NS_LITERAL_STRING("INBOX"), nsCaseInsensitiveStringComparator()) ==0)
+               if (folderName &&
+                   folderName.Equals(NS_LITERAL_STRING("INBOX"),
+                                     nsCaseInsensitiveStringComparator()))
                {
                  rv1 = inboxFolder->Compact(urlListener, nsnull /* msgwindow */);
                  if (NS_SUCCEEDED(rv1))
diff --git a/mailnews/base/util/nsMsgFolder.cpp b/mailnews/base/util/nsMsgFolder.cpp
index 92ca077ff0b..21e62678cf5 100644
--- a/mailnews/base/util/nsMsgFolder.cpp
+++ b/mailnews/base/util/nsMsgFolder.cpp
@@ -937,8 +937,9 @@ NS_IMETHODIMP nsMsgFolder::GetChildNamed(const char *name, nsISupports ** aChild
 
 			rv = folder->GetName(getter_Copies(folderName));
 			// case-insensitive compare is probably LCD across OS filesystems
-			if (NS_SUCCEEDED(rv) && Compare(folderName, uniName,
-                                      nsCaseInsensitiveStringComparator()) == 0)
+			if (NS_SUCCEEDED(rv) &&
+          folderName.Equals(uniName,
+                            nsCaseInsensitiveStringComparator()))
 			{
 				*aChild = folder;
 				NS_ADDREF(*aChild);
diff --git a/mailnews/base/util/nsMsgI18N.cpp b/mailnews/base/util/nsMsgI18N.cpp
index 838e037a601..a7ebcc3d617 100644
--- a/mailnews/base/util/nsMsgI18N.cpp
+++ b/mailnews/base/util/nsMsgI18N.cpp
@@ -438,7 +438,8 @@ PRBool nsMsgI18Nmultibyte_charset(const char *charset)
     if (NS_SUCCEEDED(res)) {
       res = ccm2->GetCharsetData2(charsetAtom, NS_LITERAL_STRING(".isMultibyte").get(), &charsetData);
       if (NS_SUCCEEDED(res)) {
-        result = !Compare(charsetData, NS_LITERAL_STRING("true"), nsCaseInsensitiveStringComparator());
+        result = charsetData.Equals(NS_LITERAL_STRING("true"),
+                                    nsCaseInsensitiveStringComparator());
       }
     }
   }
diff --git a/mailnews/compose/src/nsMsgCompose.cpp b/mailnews/compose/src/nsMsgCompose.cpp
index 941b81385cc..1ed75ca34e6 100644
--- a/mailnews/compose/src/nsMsgCompose.cpp
+++ b/mailnews/compose/src/nsMsgCompose.cpp
@@ -2328,9 +2328,8 @@ nsresult nsMsgComposeSendListener::OnStopSending(const char *aMsgID, nsresult aS
       {
         if (!fieldsFCC.IsEmpty())
         {
-          if (Compare(nsDependentString(fieldsFCC),
-                      NS_LITERAL_STRING("nocopy://"),
-                      nsCaseInsensitiveStringComparator()) == 0)
+          if (fieldsFCC.Equals(NS_LITERAL_STRING("nocopy://"),
+                               nsCaseInsensitiveStringComparator()))
           {
             compose->NotifyStateListeners(eComposeProcessDone, NS_OK);
             if (progress)
@@ -3805,7 +3804,8 @@ nsresult nsMsgCompose::TagConvertible(nsIDOMNode *node,  PRInt32 *_retval)
           if (NS_SUCCEEDED(pItem->GetNodeValue(typeValue)))
           {
             typeValue.StripChars("\"");
-            if (!Compare(typeValue, NS_LITERAL_STRING("cite"), nsCaseInsensitiveStringComparator()))
+            if (typeValue.Equals(NS_LITERAL_STRING("cite"),
+                                 nsCaseInsensitiveStringComparator()))
               *_retval = nsIMsgCompConvertible::Plain;
           }
         }
diff --git a/mailnews/compose/src/nsMsgSend.cpp b/mailnews/compose/src/nsMsgSend.cpp
index a9ff3948ac1..e79760a1f9e 100644
--- a/mailnews/compose/src/nsMsgSend.cpp
+++ b/mailnews/compose/src/nsMsgSend.cpp
@@ -1680,7 +1680,8 @@ nsMsgComposeAndSend::ProcessMultipartRelated(PRInt32 *aMailboxCount, PRInt32 *aN
       nsAutoString attributeValue;
       if (NS_SUCCEEDED(domElement->GetAttribute(NS_LITERAL_STRING("moz-do-not-send"), attributeValue)))
       {
-        if (!Compare(attributeValue, NS_LITERAL_STRING("true"), nsCaseInsensitiveStringComparator()))
+        if (attributeValue.Equals(NS_LITERAL_STRING("true"),
+                                  nsCaseInsensitiveStringComparator()))
           continue;
       }
     }
diff --git a/mailnews/imap/src/nsImapMailFolder.cpp b/mailnews/imap/src/nsImapMailFolder.cpp
index 6a5329749ff..69d17107c0b 100644
--- a/mailnews/imap/src/nsImapMailFolder.cpp
+++ b/mailnews/imap/src/nsImapMailFolder.cpp
@@ -710,12 +710,12 @@ NS_IMETHODIMP nsImapMailFolder::CreateSubfolder(const PRUnichar* folderName, nsI
     nsresult rv = NS_ERROR_NULL_POINTER;
     if (!folderName) return rv;
 
-    if ( Compare(nsDependentString(folderName),NS_LITERAL_STRING("Trash"),nsCaseInsensitiveStringComparator()) == 0 )   // Trash , a special folder
+    if ( nsDependentString(folderName).Equals(NS_LITERAL_STRING("Trash"),nsCaseInsensitiveStringComparator()) )   // Trash , a special folder
     {
         AlertSpecialFolderExists(msgWindow);
         return NS_MSG_FOLDER_EXISTS;
     }
-    else if ( Compare(nsDependentString(folderName),NS_LITERAL_STRING("Inbox"),nsCaseInsensitiveStringComparator()) == 0 )  // Inbox, a special folder
+    else if ( nsDependentString(folderName).Equals(NS_LITERAL_STRING("Inbox"),nsCaseInsensitiveStringComparator()) )  // Inbox, a special folder
     {
         AlertSpecialFolderExists(msgWindow);
         return NS_MSG_FOLDER_EXISTS;
@@ -3882,9 +3882,8 @@ PRBool nsImapMailFolder::ShowDeletedMessages()
         {
           nsXPIDLString folderName;
           GetName(getter_Copies(folderName));
-          if (!Compare(Substring(folderName,0,convertedName.Length()),
-                       convertedName,
-                       nsCaseInsensitiveStringComparator()))
+          if (Substring(folderName,0,convertedName.Length()).Equals(convertedName,
+                                                                    nsCaseInsensitiveStringComparator()))
             showDeleted = PR_TRUE;
         }
       }
diff --git a/mailnews/import/eudora/src/nsEudoraCompose.cpp b/mailnews/import/eudora/src/nsEudoraCompose.cpp
index 85cdc2a9288..ea68be524be 100644
--- a/mailnews/import/eudora/src/nsEudoraCompose.cpp
+++ b/mailnews/import/eudora/src/nsEudoraCompose.cpp
@@ -504,7 +504,7 @@ void nsEudoraCompose::ExtractType( nsString& str)
 	// valid multipart!
 	if (str.Length() > 10) {
 		str.Left( tStr, 10);
-		if (!Compare(tStr, NS_LITERAL_STRING("multipart/"), nsCaseInsensitiveStringComparator()))
+		if (tStr.Equals(NS_LITERAL_STRING("multipart/"), nsCaseInsensitiveStringComparator()))
 			str.Truncate();
 	}
 }
diff --git a/mailnews/import/eudora/src/nsEudoraMac.cpp b/mailnews/import/eudora/src/nsEudoraMac.cpp
index 8d2d7537586..940be7c2060 100644
--- a/mailnews/import/eudora/src/nsEudoraMac.cpp
+++ b/mailnews/import/eudora/src/nsEudoraMac.cpp
@@ -1030,7 +1030,7 @@ PRBool nsEudoraMac::IsValidMailboxName( nsCString& fName)
 {
 	if (m_depth > 1)
 		return( PR_TRUE);
-	if (!Compare(fName, NS_LITERAL_CSTRING("Eudora Nicknames"), nsCaseInsensitiveCStringComparator()))
+	if (fName.Equals(NS_LITERAL_CSTRING("Eudora Nicknames"), nsCaseInsensitiveCStringComparator()))
 		return( PR_FALSE);
 	return( PR_TRUE);
 }
diff --git a/mailnews/import/eudora/src/nsEudoraWin32.cpp b/mailnews/import/eudora/src/nsEudoraWin32.cpp
index 8910eff507e..3784a61a386 100644
--- a/mailnews/import/eudora/src/nsEudoraWin32.cpp
+++ b/mailnews/import/eudora/src/nsEudoraWin32.cpp
@@ -694,7 +694,7 @@ void nsEudoraWin32::GetAccountName( const char *pSection, nsString& str)
 
 	nsCString	s(pSection);
 	
-	if (!Compare(s, NS_LITERAL_CSTRING("Settings"), nsCaseInsensitiveCStringComparator())) {
+	if (s.Equals(NS_LITERAL_CSTRING("Settings"), nsCaseInsensitiveCStringComparator())) {
 		str.Assign(NS_LITERAL_STRING("Eudora "));
 		str.AppendWithConversion( pSection);
 	}
@@ -703,7 +703,7 @@ void nsEudoraWin32::GetAccountName( const char *pSection, nsString& str)
 		str.AssignWithConversion(pSection);
 		if (s.Length() > 8) {
 			s.Left( tStr, 8); 
-			if (!Compare(tStr, NS_LITERAL_CSTRING("Persona-"), nsCaseInsensitiveCStringComparator())) {
+			if (tStr.Equals(NS_LITERAL_CSTRING("Persona-"), nsCaseInsensitiveCStringComparator())) {
 				s.Right( tStr, s.Length() - 8);
 				str.AssignWithConversion(tStr.get());
 			}
@@ -1378,9 +1378,8 @@ nsresult nsEudoraWin32::FoundAddressBook( nsIFileSpec *spec, const PRUnichar *pN
 		nsCRT::free( pLeaf);
 		nsString	tStr;
 		name.Right( tStr, 4);
-		if (! Compare(tStr,
-                      NS_LITERAL_STRING(".txt"),
-                      nsCaseInsensitiveStringComparator())) {
+		if (tStr.Equals(NS_LITERAL_STRING(".txt"),
+                        nsCaseInsensitiveStringComparator())) {
 			name.Left( tStr, name.Length() - 4);
 			name = tStr;
 		}
diff --git a/mailnews/import/oexpress/nsOEScanBoxes.cpp b/mailnews/import/oexpress/nsOEScanBoxes.cpp
index 88f178d0ed7..dc6006cec27 100644
--- a/mailnews/import/oexpress/nsOEScanBoxes.cpp
+++ b/mailnews/import/oexpress/nsOEScanBoxes.cpp
@@ -293,7 +293,7 @@ PRBool nsOEScanBoxes::FindMailBoxes( nsIFileSpec* descFile)
 		#endif
 		
 		pEntry->fileName.Right( ext, 4);
-		if (Compare(ext, mbxExt))
+		if (!ext.Equals(mbxExt))
 			pEntry->fileName.Append( ".mbx");		
 		
 		m_entryArray.AppendElement( pEntry);
diff --git a/mailnews/import/outlook/src/MapiApi.cpp b/mailnews/import/outlook/src/MapiApi.cpp
index 5e3deaeb84f..28e409b93d5 100644
--- a/mailnews/import/outlook/src/MapiApi.cpp
+++ b/mailnews/import/outlook/src/MapiApi.cpp
@@ -306,24 +306,25 @@ CGetStoreFoldersIter::CGetStoreFoldersIter( CMapiApi *pApi, CMapiFolderList& fol
 BOOL CGetStoreFoldersIter::ExcludeFolderClass( const PRUnichar *pName)
 {
 	BOOL bResult;
+    nsDependentString pNameStr(pName);
 	if (m_isMail) {
 		bResult = FALSE;
-        if (!Compare(nsDependentString(pName), NS_LITERAL_STRING("IPF.Appointment")))
+        if (pNameStr.Equals(NS_LITERAL_STRING("IPF.Appointment")))
 			bResult = TRUE;
-		else if (!Compare(nsDependentString(pName), NS_LITERAL_STRING("IPF.Contact")))
+		else if (pNameStr.Equals(NS_LITERAL_STRING("IPF.Contact")))
 			bResult = TRUE;
-		else if (!Compare(nsDependentString(pName), NS_LITERAL_STRING("IPF.Journal")))
+		else if (pNameStr.Equals(NS_LITERAL_STRING("IPF.Journal")))
 			bResult = TRUE;
-        else if (!Compare(nsDependentString(pName), NS_LITERAL_STRING("IPF.StickyNote")))
+        else if (pNameStr.Equals(NS_LITERAL_STRING("IPF.StickyNote")))
 			bResult = TRUE;
-		else if (!Compare(nsDependentString(pName), NS_LITERAL_STRING("IPF.Task")))
+		else if (pNameStr.Equals(NS_LITERAL_STRING("IPF.Task")))
 			bResult = TRUE;
 		// else if (!stricmp( pName, "IPF.Note"))
 		//	bResult = TRUE;
 	}
 	else {
 		bResult = TRUE;
-		if (!Compare( nsDependentString(pName), NS_LITERAL_STRING("IPF.Contact")))
+		if (pNameStr.Equals(NS_LITERAL_STRING("IPF.Contact")))
 			bResult = FALSE;
 	}
 
diff --git a/mailnews/local/src/nsLocalMailFolder.cpp b/mailnews/local/src/nsLocalMailFolder.cpp
index 88af5421bad..38fa9c93cea 100644
--- a/mailnews/local/src/nsLocalMailFolder.cpp
+++ b/mailnews/local/src/nsLocalMailFolder.cpp
@@ -799,8 +799,8 @@ nsMsgLocalMailFolder::CheckIfFolderExists(const PRUnichar *folderName, nsFileSpe
       PR_FREEIF(leaf);
 
       if (!leafName.IsEmpty() &&
-          Compare(nsDependentString(folderName), leafName,
-                  nsCaseInsensitiveStringComparator()) == 0)
+          leafName.Equals(nsDependentString(folderName), 
+                          nsCaseInsensitiveStringComparator()))
       {
            if (msgWindow)
               AlertFolderExists(msgWindow);
diff --git a/modules/libjar/nsJAR.cpp b/modules/libjar/nsJAR.cpp
index 3ce71e8b808..9424a53485a 100644
--- a/modules/libjar/nsJAR.cpp
+++ b/modules/libjar/nsJAR.cpp
@@ -723,7 +723,8 @@ nsJAR::ParseOneFile(nsISignatureVerifier* verifier,
 
     //-- Lines to look for:
     // (1) Digest:
-    if (Compare(lineName, NS_LITERAL_CSTRING("SHA1-Digest"), nsCaseInsensitiveCStringComparator()) == 0) 
+    if (lineName.Equals(NS_LITERAL_CSTRING("SHA1-Digest"),
+                        nsCaseInsensitiveCStringComparator()))
     //-- This is a digest line, save the data in the appropriate place 
     {
       if(aFileType == JAR_MF)
@@ -739,7 +740,8 @@ nsJAR::ParseOneFile(nsISignatureVerifier* verifier,
     }
     
     // (2) Name: associates this manifest section with a file in the jar.
-    if (!foundName && Compare(lineName, NS_LITERAL_CSTRING("Name"), nsCaseInsensitiveCStringComparator()) == 0) 
+    if (!foundName && lineName.Equals(NS_LITERAL_CSTRING("Name"),
+                                      nsCaseInsensitiveCStringComparator())) 
     {
       curItemName = lineData;
       foundName = PR_TRUE;
@@ -749,9 +751,11 @@ nsJAR::ParseOneFile(nsISignatureVerifier* verifier,
     // (3) Magic: this may be an inline Javascript. 
     //     We can't do any other kind of magic.
     if ( aFileType == JAR_MF &&
-         Compare(lineName, NS_LITERAL_CSTRING("Magic"), nsCaseInsensitiveCStringComparator()) == 0) 
+         lineName.Equals(NS_LITERAL_CSTRING("Magic"),
+                         nsCaseInsensitiveCStringComparator()))
     {
-      if(Compare(lineData, NS_LITERAL_CSTRING("javascript"), nsCaseInsensitiveCStringComparator()) == 0)
+      if(lineData.Equals(NS_LITERAL_CSTRING("javascript"),
+                         nsCaseInsensitiveCStringComparator()))
         curItemMF->mType = JAR_EXTERNAL;
       else
         curItemMF->mType = JAR_INVALID;
diff --git a/netwerk/cache/src/nsCacheEntry.cpp b/netwerk/cache/src/nsCacheEntry.cpp
index 3131215e25c..c62a1907e07 100644
--- a/netwerk/cache/src/nsCacheEntry.cpp
+++ b/netwerk/cache/src/nsCacheEntry.cpp
@@ -591,7 +591,7 @@ nsCacheEntryHashTable::MatchEntry(PLDHashTable *       /* table */,
     NS_ASSERTION(key !=  nsnull, "### nsCacheEntryHashTable::MatchEntry : null key");
     nsCacheEntry *cacheEntry = ((nsCacheEntryHashTableEntry *)hashEntry)->cacheEntry;
 
-    return Compare(*cacheEntry->mKey, *(nsCString *)key) == 0;
+    return cacheEntry->mKey->Equals(*(nsCString *)key);
 }
 
 
diff --git a/netwerk/protocol/ftp/src/nsFtpConnectionThread.cpp b/netwerk/protocol/ftp/src/nsFtpConnectionThread.cpp
index 589513ea1a2..569ef3ae160 100644
--- a/netwerk/protocol/ftp/src/nsFtpConnectionThread.cpp
+++ b/netwerk/protocol/ftp/src/nsFtpConnectionThread.cpp
@@ -2125,7 +2125,7 @@ nsFtpState::SendFTPCommand(nsCString& command)
     
     // we don't want to log the password:
     nsCAutoString logcmd(command);
-    if (Compare(Substring(command, 0, 5), NS_LITERAL_CSTRING("PASS ")) == 0) 
+    if (Substring(command, 0, 5).Equals(NS_LITERAL_CSTRING("PASS "))) 
         logcmd = "PASS xxxxx";
     
     PR_LOG(gFTPLog, PR_LOG_DEBUG, ("(%x)(dwait=%d) Writing \"%s\"\n", this, mWaitingForDConn, logcmd.get()));
diff --git a/netwerk/streamconv/converters/mozTXTToHTMLConv.cpp b/netwerk/streamconv/converters/mozTXTToHTMLConv.cpp
index d46abaf4d53..419bf5e9a9a 100644
--- a/netwerk/streamconv/converters/mozTXTToHTMLConv.cpp
+++ b/netwerk/streamconv/converters/mozTXTToHTMLConv.cpp
@@ -542,11 +542,10 @@ mozTXTToHTMLConv::ItMatchesDelimited(const PRUnichar * aInString,
           nsCRT::IsAsciiDigit(textAfterPos) ||
           textAfterPos == *rep
         ) ||
-        Compare(Substring(nsDependentString(aInString, aInLength),
-                          (before == LT_IGNORE ? 0 : 1),
-                          aRepLen),
-                nsDependentString(rep, aRepLen),
-                nsCaseInsensitiveStringComparator())
+        !Substring(nsDependentString(aInString, aInLength),
+                   (before == LT_IGNORE ? 0 : 1),
+                   aRepLen).Equals(nsDependentString(rep, aRepLen),
+                                   nsCaseInsensitiveStringComparator())
     )
     return PR_FALSE;
 
@@ -978,8 +977,9 @@ mozTXTToHTMLConv::CiteLevelTXT(const PRUnichar *line,
       const PRUnichar * indexString = &line[logLineStart];
            // here, |logLineStart < lineLength| is always true
       PRUint32 minlength = MinInt(6,nsCRT::strlen(indexString));
-      if (!Compare(Substring(indexString, indexString+minlength),
-                   Substring(NS_LITERAL_STRING(">From "), 0, minlength), nsCaseInsensitiveStringComparator()))
+      if (Substring(indexString,
+                    indexString+minlength).Equals(Substring(NS_LITERAL_STRING(">From "), 0, minlength),
+                                                  nsCaseInsensitiveStringComparator()))
         //XXX RFC2646
         moreCites = PR_FALSE;
       else
diff --git a/netwerk/streamconv/converters/nsUnknownDecoder.cpp b/netwerk/streamconv/converters/nsUnknownDecoder.cpp
index 276196779c3..ce7778f147a 100644
--- a/netwerk/streamconv/converters/nsUnknownDecoder.cpp
+++ b/netwerk/streamconv/converters/nsUnknownDecoder.cpp
@@ -304,8 +304,10 @@ void nsUnknownDecoder::DetermineContentType(nsIRequest* request)
   //
   // If the buffer begins with a mailbox delimiter then it is not HTML
   //
-  else if (!Compare(Substring(str, 0, 5), NS_LITERAL_CSTRING("From "), nsCaseInsensitiveCStringComparator()) || 
-           !Compare(Substring(str, 0, 6), NS_LITERAL_CSTRING(">From "), nsCaseInsensitiveCStringComparator())) {
+  else if (Substring(str, 0, 5).Equals(NS_LITERAL_CSTRING("From "),
+                                       nsCaseInsensitiveCStringComparator()) ||
+           Substring(str, 0, 6).Equals(NS_LITERAL_CSTRING(">From "),
+                                       nsCaseInsensitiveCStringComparator())) {
     mContentType = TEXT_PLAIN;
   }
   //
diff --git a/parser/htmlparser/src/CNavDTD.cpp b/parser/htmlparser/src/CNavDTD.cpp
index 3c5474218f0..e424a0e72bc 100644
--- a/parser/htmlparser/src/CNavDTD.cpp
+++ b/parser/htmlparser/src/CNavDTD.cpp
@@ -1013,12 +1013,12 @@ nsresult CNavDTD::DidHandleStartTag(nsIParserNode& aNode,eHTMLTags aChildTag){
         if(theCount) {
           PRInt32 theIndex=0;
           for(theIndex=0;theIndexGetStringValue());
-        if(Compare(theStr, NS_LITERAL_STRING("XI"), nsCaseInsensitiveStringComparator()) != 0) {
+        if(!theStr.Equals(NS_LITERAL_STRING("XI"), nsCaseInsensitiveStringComparator())) {
           PRUnichar theChar=theStr.CharAt(0);
           if((nsCRT::IsAsciiDigit(theChar)) || ('X'==theChar) || ('x'==theChar)){
             theStr.Assign(NS_LITERAL_STRING("#") + theStr);
diff --git a/rdf/base/src/rdfutil.cpp b/rdf/base/src/rdfutil.cpp
index 3aa9b5d85aa..07183c75287 100644
--- a/rdf/base/src/rdfutil.cpp
+++ b/rdf/base/src/rdfutil.cpp
@@ -92,8 +92,8 @@ rdf_RequiresAbsoluteURI(const nsString& uri)
     // cheap shot at figuring out if this requires an absolute url translation
     if (Substring(uri, 0, 4).Equals(NS_LITERAL_STRING("urn:")) ||
         Substring(uri, 0, 9).Equals(NS_LITERAL_STRING("chrome:")) ||
-        !Compare(Substring(uri, 0, 3), NS_LITERAL_STRING("nc:"),
-                 nsCaseInsensitiveStringComparator())) {
+        Substring(uri, 0, 3).Equals(NS_LITERAL_STRING("nc:"),
+                                    nsCaseInsensitiveStringComparator())) {
         return PR_FALSE;
      }
      return PR_TRUE;
diff --git a/uriloader/exthandler/nsExternalHelperAppService.cpp b/uriloader/exthandler/nsExternalHelperAppService.cpp
index 5e476ead5de..335c4a0539e 100644
--- a/uriloader/exthandler/nsExternalHelperAppService.cpp
+++ b/uriloader/exthandler/nsExternalHelperAppService.cpp
@@ -1705,9 +1705,8 @@ nsresult nsExternalHelperAppService::GetMIMEInfoForExtensionFromExtras(const cha
       while (start != end)
       {
           FindCharInReadable(',', iter, end);
-          if (Compare(Substring(start, iter),
-                      extension,
-                      nsCaseInsensitiveCStringComparator()) == 0)
+          if (Substring(start, iter).Equals(extension,
+                                            nsCaseInsensitiveCStringComparator()))
           {
               // This is the one.  Create MIMEInfo object and set
               // attributes appropriately.
diff --git a/uriloader/exthandler/unix/nsOSHelperAppService.cpp b/uriloader/exthandler/unix/nsOSHelperAppService.cpp
index d7a2bb58c4d..98132515732 100644
--- a/uriloader/exthandler/unix/nsOSHelperAppService.cpp
+++ b/uriloader/exthandler/unix/nsOSHelperAppService.cpp
@@ -442,9 +442,8 @@ GetTypeAndDescriptionFromMimetypesFile(const nsAString& aFilename,
 
           while (start != end) {
             FindCharInReadable(',', iter, end);
-            if (Compare(Substring(start, iter),
-                        aFileExtension,
-                        nsCaseInsensitiveStringComparator()) == 0) {
+            if (Substring(start, iter).Equals(aFileExtension,
+                                              nsCaseInsensitiveStringComparator())) {
               // it's a match.  Assign the type and description and run
               aMajorType.Assign(Substring(majorTypeStart, majorTypeEnd));
               aMinorType.Assign(Substring(minorTypeStart, minorTypeEnd));
@@ -574,12 +573,12 @@ GetExtensionsAndDescriptionFromMimetypesFile(const nsAString& aFilename,
         }
 #endif
         if (NS_SUCCEEDED(rv) &&
-            Compare(Substring(majorTypeStart, majorTypeEnd),
-                    aMajorType,
-                    nsCaseInsensitiveStringComparator()) == 0 &&
-            Compare(Substring(minorTypeStart, minorTypeEnd),
-                    aMinorType,
-                    nsCaseInsensitiveStringComparator()) == 0) {
+            Substring(majorTypeStart,
+                      majorTypeEnd).Equals(aMajorType,
+                                           nsCaseInsensitiveStringComparator())&&
+            Substring(minorTypeStart,
+                      minorTypeEnd).Equals(aMinorType,
+                                           nsCaseInsensitiveStringComparator())) {
           // it's a match
           aFileExtensions.Assign(extensions);
           aDescription.Assign(Substring(descriptionStart, descriptionEnd));
@@ -948,13 +947,14 @@ GetHandlerAndDescriptionFromMailcapFile(const nsAString& aFilename,
           rv = ParseMIMEType(start_iter, majorTypeStart, majorTypeEnd,
                              minorTypeStart, minorTypeEnd, semicolon_iter);
           if (NS_SUCCEEDED(rv) &&
-              Compare(Substring(majorTypeStart, majorTypeEnd),
-                      aMajorType,
-                      nsCaseInsensitiveStringComparator()) == 0 &&
-              (Substring(minorTypeStart, minorTypeEnd).Equals(NS_LITERAL_STRING("*")) ||
-               Compare(Substring(minorTypeStart, minorTypeEnd),
-                       aMinorType,
-                       nsCaseInsensitiveStringComparator()) == 0)) { // we have a match
+              Substring(majorTypeStart,
+                        majorTypeEnd).Equals(aMajorType,
+                                             nsCaseInsensitiveStringComparator()) &&
+              (Substring(minorTypeStart,
+                         minorTypeEnd).Equals(NS_LITERAL_STRING("*")) ||
+               Substring(minorTypeStart,
+                         minorTypeEnd).Equals(aMinorType,
+                                              nsCaseInsensitiveStringComparator()))) { // we have a match
             PRBool match = PR_TRUE;
             ++semicolon_iter;             // point at the first char past the semicolon
             start_iter = semicolon_iter;  // handler string starts here
diff --git a/xpfe/components/bookmarks/src/nsBookmarksService.cpp b/xpfe/components/bookmarks/src/nsBookmarksService.cpp
index e96160fb047..7f3e859e6bc 100644
--- a/xpfe/components/bookmarks/src/nsBookmarksService.cpp
+++ b/xpfe/components/bookmarks/src/nsBookmarksService.cpp
@@ -931,27 +931,22 @@ BookmarkParser::Unescape(nsString &text)
 
 	while((offset = text.FindChar((PRUnichar('&')), offset)) >= 0)
 	{
-		// XXX get max of 6 chars; change the value below if
-		// we ever start looking for longer HTML-escaped values
-		nsAutoString	temp;
-		text.Mid(temp, offset, 6);
-
-		if (Compare(Substring(temp, 0, 4), NS_LITERAL_STRING("<"), nsCaseInsensitiveStringComparator()) == 0)
+		if (Substring(text, offset, 4).Equals(NS_LITERAL_STRING("<"), nsCaseInsensitiveStringComparator()))
 		{
 			text.Cut(offset, 4);
 			text.Insert(PRUnichar('<'), offset);
 		}
-		if (Compare(Substring(temp, 0, 4), NS_LITERAL_STRING(">"), nsCaseInsensitiveStringComparator()) == 0)
+		else if (Substring(text, offset, 4).Equals(NS_LITERAL_STRING(">"), nsCaseInsensitiveStringComparator()))
 		{
 			text.Cut(offset, 4);
 			text.Insert(PRUnichar('>'), offset);
 		}
-		if (Compare(Substring(temp, 0, 5), NS_LITERAL_STRING("&"), nsCaseInsensitiveStringComparator()) == 0)
+		else if (Substring(text, offset, 5).Equals(NS_LITERAL_STRING("&"), nsCaseInsensitiveStringComparator()))
 		{
 			text.Cut(offset, 5);
 			text.Insert(PRUnichar('&'), offset);
 		}
-		if (Compare(Substring(temp, 0, 6), NS_LITERAL_STRING("""), nsCaseInsensitiveStringComparator()) == 0)
+		else if (Substring(text, offset, 6).Equals(NS_LITERAL_STRING("""), nsCaseInsensitiveStringComparator()))
 		{
 			text.Cut(offset, 6);
 			text.Insert(PRUnichar('\"'), offset);
diff --git a/xpfe/components/related/src/nsRelatedLinksHandler.cpp b/xpfe/components/related/src/nsRelatedLinksHandler.cpp
index 0dfcebb42e2..8ee62965506 100644
--- a/xpfe/components/related/src/nsRelatedLinksHandler.cpp
+++ b/xpfe/components/related/src/nsRelatedLinksHandler.cpp
@@ -556,27 +556,22 @@ RelatedLinksStreamListener::Unescape(nsString &text)
 
 	while((offset = text.FindChar((PRUnichar('&')), offset)) >= 0)
 	{
-		// XXX get max of 6 chars; change the value below if
-		// we ever start looking for longer HTML-escaped values
-		nsAutoString	temp;
-		text.Mid(temp, offset, 6);
-
-		if (Compare(Substring(temp, 0, 4), NS_LITERAL_STRING("<"), nsCaseInsensitiveStringComparator()) == 0)
+		if (Substring(text, offset, 4).Equals(NS_LITERAL_STRING("<"), nsCaseInsensitiveStringComparator()))
 		{
 			text.Cut(offset, 4);
 			text.Insert(PRUnichar('<'), offset);
 		}
-		if (Compare(Substring(temp, 0, 4), NS_LITERAL_STRING(">"), nsCaseInsensitiveStringComparator()) == 0)
+		else if (Substring(text, offset, 4).Equals(NS_LITERAL_STRING(">"), nsCaseInsensitiveStringComparator()))
 		{
 			text.Cut(offset, 4);
 			text.Insert(PRUnichar('>'), offset);
 		}
-		if (Compare(Substring(temp, 0, 5), NS_LITERAL_STRING("&"), nsCaseInsensitiveStringComparator()) == 0)
+		else if (Substring(text, offset, 5).Equals(NS_LITERAL_STRING("&"), nsCaseInsensitiveStringComparator()))
 		{
 			text.Cut(offset, 5);
 			text.Insert(PRUnichar('&'), offset);
 		}
-		if (Compare(Substring(temp, 0, 6), NS_LITERAL_STRING("""), nsCaseInsensitiveStringComparator()) == 0)
+		else if (Substring(text, offset, 6).Equals(NS_LITERAL_STRING("""), nsCaseInsensitiveStringComparator()))
 		{
 			text.Cut(offset, 6);
 			text.Insert(PRUnichar('\"'), offset);
diff --git a/xpfe/components/urlbarhistory/src/nsUrlbarHistory.cpp b/xpfe/components/urlbarhistory/src/nsUrlbarHistory.cpp
index 828061499e4..27241dd143b 100644
--- a/xpfe/components/urlbarhistory/src/nsUrlbarHistory.cpp
+++ b/xpfe/components/urlbarhistory/src/nsUrlbarHistory.cpp
@@ -337,9 +337,9 @@ nsUrlbarHistory::SearchPreviousResults(const PRUnichar *searchStr, nsIAutoComple
     // which doesn't make any sense (since the "!= 0" was inside the
     // parentheses)
     if (searchStrLen < prevSearchStrLen ||
-        Compare(Substring(searchStr, searchStr+prevSearchStrLen),
-                nsDependentString(prevSearchString, prevSearchStrLen),
-                nsCaseInsensitiveStringComparator())!= 0)
+        !Substring(searchStr,
+                   searchStr+prevSearchStrLen).Equals(nsDependentString(prevSearchString, prevSearchStrLen),
+                                                      nsCaseInsensitiveStringComparator()))
         return NS_ERROR_ABORT;
 
     nsCOMPtr array;
@@ -368,9 +368,9 @@ nsUrlbarHistory::SearchPreviousResults(const PRUnichar *searchStr, nsIAutoComple
 
 			if (itemValue.IsEmpty())
 				continue;
-            if (Compare(nsDependentString(searchStr, searchStrLen),
-                        Substring(itemValue, 0, searchStrLen),
-                        nsCaseInsensitiveStringComparator()) == 0)
+            if (nsDependentString(searchStr,
+                                  searchStrLen).Equals(Substring(itemValue, 0, searchStrLen),
+                                                       nsCaseInsensitiveStringComparator()))
                 continue;
 
 	    }
@@ -626,8 +626,8 @@ nsUrlbarHistory::CheckItemAvailability(const PRUnichar * aItem, nsIAutoCompleteR
             resultItem->GetValue(itemValue);
             // Using nsIURI to do comparisons didn't quite work out.
             // So use nsCRT methods
-            if (Compare(itemValue, nsDependentString(aItem),
-                        nsCaseInsensitiveStringComparator()) == 0)
+            if (itemValue.Equals(nsDependentString(aItem),
+                                 nsCaseInsensitiveStringComparator()))
             {
                 //printf("In CheckItemAvailability. Item already found\n");
                 *aResult = PR_TRUE;