Relanding the Compare --> Equals conversion. a=mcafee

This commit is contained in:
bzbarsky%mit.edu 2002-02-10 15:49:46 +00:00
Родитель 136abbbacc
Коммит e3b541a10c
68 изменённых файлов: 311 добавлений и 2984 удалений

Просмотреть файл

@ -1071,8 +1071,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);
}
}

Просмотреть файл

@ -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;
}

Просмотреть файл

@ -172,8 +172,7 @@ PRBool nsHTMLValue::operator==(const nsHTMLValue& aOther) const
}
}
else if (nsnull != aOther.mValue.mString) {
return 0 == Compare(nsDependentString(mValue.mString),
nsDependentString(aOther.mValue.mString),
return nsDependentString(mValue.mString).Equals(nsDependentString(aOther.mValue.mString),
nsCaseInsensitiveStringComparator());
}
}

Просмотреть файл

@ -398,7 +398,7 @@ nsHTMLAnchorElement::StringToAttribute(nsIAtom* aAttribute,
}
}
else if (aAttribute == nsHTMLAtoms::suppress) {
if (Compare(aValue,NS_LITERAL_STRING("true"),
if (!aValue.Equals(NS_LITERAL_STRING("true"),
nsCaseInsensitiveStringComparator())) {
aResult.SetEmptyValue(); // XXX? shouldn't just leave "true"
return NS_CONTENT_ATTR_HAS_VALUE;

Просмотреть файл

@ -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);
}

Просмотреть файл

@ -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);

Просмотреть файл

@ -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)

Просмотреть файл

@ -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);

Просмотреть файл

@ -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,8 +3351,7 @@ static PRBool ValueIncludes(const nsString& aValueList, const nsString& aValue,
}
}
else {
if (!Compare(nsDependentString(value),
nsDependentString(start),
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;
}

Просмотреть файл

@ -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);

Просмотреть файл

@ -172,8 +172,7 @@ PRBool nsHTMLValue::operator==(const nsHTMLValue& aOther) const
}
}
else if (nsnull != aOther.mValue.mString) {
return 0 == Compare(nsDependentString(mValue.mString),
nsDependentString(aOther.mValue.mString),
return nsDependentString(mValue.mString).Equals(nsDependentString(aOther.mValue.mString),
nsCaseInsensitiveStringComparator());
}
}

Просмотреть файл

@ -852,20 +852,20 @@ 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);
if (!button.IsEmpty())
mDetail = button.First() - '0';
if (!clickcount.IsEmpty())
mMisc = clickcount.First() - '0';
if (aButton && *aButton)
mDetail = *aButton - '0';
if (aClickCount && *aClickCount)
mMisc = *aClickCount - '0';
// Modifiers are supported by both types of handlers (XUL and XBL).
nsAutoString modifiers(aModifiers);

Просмотреть файл

@ -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);
}

Просмотреть файл

@ -92,8 +92,7 @@ ChangeCSSInlineStyleTxn::ValueIncludes(const nsAReadableString &aValueList, cons
}
}
else {
if (!Compare(nsDependentString(value),
nsDependentString(start),
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);
}

Просмотреть файл

@ -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;
}
}

Просмотреть файл

@ -2492,7 +2492,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"));
@ -6148,7 +6148,7 @@ nsHTMLEditRules::ApplyBlockStyle(nsISupportsArray *arrayOfNodes, const nsAReadab
else if (IsInlineNode(curNode))
{
// if curNode is a non editable, drop it if we are going to <pre>
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

Просмотреть файл

@ -2461,7 +2461,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);
@ -2584,7 +2584,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;
@ -3571,7 +3571,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);
}
}
@ -3863,20 +3864,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;
}

Просмотреть файл

@ -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;
}

Просмотреть файл

@ -107,7 +107,7 @@ nsAOLCiter::StripCites(const nsAReadableString& aInString, nsAWritableString& aO
nsReadingIterator <PRUnichar> 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))

Просмотреть файл

@ -1466,27 +1466,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) {
@ -1508,8 +1508,7 @@ ChromeContextMenuListener :: ContextMenu ( nsIDOMEvent* aMouseEvent )
if (attributes)
{
nsCOMPtr<nsIDOMNode> 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;

Просмотреть файл

@ -429,7 +429,7 @@ nsWalletlibService::OnStateChange(nsIWebProgress* aWebProgress,
nsAutoString type;
rv = inputElement->GetType(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)) {

Просмотреть файл

@ -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 <input> 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 <input> 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) {

Просмотреть файл

@ -1013,12 +1013,12 @@ nsresult CNavDTD::DidHandleStartTag(nsIParserNode& aNode,eHTMLTags aChildTag){
if(theCount) {
PRInt32 theIndex=0;
for(theIndex=0;theIndex<theCount;theIndex++){
nsAutoString theKey(aNode.GetKeyAt(theIndex));
if(!Compare(theKey, NS_LITERAL_STRING("ENTITY"), nsCaseInsensitiveStringComparator())) {
const nsAString& theKey = aNode.GetKeyAt(theIndex);
if(theKey.Equals(NS_LITERAL_STRING("ENTITY"), nsCaseInsensitiveStringComparator())) {
const nsString& theName=aNode.GetValueAt(theIndex);
theNamePtr=&theName;
}
else if(!Compare(theKey, NS_LITERAL_STRING("VALUE"), nsCaseInsensitiveStringComparator())) {
else if(theKey.Equals(NS_LITERAL_STRING("VALUE"), nsCaseInsensitiveStringComparator())) {
//store the named enity with the context...
const nsString& theValue=aNode.GetValueAt(theIndex);
theValuePtr=&theValue;

Просмотреть файл

@ -588,12 +588,12 @@ nsresult COtherDTD::DidHandleStartTag(nsIParserNode& aNode,eHTMLTags aChildTag){
if(theCount) {
PRInt32 theIndex=0;
for(theIndex=0;theIndex<theCount;theIndex++){
nsAutoString theKey(aNode.GetKeyAt(theIndex));
if(!Compare(theKey, NS_LITERAL_STRING("ENTITY"), nsCaseInsensitiveStringComparator())) {
const nsAString& theKey = aNode.GetKeyAt(theIndex);
if(theKey.Equals(NS_LITERAL_STRING("ENTITY"), nsCaseInsensitiveStringComparator())) {
const nsString& theName=aNode.GetValueAt(theIndex);
theNamePtr=&theName;
}
else if(!Compare(theKey, NS_LITERAL_STRING("VALUE"), nsCaseInsensitiveStringComparator())) {
else if(theKey.Equals(NS_LITERAL_STRING("VALUE"), nsCaseInsensitiveStringComparator())) {
//store the named enity with the context...
const nsString& theValue=aNode.GetValueAt(theIndex);
theValuePtr=&theValue;

Просмотреть файл

@ -842,10 +842,10 @@ PRInt32 nsDTDContext::IncrementCounter(eHTMLTags aTag,nsIParserNode& aNode,nsStr
CAbacus::eNumFormat theNumFormat=CAbacus::eDecimal;
for(theIndex=0;theIndex<theCount;theIndex++){
nsAutoString theKey(aNode.GetKeyAt(theIndex));
const nsAString& theKey=aNode.GetKeyAt(theIndex);
const nsString& theValue=aNode.GetValueAt(theIndex);
if(!Compare(theKey, NS_LITERAL_STRING("name"), nsCaseInsensitiveStringComparator())){
if(theKey.Equals(NS_LITERAL_STRING("name"), nsCaseInsensitiveStringComparator())){
theEntity=GetEntity(theValue);
if(!theEntity) {
theEntity=RegisterEntity(theValue,theValue);
@ -853,10 +853,10 @@ PRInt32 nsDTDContext::IncrementCounter(eHTMLTags aTag,nsIParserNode& aNode,nsStr
}
aTag=eHTMLTag_userdefined;
}
else if(!Compare(theKey, NS_LITERAL_STRING("noincr"), nsCaseInsensitiveStringComparator())){
else if(theKey.Equals(NS_LITERAL_STRING("noincr"), nsCaseInsensitiveStringComparator())){
theIncrValue=0;
}
else if(!Compare(theKey, NS_LITERAL_STRING("format"), nsCaseInsensitiveStringComparator())){
else if(theKey.Equals(NS_LITERAL_STRING("format"), nsCaseInsensitiveStringComparator())){
PRUnichar theChar=theValue.CharAt(0);
if('"'==theChar)
theChar=theValue.CharAt(1);
@ -873,7 +873,7 @@ PRInt32 nsDTDContext::IncrementCounter(eHTMLTags aTag,nsIParserNode& aNode,nsStr
}
//determine numbering style
}
else if(!Compare(theKey, NS_LITERAL_STRING("value"), nsCaseInsensitiveStringComparator())){
else if(theKey.Equals(NS_LITERAL_STRING("value"), nsCaseInsensitiveStringComparator())){
PRInt32 err=0;
theNewValue=theValue.ToInteger(&err);
if(!err) {

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1203,7 +1203,7 @@ NS_IMETHODIMP CViewSourceHTML::HandleToken(CToken* aToken,nsIParser* aParser) {
{
nsAutoString theStr;
theStr.Assign(aToken->GetStringValue());
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);

Просмотреть файл

@ -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,7 +148,7 @@ NS_IMETHODIMP nsMetaCharsetObserver::Notify(
const PRUnichar* aTag,
const nsStringArray* keys, const nsStringArray* values)
{
if(0 != Compare(nsDependentString(aTag), NS_LITERAL_STRING("META"),
if(!nsDependentString(aTag).Equals(NS_LITERAL_STRING("META"),
nsCaseInsensitiveStringComparator()))
return NS_ERROR_ILLEGAL_VALUE;
else
@ -215,16 +216,13 @@ NS_IMETHODIMP nsMetaCharsetObserver::Notify(
while(IS_SPACE_CHARS(*keyStr))
keyStr++;
if(0 == Compare(Substring(keyStr, keyStr+10),
NS_LITERAL_STRING("HTTP-EQUIV"),
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"),
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"),
else if (Substring(keyStr, keyStr+7).Equals(NS_LITERAL_STRING("charset"),
nsCaseInsensitiveStringComparator()))
charsetValue = values->StringAt(i)->get();
}
@ -241,25 +239,25 @@ NS_IMETHODIMP nsMetaCharsetObserver::Notify(
if(
// first try unquoted strings
((0==Compare(Substring(httpEquivValue,httpEquivValue+contenttype.Length()),
contenttype,
((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,
(Substring(httpEquivValue+1,
httpEquivValue+1+contenttype.Length()).Equals(contenttype,
nsCaseInsensitiveStringComparator()))
)) &&
// first try unquoted strings
((0==Compare(Substring(contentValue,contentValue+texthtml.Length()),
texthtml,
((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,
(Substring(contentValue+1,
contentValue+1+texthtml.Length()).Equals(texthtml,
nsCaseInsensitiveStringComparator()))
))
)
@ -352,7 +350,7 @@ NS_IMETHODIMP nsMetaCharsetObserver::GetCharsetFromCompatibilityTag(
// e.g. <META charset="ISO-8859-1">
PRInt32 numOfAttributes = keys->Count();
if ((numOfAttributes >= 3) &&
(0 == Compare(*keys->StringAt(0), NS_LITERAL_STRING("charset"),
(keys->StringAt(0)->Equals(NS_LITERAL_STRING("charset"),
nsCaseInsensitiveStringComparator())))
{
nsAutoString srcStr((values->StringAt(numOfAttributes-2))->get());

Просмотреть файл

@ -94,7 +94,7 @@ NS_IMETHODIMP nsXMLEncodingObserver::Notify(
const PRUnichar* nameArray[],
const PRUnichar* valueArray[])
{
if(0 != Compare(nsDependentString(aTag), NS_LITERAL_STRING("?XML"),
if(!nsDependentString(aTag).Equals(NS_LITERAL_STRING("?XML"),
nsCaseInsensitiveStringComparator()))
return NS_ERROR_ILLEGAL_VALUE;
else
@ -143,7 +143,7 @@ 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"),
} else if(nsDependentString(nameArray[i]).Equals(NS_LITERAL_STRING("encoding"),
nsCaseInsensitiveStringComparator())) {
bGotEncoding = PR_TRUE;
encoding = valueArray[i];

Просмотреть файл

@ -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);
}
}

Просмотреть файл

@ -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;
}

Просмотреть файл

@ -1462,10 +1462,10 @@ nsObjectFrame::IsHidden() const
// not to hide the <embed> 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 <embed> or <applet> is hidden.
return PR_TRUE;
}

Просмотреть файл

@ -1462,10 +1462,10 @@ nsObjectFrame::IsHidden() const
// not to hide the <embed> 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 <embed> or <applet> is hidden.
return PR_TRUE;
}

Просмотреть файл

@ -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);

Просмотреть файл

@ -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)

Просмотреть файл

@ -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);

Просмотреть файл

@ -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,8 +3351,7 @@ static PRBool ValueIncludes(const nsString& aValueList, const nsString& aValue,
}
}
else {
if (!Compare(nsDependentString(value),
nsDependentString(start),
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;
}

Просмотреть файл

@ -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<nsIMenuFrame> menuFrame = do_QueryInterface(currFrame);
if (menuFrame)

Просмотреть файл

@ -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 +

Просмотреть файл

@ -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;

Просмотреть файл

@ -1037,7 +1037,9 @@ PRBool PR_CALLBACK nsMsgAccountManager::cleanupOnExit(nsHashKey *aKey, void *aDa
nsCOMPtr<nsIMsgFolder>inboxFolder = 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))

Просмотреть файл

@ -938,8 +938,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);

Просмотреть файл

@ -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());
}
}
}

Просмотреть файл

@ -2324,9 +2324,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)
@ -3801,7 +3800,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;
}
}

Просмотреть файл

@ -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;
}
}

Просмотреть файл

@ -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;
@ -3923,8 +3923,7 @@ PRBool nsImapMailFolder::ShowDeletedMessages()
{
nsXPIDLString folderName;
GetName(getter_Copies(folderName));
if (!Compare(Substring(folderName,0,convertedName.Length()),
convertedName,
if (Substring(folderName,0,convertedName.Length()).Equals(convertedName,
nsCaseInsensitiveStringComparator()))
showDeleted = PR_TRUE;
}

Просмотреть файл

@ -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();
}
}

Просмотреть файл

@ -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);
}

Просмотреть файл

@ -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,8 +1378,7 @@ nsresult nsEudoraWin32::FoundAddressBook( nsIFileSpec *spec, const PRUnichar *pN
nsCRT::free( pLeaf);
nsString tStr;
name.Right( tStr, 4);
if (! Compare(tStr,
NS_LITERAL_STRING(".txt"),
if (tStr.Equals(NS_LITERAL_STRING(".txt"),
nsCaseInsensitiveStringComparator())) {
name.Left( tStr, name.Length() - 4);
name = tStr;

Просмотреть файл

@ -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);

Просмотреть файл

@ -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;
}

Просмотреть файл

@ -801,8 +801,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);

Просмотреть файл

@ -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;

2
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);
}

Просмотреть файл

@ -2132,7 +2132,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()));

Просмотреть файл

@ -542,10 +542,9 @@ mozTXTToHTMLConv::ItMatchesDelimited(const PRUnichar * aInString,
nsCRT::IsAsciiDigit(textAfterPos) ||
textAfterPos == *rep
) ||
Compare(Substring(nsDependentString(aInString, aInLength),
!Substring(nsDependentString(aInString, aInLength),
(before == LT_IGNORE ? 0 : 1),
aRepLen),
nsDependentString(rep, aRepLen),
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

Просмотреть файл

@ -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;
}
//

Просмотреть файл

@ -1013,12 +1013,12 @@ nsresult CNavDTD::DidHandleStartTag(nsIParserNode& aNode,eHTMLTags aChildTag){
if(theCount) {
PRInt32 theIndex=0;
for(theIndex=0;theIndex<theCount;theIndex++){
nsAutoString theKey(aNode.GetKeyAt(theIndex));
if(!Compare(theKey, NS_LITERAL_STRING("ENTITY"), nsCaseInsensitiveStringComparator())) {
const nsAString& theKey = aNode.GetKeyAt(theIndex);
if(theKey.Equals(NS_LITERAL_STRING("ENTITY"), nsCaseInsensitiveStringComparator())) {
const nsString& theName=aNode.GetValueAt(theIndex);
theNamePtr=&theName;
}
else if(!Compare(theKey, NS_LITERAL_STRING("VALUE"), nsCaseInsensitiveStringComparator())) {
else if(theKey.Equals(NS_LITERAL_STRING("VALUE"), nsCaseInsensitiveStringComparator())) {
//store the named enity with the context...
const nsString& theValue=aNode.GetValueAt(theIndex);
theValuePtr=&theValue;

Просмотреть файл

@ -588,12 +588,12 @@ nsresult COtherDTD::DidHandleStartTag(nsIParserNode& aNode,eHTMLTags aChildTag){
if(theCount) {
PRInt32 theIndex=0;
for(theIndex=0;theIndex<theCount;theIndex++){
nsAutoString theKey(aNode.GetKeyAt(theIndex));
if(!Compare(theKey, NS_LITERAL_STRING("ENTITY"), nsCaseInsensitiveStringComparator())) {
const nsAString& theKey = aNode.GetKeyAt(theIndex);
if(theKey.Equals(NS_LITERAL_STRING("ENTITY"), nsCaseInsensitiveStringComparator())) {
const nsString& theName=aNode.GetValueAt(theIndex);
theNamePtr=&theName;
}
else if(!Compare(theKey, NS_LITERAL_STRING("VALUE"), nsCaseInsensitiveStringComparator())) {
else if(theKey.Equals(NS_LITERAL_STRING("VALUE"), nsCaseInsensitiveStringComparator())) {
//store the named enity with the context...
const nsString& theValue=aNode.GetValueAt(theIndex);
theValuePtr=&theValue;

Просмотреть файл

@ -842,10 +842,10 @@ PRInt32 nsDTDContext::IncrementCounter(eHTMLTags aTag,nsIParserNode& aNode,nsStr
CAbacus::eNumFormat theNumFormat=CAbacus::eDecimal;
for(theIndex=0;theIndex<theCount;theIndex++){
nsAutoString theKey(aNode.GetKeyAt(theIndex));
const nsAString& theKey=aNode.GetKeyAt(theIndex);
const nsString& theValue=aNode.GetValueAt(theIndex);
if(!Compare(theKey, NS_LITERAL_STRING("name"), nsCaseInsensitiveStringComparator())){
if(theKey.Equals(NS_LITERAL_STRING("name"), nsCaseInsensitiveStringComparator())){
theEntity=GetEntity(theValue);
if(!theEntity) {
theEntity=RegisterEntity(theValue,theValue);
@ -853,10 +853,10 @@ PRInt32 nsDTDContext::IncrementCounter(eHTMLTags aTag,nsIParserNode& aNode,nsStr
}
aTag=eHTMLTag_userdefined;
}
else if(!Compare(theKey, NS_LITERAL_STRING("noincr"), nsCaseInsensitiveStringComparator())){
else if(theKey.Equals(NS_LITERAL_STRING("noincr"), nsCaseInsensitiveStringComparator())){
theIncrValue=0;
}
else if(!Compare(theKey, NS_LITERAL_STRING("format"), nsCaseInsensitiveStringComparator())){
else if(theKey.Equals(NS_LITERAL_STRING("format"), nsCaseInsensitiveStringComparator())){
PRUnichar theChar=theValue.CharAt(0);
if('"'==theChar)
theChar=theValue.CharAt(1);
@ -873,7 +873,7 @@ PRInt32 nsDTDContext::IncrementCounter(eHTMLTags aTag,nsIParserNode& aNode,nsStr
}
//determine numbering style
}
else if(!Compare(theKey, NS_LITERAL_STRING("value"), nsCaseInsensitiveStringComparator())){
else if(theKey.Equals(NS_LITERAL_STRING("value"), nsCaseInsensitiveStringComparator())){
PRInt32 err=0;
theNewValue=theValue.ToInteger(&err);
if(!err) {

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1203,7 +1203,7 @@ NS_IMETHODIMP CViewSourceHTML::HandleToken(CToken* aToken,nsIParser* aParser) {
{
nsAutoString theStr;
theStr.Assign(aToken->GetStringValue());
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);

Просмотреть файл

@ -92,7 +92,7 @@ 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:"),
Substring(uri, 0, 3).Equals(NS_LITERAL_STRING("nc:"),
nsCaseInsensitiveStringComparator())) {
return PR_FALSE;
}

Просмотреть файл

@ -1744,9 +1744,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.

Просмотреть файл

@ -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

Просмотреть файл

@ -934,27 +934,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("&lt;"), nsCaseInsensitiveStringComparator()) == 0)
if (Substring(text, offset, 4).Equals(NS_LITERAL_STRING("&lt;"), nsCaseInsensitiveStringComparator()))
{
text.Cut(offset, 4);
text.Insert(PRUnichar('<'), offset);
}
if (Compare(Substring(temp, 0, 4), NS_LITERAL_STRING("&gt;"), nsCaseInsensitiveStringComparator()) == 0)
else if (Substring(text, offset, 4).Equals(NS_LITERAL_STRING("&gt;"), nsCaseInsensitiveStringComparator()))
{
text.Cut(offset, 4);
text.Insert(PRUnichar('>'), offset);
}
if (Compare(Substring(temp, 0, 5), NS_LITERAL_STRING("&amp;"), nsCaseInsensitiveStringComparator()) == 0)
else if (Substring(text, offset, 5).Equals(NS_LITERAL_STRING("&amp;"), nsCaseInsensitiveStringComparator()))
{
text.Cut(offset, 5);
text.Insert(PRUnichar('&'), offset);
}
if (Compare(Substring(temp, 0, 6), NS_LITERAL_STRING("&quot;"), nsCaseInsensitiveStringComparator()) == 0)
else if (Substring(text, offset, 6).Equals(NS_LITERAL_STRING("&quot;"), nsCaseInsensitiveStringComparator()))
{
text.Cut(offset, 6);
text.Insert(PRUnichar('\"'), offset);

Просмотреть файл

@ -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("&lt;"), nsCaseInsensitiveStringComparator()) == 0)
if (Substring(text, offset, 4).Equals(NS_LITERAL_STRING("&lt;"), nsCaseInsensitiveStringComparator()))
{
text.Cut(offset, 4);
text.Insert(PRUnichar('<'), offset);
}
if (Compare(Substring(temp, 0, 4), NS_LITERAL_STRING("&gt;"), nsCaseInsensitiveStringComparator()) == 0)
else if (Substring(text, offset, 4).Equals(NS_LITERAL_STRING("&gt;"), nsCaseInsensitiveStringComparator()))
{
text.Cut(offset, 4);
text.Insert(PRUnichar('>'), offset);
}
if (Compare(Substring(temp, 0, 5), NS_LITERAL_STRING("&amp;"), nsCaseInsensitiveStringComparator()) == 0)
else if (Substring(text, offset, 5).Equals(NS_LITERAL_STRING("&amp;"), nsCaseInsensitiveStringComparator()))
{
text.Cut(offset, 5);
text.Insert(PRUnichar('&'), offset);
}
if (Compare(Substring(temp, 0, 6), NS_LITERAL_STRING("&quot;"), nsCaseInsensitiveStringComparator()) == 0)
else if (Substring(text, offset, 6).Equals(NS_LITERAL_STRING("&quot;"), nsCaseInsensitiveStringComparator()))
{
text.Cut(offset, 6);
text.Insert(PRUnichar('\"'), offset);

Просмотреть файл

@ -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<nsISupportsArray> 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;