зеркало из https://github.com/mozilla/pjs.git
Convert Compare() to Equals() where possible now that we can do
case-insensitive Equals(). Bug 115289, r=alecf, sr=jag
This commit is contained in:
Родитель
8d7e1b0c62
Коммит
580e33204e
|
@ -1050,8 +1050,8 @@ nsDocument::SetHeaderData(nsIAtom* aHeaderField, const nsAReadableString& aData)
|
||||||
sheet->GetTitle(title);
|
sheet->GetTitle(title);
|
||||||
if (!title.IsEmpty()) { // if sheet has title
|
if (!title.IsEmpty()) { // if sheet has title
|
||||||
PRBool disabled = (aData.IsEmpty() ||
|
PRBool disabled = (aData.IsEmpty() ||
|
||||||
Compare(title, aData,
|
!title.Equals(aData,
|
||||||
nsCaseInsensitiveStringComparator()) != 0);
|
nsCaseInsensitiveStringComparator()));
|
||||||
SetStyleSheetDisabledState(sheet, disabled);
|
SetStyleSheetDisabledState(sheet, disabled);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -839,23 +839,23 @@ nsGenericElement::InternalIsSupported(const nsAReadableString& aFeature,
|
||||||
*aReturn = PR_FALSE;
|
*aReturn = PR_FALSE;
|
||||||
nsAutoString feature(aFeature);
|
nsAutoString feature(aFeature);
|
||||||
|
|
||||||
if (!Compare(feature, NS_LITERAL_STRING("XML"), nsCaseInsensitiveStringComparator()) ||
|
if (feature.Equals(NS_LITERAL_STRING("XML"), nsCaseInsensitiveStringComparator()) ||
|
||||||
!Compare(feature, NS_LITERAL_STRING("HTML"), nsCaseInsensitiveStringComparator())) {
|
feature.Equals(NS_LITERAL_STRING("HTML"), nsCaseInsensitiveStringComparator())) {
|
||||||
if (aVersion.IsEmpty() ||
|
if (aVersion.IsEmpty() ||
|
||||||
aVersion.Equals(NS_LITERAL_STRING("1.0")) ||
|
aVersion.Equals(NS_LITERAL_STRING("1.0")) ||
|
||||||
aVersion.Equals(NS_LITERAL_STRING("2.0"))) {
|
aVersion.Equals(NS_LITERAL_STRING("2.0"))) {
|
||||||
*aReturn = PR_TRUE;
|
*aReturn = PR_TRUE;
|
||||||
}
|
}
|
||||||
} else if (!Compare(feature, NS_LITERAL_STRING("Views"), nsCaseInsensitiveStringComparator()) ||
|
} else if (feature.Equals(NS_LITERAL_STRING("Views"), nsCaseInsensitiveStringComparator()) ||
|
||||||
!Compare(feature, NS_LITERAL_STRING("StyleSheets"), nsCaseInsensitiveStringComparator()) ||
|
feature.Equals(NS_LITERAL_STRING("StyleSheets"), nsCaseInsensitiveStringComparator()) ||
|
||||||
!Compare(feature, NS_LITERAL_STRING("CSS"), nsCaseInsensitiveStringComparator()) ||
|
feature.Equals(NS_LITERAL_STRING("CSS"), nsCaseInsensitiveStringComparator()) ||
|
||||||
// !Compare(feature, NS_LITERAL_STRING("CSS2"), nsCaseInsensitiveStringComparator()) ||
|
// feature.Equals(NS_LITERAL_STRING("CSS2"), nsCaseInsensitiveStringComparator()) ||
|
||||||
!Compare(feature, NS_LITERAL_STRING("Events"), nsCaseInsensitiveStringComparator()) ||
|
feature.Equals(NS_LITERAL_STRING("Events"), nsCaseInsensitiveStringComparator()) ||
|
||||||
// !Compare(feature, NS_LITERAL_STRING("UIEvents"), nsCaseInsensitiveStringComparator()) ||
|
// feature.Equals(NS_LITERAL_STRING("UIEvents"), nsCaseInsensitiveStringComparator()) ||
|
||||||
!Compare(feature, NS_LITERAL_STRING("MouseEvents"), nsCaseInsensitiveStringComparator()) ||
|
feature.Equals(NS_LITERAL_STRING("MouseEvents"), nsCaseInsensitiveStringComparator()) ||
|
||||||
!Compare(feature, NS_LITERAL_STRING("MouseScrollEvents"), nsCaseInsensitiveStringComparator()) ||
|
feature.Equals(NS_LITERAL_STRING("MouseScrollEvents"), nsCaseInsensitiveStringComparator()) ||
|
||||||
!Compare(feature, NS_LITERAL_STRING("HTMLEvents"), nsCaseInsensitiveStringComparator()) ||
|
feature.Equals(NS_LITERAL_STRING("HTMLEvents"), nsCaseInsensitiveStringComparator()) ||
|
||||||
!Compare(feature, NS_LITERAL_STRING("Range"), nsCaseInsensitiveStringComparator())) {
|
feature.Equals(NS_LITERAL_STRING("Range"), nsCaseInsensitiveStringComparator())) {
|
||||||
if (aVersion.IsEmpty() || aVersion.Equals(NS_LITERAL_STRING("2.0"))) {
|
if (aVersion.IsEmpty() || aVersion.Equals(NS_LITERAL_STRING("2.0"))) {
|
||||||
*aReturn = PR_TRUE;
|
*aReturn = PR_TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -172,9 +172,8 @@ PRBool nsHTMLValue::operator==(const nsHTMLValue& aOther) const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (nsnull != aOther.mValue.mString) {
|
else if (nsnull != aOther.mValue.mString) {
|
||||||
return 0 == Compare(nsDependentString(mValue.mString),
|
return nsDependentString(mValue.mString).Equals(nsDependentString(aOther.mValue.mString),
|
||||||
nsDependentString(aOther.mValue.mString),
|
nsCaseInsensitiveStringComparator());
|
||||||
nsCaseInsensitiveStringComparator());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (eHTMLUnit_ISupports == mUnit) {
|
else if (eHTMLUnit_ISupports == mUnit) {
|
||||||
|
|
|
@ -398,8 +398,8 @@ nsHTMLAnchorElement::StringToAttribute(nsIAtom* aAttribute,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (aAttribute == nsHTMLAtoms::suppress) {
|
else if (aAttribute == nsHTMLAtoms::suppress) {
|
||||||
if (Compare(aValue,NS_LITERAL_STRING("true"),
|
if (!aValue.Equals(NS_LITERAL_STRING("true"),
|
||||||
nsCaseInsensitiveStringComparator())) {
|
nsCaseInsensitiveStringComparator())) {
|
||||||
aResult.SetEmptyValue(); // XXX? shouldn't just leave "true"
|
aResult.SetEmptyValue(); // XXX? shouldn't just leave "true"
|
||||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -212,7 +212,7 @@ nsHTMLButtonElement::SetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName,
|
||||||
nsAutoString value(aValue);
|
nsAutoString value(aValue);
|
||||||
|
|
||||||
if (aName == nsHTMLAtoms::disabled &&
|
if (aName == nsHTMLAtoms::disabled &&
|
||||||
!Compare(value, NS_LITERAL_STRING("false"), nsCaseInsensitiveStringComparator())) {
|
value.Equals(NS_LITERAL_STRING("false"), nsCaseInsensitiveStringComparator())) {
|
||||||
return UnsetAttr(aNameSpaceID, aName, aNotify);
|
return UnsetAttr(aNameSpaceID, aName, aNotify);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5521,7 +5521,7 @@ nsCSSDeclaration::TryBackgroundPosition(nsAWritableString & aString,
|
||||||
AppendValueToString(eCSSProperty_background_x_position, backgroundXValue);
|
AppendValueToString(eCSSProperty_background_x_position, backgroundXValue);
|
||||||
AppendValueToString(eCSSProperty_background_y_position, backgroundYValue);
|
AppendValueToString(eCSSProperty_background_y_position, backgroundYValue);
|
||||||
aString.Append(backgroundYValue);
|
aString.Append(backgroundYValue);
|
||||||
if (Compare(backgroundXValue, backgroundYValue, nsCaseInsensitiveStringComparator())) {
|
if (!backgroundXValue.Equals(backgroundYValue, nsCaseInsensitiveStringComparator())) {
|
||||||
// the two values are different
|
// the two values are different
|
||||||
aString.Append(PRUnichar(' '));
|
aString.Append(PRUnichar(' '));
|
||||||
aString.Append(backgroundXValue);
|
aString.Append(backgroundXValue);
|
||||||
|
|
|
@ -638,9 +638,8 @@ SheetLoadData::OnStreamComplete(nsIStreamLoader* aLoader,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (mLoader->mNavQuirkMode ||
|
if (mLoader->mNavQuirkMode ||
|
||||||
Compare(contentType,
|
contentType.Equals(NS_LITERAL_CSTRING("text/css"),
|
||||||
NS_LITERAL_CSTRING("text/css"),
|
nsCaseInsensitiveCStringComparator()) ||
|
||||||
nsCaseInsensitiveCStringComparator()) == 0 ||
|
|
||||||
contentType.IsEmpty()) {
|
contentType.IsEmpty()) {
|
||||||
/*
|
/*
|
||||||
* First determine the charset (if one is indicated)
|
* 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_x_position, backgroundXValue);
|
||||||
AppendValueToString(eCSSProperty_background_y_position, backgroundYValue);
|
AppendValueToString(eCSSProperty_background_y_position, backgroundYValue);
|
||||||
aString.Append(backgroundYValue);
|
aString.Append(backgroundYValue);
|
||||||
if (Compare(backgroundXValue, backgroundYValue, nsCaseInsensitiveStringComparator())) {
|
if (!backgroundXValue.Equals(backgroundYValue, nsCaseInsensitiveStringComparator())) {
|
||||||
// the two values are different
|
// the two values are different
|
||||||
aString.Append(PRUnichar(' '));
|
aString.Append(PRUnichar(' '));
|
||||||
aString.Append(backgroundXValue);
|
aString.Append(backgroundXValue);
|
||||||
|
|
|
@ -201,9 +201,8 @@ PRBool AtomKey_base::Equals(const nsHashKey* aKey) const
|
||||||
const PRUnichar *theirStr = nsnull;
|
const PRUnichar *theirStr = nsnull;
|
||||||
theirAtom->GetUnicode(&theirStr);
|
theirAtom->GetUnicode(&theirStr);
|
||||||
|
|
||||||
return Compare(nsDependentString(myStr),
|
return nsDependentString(myStr).Equals(nsDependentString(theirStr),
|
||||||
nsDependentString(theirStr),
|
nsCaseInsensitiveStringComparator());
|
||||||
nsCaseInsensitiveStringComparator()) == 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -3352,9 +3351,8 @@ static PRBool ValueIncludes(const nsString& aValueList, const nsString& aValue,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (!Compare(nsDependentString(value),
|
if (nsDependentString(value).Equals(nsDependentString(start),
|
||||||
nsDependentString(start),
|
nsCaseInsensitiveStringComparator())) {
|
||||||
nsCaseInsensitiveStringComparator())) {
|
|
||||||
return PR_TRUE;
|
return PR_TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3648,9 +3646,9 @@ static PRBool SelectorMatches(RuleProcessorData &data,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (isCaseSensitive)
|
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
|
else
|
||||||
result = PRBool(localTrue == !Compare(Substring(value, 0, selLen), attr->mValue, nsCaseInsensitiveStringComparator()));
|
result = PRBool(localTrue == Substring(value, 0, selLen).Equals(attr->mValue, nsCaseInsensitiveStringComparator()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -3662,9 +3660,9 @@ static PRBool SelectorMatches(RuleProcessorData &data,
|
||||||
result = localFalse;
|
result = localFalse;
|
||||||
} else {
|
} else {
|
||||||
if (isCaseSensitive)
|
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
|
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;
|
break;
|
||||||
|
@ -3676,9 +3674,9 @@ static PRBool SelectorMatches(RuleProcessorData &data,
|
||||||
result = localFalse;
|
result = localFalse;
|
||||||
} else {
|
} else {
|
||||||
if (isCaseSensitive)
|
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
|
else
|
||||||
result = PRBool(localTrue == !Compare(Substring(value, 0, selLen), attr->mValue, nsCaseInsensitiveStringComparator()));
|
result = PRBool(localTrue == Substring(value, 0, selLen).Equals(attr->mValue, nsCaseInsensitiveStringComparator()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -3718,8 +3716,8 @@ static PRBool SelectorMatches(RuleProcessorData &data,
|
||||||
const PRUnichar* id2Str;
|
const PRUnichar* id2Str;
|
||||||
IDList->mAtom->GetUnicode(&id2Str);
|
IDList->mAtom->GetUnicode(&id2Str);
|
||||||
nsDependentString id2(id2Str);
|
nsDependentString id2(id2Str);
|
||||||
if (localTrue ==
|
if (localTrue !=
|
||||||
(Compare(id1, id2, nsCaseInsensitiveStringComparator()) != 0)) {
|
id1.Equals(id2, nsCaseInsensitiveStringComparator())) {
|
||||||
result = PR_FALSE;
|
result = PR_FALSE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1447,7 +1447,7 @@ HTMLAttributesImpl::HasClass(nsIAtom* aClass, PRBool aCaseSensitive) const
|
||||||
const PRUnichar* class2Buf;
|
const PRUnichar* class2Buf;
|
||||||
classList->mAtom->GetUnicode(&class2Buf);
|
classList->mAtom->GetUnicode(&class2Buf);
|
||||||
nsDependentString class2(class2Buf);
|
nsDependentString class2(class2Buf);
|
||||||
if (Compare(class1, class2, nsCaseInsensitiveStringComparator()) == 0)
|
if (class1.Equals(class2, nsCaseInsensitiveStringComparator()))
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
classList = classList->mNext;
|
classList = classList->mNext;
|
||||||
} while (classList);
|
} while (classList);
|
||||||
|
|
|
@ -172,9 +172,8 @@ PRBool nsHTMLValue::operator==(const nsHTMLValue& aOther) const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (nsnull != aOther.mValue.mString) {
|
else if (nsnull != aOther.mValue.mString) {
|
||||||
return 0 == Compare(nsDependentString(mValue.mString),
|
return nsDependentString(mValue.mString).Equals(nsDependentString(aOther.mValue.mString),
|
||||||
nsDependentString(aOther.mValue.mString),
|
nsCaseInsensitiveStringComparator());
|
||||||
nsCaseInsensitiveStringComparator());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (eHTMLUnit_ISupports == mUnit) {
|
else if (eHTMLUnit_ISupports == mUnit) {
|
||||||
|
|
|
@ -852,16 +852,17 @@ nsXBLPrototypeHandler::ConstructPrototype(nsIContent* aKeyElement,
|
||||||
mEventName = getter_AddRefs(NS_NewAtom(event));
|
mEventName = getter_AddRefs(NS_NewAtom(event));
|
||||||
|
|
||||||
if (aPhase) {
|
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;
|
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;
|
mPhase = NS_PHASE_TARGET;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Button and clickcount apply only to XBL handlers and don't apply to XUL key
|
// Button and clickcount apply only to XBL handlers and don't apply to XUL key
|
||||||
// handlers.
|
// handlers.
|
||||||
nsAutoString button(aButton);
|
const nsDependentString button(aButton);
|
||||||
nsAutoString clickcount(aClickCount);
|
const nsDependentString clickcount(aClickCount);
|
||||||
if (!button.IsEmpty())
|
if (!button.IsEmpty())
|
||||||
mDetail = button.First() - '0';
|
mDetail = button.First() - '0';
|
||||||
if (!clickcount.IsEmpty())
|
if (!clickcount.IsEmpty())
|
||||||
|
|
|
@ -1444,10 +1444,12 @@ XULContentSinkImpl::OpenScript(const PRUnichar** aAttributes,
|
||||||
nsAutoString src;
|
nsAutoString src;
|
||||||
while (*aAttributes) {
|
while (*aAttributes) {
|
||||||
const nsDependentString key(aAttributes[0]);
|
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]);
|
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 type(aAttributes[1]);
|
||||||
nsAutoString mimeType;
|
nsAutoString mimeType;
|
||||||
nsAutoString params;
|
nsAutoString params;
|
||||||
|
@ -1473,7 +1475,8 @@ XULContentSinkImpl::OpenScript(const PRUnichar** aAttributes,
|
||||||
jsVersionString = JS_VersionToString(jsVersion);
|
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]);
|
nsAutoString lang(aAttributes[1]);
|
||||||
isJavaScript = nsParserUtils::IsJavaScriptLanguage(lang, &jsVersionString);
|
isJavaScript = nsParserUtils::IsJavaScriptLanguage(lang, &jsVersionString);
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,9 +92,8 @@ ChangeCSSInlineStyleTxn::ValueIncludes(const nsAReadableString &aValueList, cons
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (!Compare(nsDependentString(value),
|
if (nsDependentString(value).Equals(nsDependentString(start),
|
||||||
nsDependentString(start),
|
nsCaseInsensitiveStringComparator())) {
|
||||||
nsCaseInsensitiveStringComparator())) {
|
|
||||||
result = PR_TRUE;
|
result = PR_TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -370,8 +369,9 @@ ChangeCSSInlineStyleTxn::AcceptsMoreThanOneValue(nsIAtom *aCSSProperty)
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
ChangeCSSInlineStyleTxn::AddValueToMultivalueProperty(nsAWritableString & aValues, const nsAReadableString & aNewValue)
|
ChangeCSSInlineStyleTxn::AddValueToMultivalueProperty(nsAWritableString & aValues, const nsAReadableString & aNewValue)
|
||||||
{
|
{
|
||||||
if (!aValues.Length()
|
if (aValues.IsEmpty()
|
||||||
|| !Compare(aValues, NS_LITERAL_STRING("none"), nsCaseInsensitiveStringComparator())) {
|
|| aValues.Equals(NS_LITERAL_STRING("none"),
|
||||||
|
nsCaseInsensitiveStringComparator())) {
|
||||||
// the list of values is empty of the value is 'none'
|
// the list of values is empty of the value is 'none'
|
||||||
aValues.Assign(aNewValue);
|
aValues.Assign(aNewValue);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1179,7 +1179,8 @@ nsHTMLCSSUtils::IsCSSEquivalentToHTMLInlineStyleSet(nsIDOMNode * aNode,
|
||||||
if (!htmlValueString.Equals(NS_LITERAL_STRING(""))) {
|
if (!htmlValueString.Equals(NS_LITERAL_STRING(""))) {
|
||||||
nsAutoString leftHTMLValue;
|
nsAutoString leftHTMLValue;
|
||||||
htmlValueString.Left(leftHTMLValue, 5);
|
htmlValueString.Left(leftHTMLValue, 5);
|
||||||
aIsSet = PRBool(!Compare(leftHTMLValue, leftCSSValue, nsCaseInsensitiveStringComparator()));
|
aIsSet = leftHTMLValue.Equals(leftCSSValue,
|
||||||
|
nsCaseInsensitiveStringComparator());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
aIsSet = (leftCSSValue.Equals(NS_LITERAL_STRING("times")) ||
|
aIsSet = (leftCSSValue.Equals(NS_LITERAL_STRING("times")) ||
|
||||||
|
@ -1202,7 +1203,8 @@ nsHTMLCSSUtils::IsCSSEquivalentToHTMLInlineStyleSet(nsIDOMNode * aNode,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!htmlValueString.Equals(NS_LITERAL_STRING(""))) {
|
if (!htmlValueString.Equals(NS_LITERAL_STRING(""))) {
|
||||||
if (!Compare(htmlValueString, valueString, nsCaseInsensitiveStringComparator())) {
|
if (htmlValueString.Equals(valueString,
|
||||||
|
nsCaseInsensitiveStringComparator())) {
|
||||||
aIsSet = PR_TRUE;
|
aIsSet = PR_TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2436,7 +2436,7 @@ nsHTMLEditRules::WillMakeList(nsISelection *aSelection,
|
||||||
nsAutoString itemType;
|
nsAutoString itemType;
|
||||||
if (aItemType)
|
if (aItemType)
|
||||||
itemType = *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"));
|
itemType.Assign(NS_LITERAL_STRING("dd"));
|
||||||
else
|
else
|
||||||
itemType.Assign(NS_LITERAL_STRING("li"));
|
itemType.Assign(NS_LITERAL_STRING("li"));
|
||||||
|
@ -6079,7 +6079,7 @@ nsHTMLEditRules::ApplyBlockStyle(nsISupportsArray *arrayOfNodes, const nsAReadab
|
||||||
else if (IsInlineNode(curNode))
|
else if (IsInlineNode(curNode))
|
||||||
{
|
{
|
||||||
// if curNode is a non editable, drop it if we are going to <pre>
|
// 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)))
|
&& (!mHTMLEditor->IsEditable(curNode)))
|
||||||
continue; // do nothing to this block
|
continue; // do nothing to this block
|
||||||
|
|
||||||
|
|
|
@ -2459,7 +2459,7 @@ nsHTMLEditor::RemoveList(const nsAReadableString& aListType)
|
||||||
if (!selection) return NS_ERROR_NULL_POINTER;
|
if (!selection) return NS_ERROR_NULL_POINTER;
|
||||||
|
|
||||||
nsTextRulesInfo ruleInfo(nsTextEditRules::kRemoveList);
|
nsTextRulesInfo ruleInfo(nsTextEditRules::kRemoveList);
|
||||||
if (!Compare(aListType,NS_LITERAL_STRING("ol"),nsCaseInsensitiveStringComparator()))
|
if (aListType.Equals(NS_LITERAL_STRING("ol"),nsCaseInsensitiveStringComparator()))
|
||||||
ruleInfo.bOrdered = PR_TRUE;
|
ruleInfo.bOrdered = PR_TRUE;
|
||||||
else ruleInfo.bOrdered = PR_FALSE;
|
else ruleInfo.bOrdered = PR_FALSE;
|
||||||
res = mRules->WillDoAction(selection, &ruleInfo, &cancel, &handled);
|
res = mRules->WillDoAction(selection, &ruleInfo, &cancel, &handled);
|
||||||
|
@ -2582,7 +2582,7 @@ nsHTMLEditor::Indent(const nsAReadableString& aIndent)
|
||||||
PRBool cancel, handled;
|
PRBool cancel, handled;
|
||||||
PRInt32 theAction = nsTextEditRules::kIndent;
|
PRInt32 theAction = nsTextEditRules::kIndent;
|
||||||
PRInt32 opID = kOpIndent;
|
PRInt32 opID = kOpIndent;
|
||||||
if (!Compare(aIndent,NS_LITERAL_STRING("outdent"),nsCaseInsensitiveStringComparator()))
|
if (aIndent.Equals(NS_LITERAL_STRING("outdent"),nsCaseInsensitiveStringComparator()))
|
||||||
{
|
{
|
||||||
theAction = nsTextEditRules::kOutdent;
|
theAction = nsTextEditRules::kOutdent;
|
||||||
opID = kOpOutdent;
|
opID = kOpOutdent;
|
||||||
|
@ -3569,7 +3569,8 @@ nsHTMLEditor::GetEmbeddedObjects(nsISupportsArray** aNodeList)
|
||||||
{
|
{
|
||||||
nsAutoString href;
|
nsAutoString href;
|
||||||
if (NS_SUCCEEDED(anchor->GetHref(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);
|
(*aNodeList)->AppendElement(node);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3861,20 +3862,20 @@ PRBool
|
||||||
nsHTMLEditor::TagCanContainTag(const nsAReadableString& aParentTag, const nsAReadableString& aChildTag)
|
nsHTMLEditor::TagCanContainTag(const nsAReadableString& aParentTag, const nsAReadableString& aChildTag)
|
||||||
{
|
{
|
||||||
// COtherDTD gives some unwanted results. We override them here.
|
// COtherDTD gives some unwanted results. We override them here.
|
||||||
if (!Compare(aParentTag,NS_LITERAL_STRING("ol"),nsCaseInsensitiveStringComparator()) ||
|
if (aParentTag.Equals(NS_LITERAL_STRING("ol"),nsCaseInsensitiveStringComparator()) ||
|
||||||
!Compare(aParentTag,NS_LITERAL_STRING("ul"),nsCaseInsensitiveStringComparator()))
|
aParentTag.Equals(NS_LITERAL_STRING("ul"),nsCaseInsensitiveStringComparator()))
|
||||||
{
|
{
|
||||||
// if parent is a list and tag is also a list, say "yes".
|
// if parent is a list and tag is also a list, say "yes".
|
||||||
// This is because the editor does sublists illegally for now.
|
// This is because the editor does sublists illegally for now.
|
||||||
if (!Compare(aChildTag,NS_LITERAL_STRING("ol"),nsCaseInsensitiveStringComparator()) ||
|
if (aChildTag.Equals(NS_LITERAL_STRING("ol"),nsCaseInsensitiveStringComparator()) ||
|
||||||
!Compare(aChildTag,NS_LITERAL_STRING("ul"),nsCaseInsensitiveStringComparator()))
|
aChildTag.Equals(NS_LITERAL_STRING("ul"),nsCaseInsensitiveStringComparator()))
|
||||||
return PR_TRUE;
|
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
|
// 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;
|
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
|
if ( aProperty == nsIEditProperty::font && // or node is big or small and we are setting font size
|
||||||
(NodeIsType(aNode, nsIEditProperty::big) || NodeIsType(aNode, nsIEditProperty::small)) &&
|
(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
|
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
|
if (!attrName) continue; // ooops
|
||||||
attrName->ToString(attrString);
|
attrName->ToString(attrString);
|
||||||
// if it's the attribute we know about, keep looking
|
// 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
|
// if it's a special _moz... attribute, keep looking
|
||||||
attrString.Left(tmp,4);
|
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
|
// otherwise, it's another attribute, so return false
|
||||||
return PR_FALSE;
|
return PR_FALSE;
|
||||||
}
|
}
|
||||||
|
@ -798,7 +798,7 @@ PRBool nsHTMLEditor::HasAttrVal(nsIDOMNode *aNode,
|
||||||
attNode->GetValue(attrVal);
|
attNode->GetValue(attrVal);
|
||||||
|
|
||||||
// do values match?
|
// do values match?
|
||||||
if (!Compare(attrVal,*aValue,nsCaseInsensitiveStringComparator())) return PR_TRUE;
|
if (attrVal.Equals(*aValue,nsCaseInsensitiveStringComparator())) return PR_TRUE;
|
||||||
return PR_FALSE;
|
return PR_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -107,7 +107,7 @@ nsAOLCiter::StripCites(const nsAReadableString& aInString, nsAWritableString& aO
|
||||||
nsReadingIterator <PRUnichar> iter,enditer;
|
nsReadingIterator <PRUnichar> iter,enditer;
|
||||||
aInString.BeginReading(iter);
|
aInString.BeginReading(iter);
|
||||||
aInString.EndReading(enditer);
|
aInString.EndReading(enditer);
|
||||||
if (!Compare(Substring(aInString,0,2),NS_LITERAL_STRING(">>")))
|
if (Substring(aInString,0,2).Equals(NS_LITERAL_STRING(">>")))
|
||||||
{
|
{
|
||||||
iter.advance(2);
|
iter.advance(2);
|
||||||
while (nsCRT::IsAsciiSpace(*iter))
|
while (nsCRT::IsAsciiSpace(*iter))
|
||||||
|
|
|
@ -1467,27 +1467,27 @@ ChromeContextMenuListener :: ContextMenu ( nsIDOMEvent* aMouseEvent )
|
||||||
element->GetTagName(tag);
|
element->GetTagName(tag);
|
||||||
|
|
||||||
// Test what kind of element we're dealing with here
|
// 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;
|
flags |= nsIContextMenuListener::CONTEXT_IMAGE;
|
||||||
targetDOMnode = node;
|
targetDOMnode = node;
|
||||||
// if we see an image, keep searching for a possible anchor
|
// 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.
|
// INPUT element - button, combo, checkbox, text etc.
|
||||||
flags |= nsIContextMenuListener::CONTEXT_INPUT;
|
flags |= nsIContextMenuListener::CONTEXT_INPUT;
|
||||||
targetDOMnode = node;
|
targetDOMnode = node;
|
||||||
break; // exit do-while
|
break; // exit do-while
|
||||||
}
|
}
|
||||||
else if (!Compare(tag, NS_LITERAL_STRING("textarea"), nsCaseInsensitiveStringComparator()))
|
else if (tag.Equals(NS_LITERAL_STRING("textarea"), nsCaseInsensitiveStringComparator()))
|
||||||
{
|
{
|
||||||
// text area
|
// text area
|
||||||
flags |= nsIContextMenuListener::CONTEXT_TEXT;
|
flags |= nsIContextMenuListener::CONTEXT_TEXT;
|
||||||
targetDOMnode = node;
|
targetDOMnode = node;
|
||||||
break; // exit do-while
|
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.
|
// only care about this if no other context was found.
|
||||||
if (!flags) {
|
if (!flags) {
|
||||||
|
@ -1509,8 +1509,7 @@ ChromeContextMenuListener :: ContextMenu ( nsIDOMEvent* aMouseEvent )
|
||||||
if (attributes)
|
if (attributes)
|
||||||
{
|
{
|
||||||
nsCOMPtr<nsIDOMNode> hrefNode;
|
nsCOMPtr<nsIDOMNode> hrefNode;
|
||||||
nsAutoString href(NS_LITERAL_STRING("href"));
|
attributes->GetNamedItem(NS_LITERAL_STRING("href"), getter_AddRefs(hrefNode));
|
||||||
attributes->GetNamedItem(href, getter_AddRefs(hrefNode));
|
|
||||||
if (hrefNode)
|
if (hrefNode)
|
||||||
{
|
{
|
||||||
flags |= nsIContextMenuListener::CONTEXT_LINK;
|
flags |= nsIContextMenuListener::CONTEXT_LINK;
|
||||||
|
|
|
@ -183,7 +183,7 @@ int CPrintSetupDialog::GetPaperSizeIndexFromData(short aUnit, double aW, double
|
||||||
int CPrintSetupDialog::GetPaperSizeIndex(const CString& aStr)
|
int CPrintSetupDialog::GetPaperSizeIndex(const CString& aStr)
|
||||||
{
|
{
|
||||||
for (int i=0;i<gNumPaperSizes;i++) {
|
for (int i=0;i<gNumPaperSizes;i++) {
|
||||||
if (!aStr.Compare(gPaperSize[i].mDesc)) {
|
if (aStr.Equals(gPaperSize[i].mDesc)) {
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -429,7 +429,7 @@ nsWalletlibService::OnStateChange(nsIWebProgress* aWebProgress,
|
||||||
nsAutoString type;
|
nsAutoString type;
|
||||||
rv = inputElement->GetType(type);
|
rv = inputElement->GetType(type);
|
||||||
if (NS_SUCCEEDED(rv)) {
|
if (NS_SUCCEEDED(rv)) {
|
||||||
if (Compare(type, NS_LITERAL_STRING("password"), nsCaseInsensitiveStringComparator()) == 0) {
|
if (type.Equals(NS_LITERAL_STRING("password"), nsCaseInsensitiveStringComparator())) {
|
||||||
passwordCount++;
|
passwordCount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -449,8 +449,11 @@ nsWalletlibService::OnStateChange(nsIWebProgress* aWebProgress,
|
||||||
nsAutoString type;
|
nsAutoString type;
|
||||||
rv = inputElement->GetType(type);
|
rv = inputElement->GetType(type);
|
||||||
if (NS_SUCCEEDED(rv)) {
|
if (NS_SUCCEEDED(rv)) {
|
||||||
if ((type.IsEmpty()) || (Compare(type, NS_LITERAL_STRING("text"), nsCaseInsensitiveStringComparator()) == 0) ||
|
if (type.IsEmpty() ||
|
||||||
(Compare(type, NS_LITERAL_STRING("password"), nsCaseInsensitiveStringComparator()) == 0)) {
|
type.Equals(NS_LITERAL_STRING("text"),
|
||||||
|
nsCaseInsensitiveStringComparator()) ||
|
||||||
|
type.Equals(NS_LITERAL_STRING("password"),
|
||||||
|
nsCaseInsensitiveStringComparator())) {
|
||||||
nsAutoString field;
|
nsAutoString field;
|
||||||
rv = inputElement->GetName(field);
|
rv = inputElement->GetName(field);
|
||||||
if (NS_SUCCEEDED(rv)) {
|
if (NS_SUCCEEDED(rv)) {
|
||||||
|
|
|
@ -1960,14 +1960,16 @@ wallet_StepForwardOrBack
|
||||||
if (goForward) {
|
if (goForward) {
|
||||||
if (NS_SUCCEEDED(result) &&
|
if (NS_SUCCEEDED(result) &&
|
||||||
(type.IsEmpty() ||
|
(type.IsEmpty() ||
|
||||||
(Compare(type, NS_LITERAL_STRING("text"),
|
type.Equals(NS_LITERAL_STRING("text"),
|
||||||
nsCaseInsensitiveStringComparator()) == 0))) {
|
nsCaseInsensitiveStringComparator()))) {
|
||||||
/* at <input> element and it's type is either "text" or is missing ("text" by default) */
|
/* at <input> element and it's type is either "text" or is missing ("text" by default) */
|
||||||
atInputOrSelect = PR_TRUE;
|
atInputOrSelect = PR_TRUE;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} 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" */
|
/* at <input> element and it's type is not "hidden" */
|
||||||
atInputOrSelect = PR_TRUE;
|
atInputOrSelect = PR_TRUE;
|
||||||
return;
|
return;
|
||||||
|
@ -2402,7 +2404,10 @@ wallet_GetPrefills(
|
||||||
if ((NS_SUCCEEDED(result)) && (nsnull != inputElement)) {
|
if ((NS_SUCCEEDED(result)) && (nsnull != inputElement)) {
|
||||||
nsAutoString type;
|
nsAutoString type;
|
||||||
result = inputElement->GetType(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;
|
nsAutoString field;
|
||||||
result = inputElement->GetName(field);
|
result = inputElement->GetName(field);
|
||||||
if (NS_SUCCEEDED(result)) {
|
if (NS_SUCCEEDED(result)) {
|
||||||
|
@ -3636,8 +3641,10 @@ wallet_CaptureInputElement(nsIDOMNode* elementNode, nsIDocument* doc) {
|
||||||
/* it's an input element */
|
/* it's an input element */
|
||||||
nsAutoString type;
|
nsAutoString type;
|
||||||
result = inputElement->GetType(type);
|
result = inputElement->GetType(type);
|
||||||
if ((NS_SUCCEEDED(result)) &&
|
if (NS_SUCCEEDED(result) &&
|
||||||
(type.IsEmpty() || (Compare(type, NS_LITERAL_STRING("text"), nsCaseInsensitiveStringComparator()) == 0))) {
|
(type.IsEmpty() ||
|
||||||
|
type.Equals(NS_LITERAL_STRING("text"),
|
||||||
|
nsCaseInsensitiveStringComparator()))) {
|
||||||
nsAutoString field;
|
nsAutoString field;
|
||||||
result = inputElement->GetName(field);
|
result = inputElement->GetName(field);
|
||||||
if (NS_SUCCEEDED(result)) {
|
if (NS_SUCCEEDED(result)) {
|
||||||
|
@ -3992,8 +3999,8 @@ WLLT_OnSubmit(nsIContent* currentForm, nsIDOMWindowInternal* window) {
|
||||||
rv = inputElement->GetType(type);
|
rv = inputElement->GetType(type);
|
||||||
if (NS_SUCCEEDED(rv)) {
|
if (NS_SUCCEEDED(rv)) {
|
||||||
|
|
||||||
PRBool isText = (type.IsEmpty() || (Compare(type, NS_LITERAL_STRING("text"), nsCaseInsensitiveStringComparator())==0));
|
PRBool isText = (type.IsEmpty() || type.Equals(NS_LITERAL_STRING("text"), nsCaseInsensitiveStringComparator()));
|
||||||
PRBool isPassword = (Compare(type, NS_LITERAL_STRING("password"), nsCaseInsensitiveStringComparator())==0);
|
PRBool isPassword = type.Equals(NS_LITERAL_STRING("password"), nsCaseInsensitiveStringComparator());
|
||||||
|
|
||||||
// don't save password if field was left blank
|
// don't save password if field was left blank
|
||||||
if (isPassword) {
|
if (isPassword) {
|
||||||
|
|
|
@ -1013,12 +1013,12 @@ nsresult CNavDTD::DidHandleStartTag(nsIParserNode& aNode,eHTMLTags aChildTag){
|
||||||
if(theCount) {
|
if(theCount) {
|
||||||
PRInt32 theIndex=0;
|
PRInt32 theIndex=0;
|
||||||
for(theIndex=0;theIndex<theCount;theIndex++){
|
for(theIndex=0;theIndex<theCount;theIndex++){
|
||||||
nsAutoString theKey(aNode.GetKeyAt(theIndex));
|
const nsAString& theKey = aNode.GetKeyAt(theIndex);
|
||||||
if(!Compare(theKey, NS_LITERAL_STRING("ENTITY"), nsCaseInsensitiveStringComparator())) {
|
if(theKey.Equals(NS_LITERAL_STRING("ENTITY"), nsCaseInsensitiveStringComparator())) {
|
||||||
const nsString& theName=aNode.GetValueAt(theIndex);
|
const nsString& theName=aNode.GetValueAt(theIndex);
|
||||||
theNamePtr=&theName;
|
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...
|
//store the named enity with the context...
|
||||||
const nsString& theValue=aNode.GetValueAt(theIndex);
|
const nsString& theValue=aNode.GetValueAt(theIndex);
|
||||||
theValuePtr=&theValue;
|
theValuePtr=&theValue;
|
||||||
|
|
|
@ -588,12 +588,12 @@ nsresult COtherDTD::DidHandleStartTag(nsIParserNode& aNode,eHTMLTags aChildTag){
|
||||||
if(theCount) {
|
if(theCount) {
|
||||||
PRInt32 theIndex=0;
|
PRInt32 theIndex=0;
|
||||||
for(theIndex=0;theIndex<theCount;theIndex++){
|
for(theIndex=0;theIndex<theCount;theIndex++){
|
||||||
nsAutoString theKey(aNode.GetKeyAt(theIndex));
|
const nsAString& theKey = aNode.GetKeyAt(theIndex);
|
||||||
if(!Compare(theKey, NS_LITERAL_STRING("ENTITY"), nsCaseInsensitiveStringComparator())) {
|
if(theKey.Equals(NS_LITERAL_STRING("ENTITY"), nsCaseInsensitiveStringComparator())) {
|
||||||
const nsString& theName=aNode.GetValueAt(theIndex);
|
const nsString& theName=aNode.GetValueAt(theIndex);
|
||||||
theNamePtr=&theName;
|
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...
|
//store the named enity with the context...
|
||||||
const nsString& theValue=aNode.GetValueAt(theIndex);
|
const nsString& theValue=aNode.GetValueAt(theIndex);
|
||||||
theValuePtr=&theValue;
|
theValuePtr=&theValue;
|
||||||
|
|
|
@ -842,10 +842,10 @@ PRInt32 nsDTDContext::IncrementCounter(eHTMLTags aTag,nsIParserNode& aNode,nsStr
|
||||||
CAbacus::eNumFormat theNumFormat=CAbacus::eDecimal;
|
CAbacus::eNumFormat theNumFormat=CAbacus::eDecimal;
|
||||||
|
|
||||||
for(theIndex=0;theIndex<theCount;theIndex++){
|
for(theIndex=0;theIndex<theCount;theIndex++){
|
||||||
nsAutoString theKey(aNode.GetKeyAt(theIndex));
|
const nsAString& theKey=aNode.GetKeyAt(theIndex);
|
||||||
const nsString& theValue=aNode.GetValueAt(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);
|
theEntity=GetEntity(theValue);
|
||||||
if(!theEntity) {
|
if(!theEntity) {
|
||||||
theEntity=RegisterEntity(theValue,theValue);
|
theEntity=RegisterEntity(theValue,theValue);
|
||||||
|
@ -853,10 +853,10 @@ PRInt32 nsDTDContext::IncrementCounter(eHTMLTags aTag,nsIParserNode& aNode,nsStr
|
||||||
}
|
}
|
||||||
aTag=eHTMLTag_userdefined;
|
aTag=eHTMLTag_userdefined;
|
||||||
}
|
}
|
||||||
else if(!Compare(theKey, NS_LITERAL_STRING("noincr"), nsCaseInsensitiveStringComparator())){
|
else if(theKey.Equals(NS_LITERAL_STRING("noincr"), nsCaseInsensitiveStringComparator())){
|
||||||
theIncrValue=0;
|
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);
|
PRUnichar theChar=theValue.CharAt(0);
|
||||||
if('"'==theChar)
|
if('"'==theChar)
|
||||||
theChar=theValue.CharAt(1);
|
theChar=theValue.CharAt(1);
|
||||||
|
@ -873,7 +873,7 @@ PRInt32 nsDTDContext::IncrementCounter(eHTMLTags aTag,nsIParserNode& aNode,nsStr
|
||||||
}
|
}
|
||||||
//determine numbering style
|
//determine numbering style
|
||||||
}
|
}
|
||||||
else if(!Compare(theKey, NS_LITERAL_STRING("value"), nsCaseInsensitiveStringComparator())){
|
else if(theKey.Equals(NS_LITERAL_STRING("value"), nsCaseInsensitiveStringComparator())){
|
||||||
PRInt32 err=0;
|
PRInt32 err=0;
|
||||||
theNewValue=theValue.ToInteger(&err);
|
theNewValue=theValue.ToInteger(&err);
|
||||||
if(!err) {
|
if(!err) {
|
||||||
|
|
|
@ -413,7 +413,7 @@ void nsHTMLContentSinkStream::WriteAttributes(const nsIParserNode& aNode)
|
||||||
if(theCount) {
|
if(theCount) {
|
||||||
int i=0;
|
int i=0;
|
||||||
for(i=0;i<theCount;i++){
|
for(i=0;i<theCount;i++){
|
||||||
nsAutoString key(aNode.GetKeyAt(i));
|
const nsAString& key = aNode.GetKeyAt(i);
|
||||||
|
|
||||||
// See if there's an attribute:
|
// See if there's an attribute:
|
||||||
// note that we copy here, because we're going to have to trim quotes.
|
// note that we copy here, because we're going to have to trim quotes.
|
||||||
|
@ -423,7 +423,7 @@ void nsHTMLContentSinkStream::WriteAttributes(const nsIParserNode& aNode)
|
||||||
value.Trim("\"", PR_TRUE, PR_TRUE);
|
value.Trim("\"", PR_TRUE, PR_TRUE);
|
||||||
|
|
||||||
// Filter out any attribute starting with _moz
|
// Filter out any attribute starting with _moz
|
||||||
if (!Compare(key, NS_LITERAL_STRING("_moz"), nsCaseInsensitiveStringComparator())
|
if (key.Equals(NS_LITERAL_STRING("_moz"), nsCaseInsensitiveStringComparator()))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -437,8 +437,8 @@ void nsHTMLContentSinkStream::WriteAttributes(const nsIParserNode& aNode)
|
||||||
// used by the editor. Bug 16988. Yuck.
|
// used by the editor. Bug 16988. Yuck.
|
||||||
//
|
//
|
||||||
if ((eHTMLTags)aNode.GetNodeType() == eHTMLTag_br
|
if ((eHTMLTags)aNode.GetNodeType() == eHTMLTag_br
|
||||||
&& (!Compare((key, NS_LITERAL_STRING("type"), nsCaseInsensitiveStringComparator())
|
&& key.Equals(NS_LITERAL_STRING("type"), nsCaseInsensitiveStringComparator())
|
||||||
&& value.Equals(NS_LITERAL_STRING("_moz")))))
|
&& value.Equals(NS_LITERAL_STRING("_moz")))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (mLowerCaseTags == PR_TRUE)
|
if (mLowerCaseTags == PR_TRUE)
|
||||||
|
@ -456,8 +456,8 @@ void nsHTMLContentSinkStream::WriteAttributes(const nsIParserNode& aNode)
|
||||||
|
|
||||||
// Make all links absolute when converting only the selection:
|
// Make all links absolute when converting only the selection:
|
||||||
if ((mFlags & nsIDocumentEncoder::OutputAbsoluteLinks)
|
if ((mFlags & nsIDocumentEncoder::OutputAbsoluteLinks)
|
||||||
&& (!Compare(key, NS_LITERAL_STRING("href"), nsCaseInsensitiveStringComparator())
|
&& (key.Equals(NS_LITERAL_STRING("href"), nsCaseInsensitiveStringComparator())
|
||||||
|| !Compare(key, NS_LITERAL_STRING("src"), nsCaseInsensitiveStringComparator())
|
|| key.Equals(NS_LITERAL_STRING("src"), nsCaseInsensitiveStringComparator())
|
||||||
// Would be nice to handle OBJECT and APPLET tags,
|
// Would be nice to handle OBJECT and APPLET tags,
|
||||||
// but that gets more complicated since we have to
|
// but that gets more complicated since we have to
|
||||||
// search the tag list for CODEBASE as well.
|
// search the tag list for CODEBASE as well.
|
||||||
|
|
|
@ -1203,7 +1203,7 @@ NS_IMETHODIMP CViewSourceHTML::HandleToken(CToken* aToken,nsIParser* aParser) {
|
||||||
{
|
{
|
||||||
nsAutoString theStr;
|
nsAutoString theStr;
|
||||||
theStr.Assign(aToken->GetStringValue());
|
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);
|
PRUnichar theChar=theStr.CharAt(0);
|
||||||
if((nsCRT::IsAsciiDigit(theChar)) || ('X'==theChar) || ('x'==theChar)){
|
if((nsCRT::IsAsciiDigit(theChar)) || ('X'==theChar) || ('x'==theChar)){
|
||||||
theStr.Assign(NS_LITERAL_STRING("#") + theStr);
|
theStr.Assign(NS_LITERAL_STRING("#") + theStr);
|
||||||
|
|
|
@ -106,7 +106,8 @@ NS_IMETHODIMP nsMetaCharsetObserver::Notify(
|
||||||
const PRUnichar* valueArray[])
|
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;
|
return NS_ERROR_ILLEGAL_VALUE;
|
||||||
else
|
else
|
||||||
return Notify(aDocumentID, numOfAttributes, nameArray, valueArray);
|
return Notify(aDocumentID, numOfAttributes, nameArray, valueArray);
|
||||||
|
@ -147,8 +148,8 @@ NS_IMETHODIMP nsMetaCharsetObserver::Notify(
|
||||||
const PRUnichar* aTag,
|
const PRUnichar* aTag,
|
||||||
const nsStringArray* keys, const nsStringArray* values)
|
const nsStringArray* keys, const nsStringArray* values)
|
||||||
{
|
{
|
||||||
if(0 != Compare(nsDependentString(aTag), NS_LITERAL_STRING("META"),
|
if(!nsDependentString(aTag).Equals(NS_LITERAL_STRING("META"),
|
||||||
nsCaseInsensitiveStringComparator()))
|
nsCaseInsensitiveStringComparator()))
|
||||||
return NS_ERROR_ILLEGAL_VALUE;
|
return NS_ERROR_ILLEGAL_VALUE;
|
||||||
else
|
else
|
||||||
return Notify(aWebShell, aChannel, keys, values);
|
return Notify(aWebShell, aChannel, keys, values);
|
||||||
|
@ -215,17 +216,14 @@ NS_IMETHODIMP nsMetaCharsetObserver::Notify(
|
||||||
while(IS_SPACE_CHARS(*keyStr))
|
while(IS_SPACE_CHARS(*keyStr))
|
||||||
keyStr++;
|
keyStr++;
|
||||||
|
|
||||||
if(0 == Compare(Substring(keyStr, keyStr+10),
|
if(Substring(keyStr, keyStr+10).Equals(NS_LITERAL_STRING("HTTP-EQUIV"),
|
||||||
NS_LITERAL_STRING("HTTP-EQUIV"),
|
nsCaseInsensitiveStringComparator()))
|
||||||
nsCaseInsensitiveStringComparator()))
|
|
||||||
httpEquivValue = values->StringAt(i)->get();
|
httpEquivValue = values->StringAt(i)->get();
|
||||||
else if(0 == Compare(Substring(keyStr, keyStr+7),
|
else if(Substring(keyStr, keyStr+7).Equals(NS_LITERAL_STRING("content"),
|
||||||
NS_LITERAL_STRING("content"),
|
nsCaseInsensitiveStringComparator()))
|
||||||
nsCaseInsensitiveStringComparator()))
|
|
||||||
contentValue = values->StringAt(i)->get();
|
contentValue = values->StringAt(i)->get();
|
||||||
else if (0 == Compare(Substring(keyStr, keyStr+7),
|
else if (Substring(keyStr, keyStr+7).Equals(NS_LITERAL_STRING("charset"),
|
||||||
NS_LITERAL_STRING("charset"),
|
nsCaseInsensitiveStringComparator()))
|
||||||
nsCaseInsensitiveStringComparator()))
|
|
||||||
charsetValue = values->StringAt(i)->get();
|
charsetValue = values->StringAt(i)->get();
|
||||||
}
|
}
|
||||||
NS_NAMED_LITERAL_STRING(contenttype, "Content-Type");
|
NS_NAMED_LITERAL_STRING(contenttype, "Content-Type");
|
||||||
|
@ -241,26 +239,26 @@ NS_IMETHODIMP nsMetaCharsetObserver::Notify(
|
||||||
|
|
||||||
if(
|
if(
|
||||||
// first try unquoted strings
|
// first try unquoted strings
|
||||||
((0==Compare(Substring(httpEquivValue,httpEquivValue+contenttype.Length()),
|
((Substring(httpEquivValue,
|
||||||
contenttype,
|
httpEquivValue+contenttype.Length()).Equals(contenttype,
|
||||||
nsCaseInsensitiveStringComparator())) ||
|
nsCaseInsensitiveStringComparator())) ||
|
||||||
// now try "quoted" or 'quoted' strings
|
// now try "quoted" or 'quoted' strings
|
||||||
(( (httpEquivValue[0]=='\'') ||
|
(( (httpEquivValue[0]=='\'') ||
|
||||||
(httpEquivValue[0]=='\"') ) &&
|
(httpEquivValue[0]=='\"') ) &&
|
||||||
(0==Compare(Substring(httpEquivValue+1, httpEquivValue+1+contenttype.Length()),
|
(Substring(httpEquivValue+1,
|
||||||
contenttype,
|
httpEquivValue+1+contenttype.Length()).Equals(contenttype,
|
||||||
nsCaseInsensitiveStringComparator()))
|
nsCaseInsensitiveStringComparator()))
|
||||||
)) &&
|
)) &&
|
||||||
// first try unquoted strings
|
// first try unquoted strings
|
||||||
((0==Compare(Substring(contentValue,contentValue+texthtml.Length()),
|
((Substring(contentValue,
|
||||||
texthtml,
|
contentValue+texthtml.Length()).Equals(texthtml,
|
||||||
nsCaseInsensitiveStringComparator())) ||
|
nsCaseInsensitiveStringComparator())) ||
|
||||||
// now try "quoted" or 'quoted' strings
|
// now try "quoted" or 'quoted' strings
|
||||||
(((contentValue[0]=='\'') ||
|
(((contentValue[0]=='\'') ||
|
||||||
(contentValue[0]=='\"'))&&
|
(contentValue[0]=='\"'))&&
|
||||||
(0==Compare(Substring(contentValue+1, contentValue+1+texthtml.Length()),
|
(Substring(contentValue+1,
|
||||||
texthtml,
|
contentValue+1+texthtml.Length()).Equals(texthtml,
|
||||||
nsCaseInsensitiveStringComparator()))
|
nsCaseInsensitiveStringComparator()))
|
||||||
))
|
))
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
@ -352,8 +350,8 @@ NS_IMETHODIMP nsMetaCharsetObserver::GetCharsetFromCompatibilityTag(
|
||||||
// e.g. <META charset="ISO-8859-1">
|
// e.g. <META charset="ISO-8859-1">
|
||||||
PRInt32 numOfAttributes = keys->Count();
|
PRInt32 numOfAttributes = keys->Count();
|
||||||
if ((numOfAttributes >= 3) &&
|
if ((numOfAttributes >= 3) &&
|
||||||
(0 == Compare(*keys->StringAt(0), NS_LITERAL_STRING("charset"),
|
(keys->StringAt(0)->Equals(NS_LITERAL_STRING("charset"),
|
||||||
nsCaseInsensitiveStringComparator())))
|
nsCaseInsensitiveStringComparator())))
|
||||||
{
|
{
|
||||||
nsAutoString srcStr((values->StringAt(numOfAttributes-2))->get());
|
nsAutoString srcStr((values->StringAt(numOfAttributes-2))->get());
|
||||||
PRInt32 err;
|
PRInt32 err;
|
||||||
|
|
|
@ -94,8 +94,8 @@ NS_IMETHODIMP nsXMLEncodingObserver::Notify(
|
||||||
const PRUnichar* nameArray[],
|
const PRUnichar* nameArray[],
|
||||||
const PRUnichar* valueArray[])
|
const PRUnichar* valueArray[])
|
||||||
{
|
{
|
||||||
if(0 != Compare(nsDependentString(aTag), NS_LITERAL_STRING("?XML"),
|
if(!nsDependentString(aTag).Equals(NS_LITERAL_STRING("?XML"),
|
||||||
nsCaseInsensitiveStringComparator()))
|
nsCaseInsensitiveStringComparator()))
|
||||||
return NS_ERROR_ILLEGAL_VALUE;
|
return NS_ERROR_ILLEGAL_VALUE;
|
||||||
else
|
else
|
||||||
return Notify(aDocumentID, numOfAttributes, nameArray, valueArray);
|
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())) {
|
} else if(0==nsCRT::strcmp(nameArray[i], NS_LITERAL_STRING("charsetSource").get())) {
|
||||||
bGotCurrentCharsetSource = PR_TRUE;
|
bGotCurrentCharsetSource = PR_TRUE;
|
||||||
charsetSourceStr = valueArray[i];
|
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())) {
|
nsCaseInsensitiveStringComparator())) {
|
||||||
bGotEncoding = PR_TRUE;
|
bGotEncoding = PR_TRUE;
|
||||||
encoding = valueArray[i];
|
encoding = valueArray[i];
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,7 +96,9 @@ nsresult nsCollationUnix::Initialize(nsILocale* locale)
|
||||||
PRUnichar *prefValue;
|
PRUnichar *prefValue;
|
||||||
res = prefs->GetLocalizedUnicharPref("intl.collationOption", &prefValue);
|
res = prefs->GetLocalizedUnicharPref("intl.collationOption", &prefValue);
|
||||||
if (NS_SUCCEEDED(res)) {
|
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);
|
nsMemory::Free(prefValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -127,7 +127,7 @@ NS_IMETHODIMP nsCharsetAlias2::Equals(const nsAReadableString& aCharset1, const
|
||||||
{
|
{
|
||||||
nsresult res = NS_OK;
|
nsresult res = NS_OK;
|
||||||
|
|
||||||
if(Compare(aCharset1, aCharset2, nsCaseInsensitiveStringComparator()) == 0) {
|
if(aCharset1.Equals(aCharset2, nsCaseInsensitiveStringComparator())) {
|
||||||
*oResult = PR_TRUE;
|
*oResult = PR_TRUE;
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1462,10 +1462,10 @@ nsObjectFrame::IsHidden() const
|
||||||
// not to hide the <embed> once you'd put the 'hidden' attribute
|
// not to hide the <embed> once you'd put the 'hidden' attribute
|
||||||
// on the tag...
|
// on the tag...
|
||||||
// these |NS_ConvertASCIItoUCS2|s can't be |NS_LITERAL_STRING|s until |EqualsIgnoreCase| get's fixed
|
// these |NS_ConvertASCIItoUCS2|s can't be |NS_LITERAL_STRING|s until |EqualsIgnoreCase| get's fixed
|
||||||
if (hidden.Length() &&
|
if (!hidden.IsEmpty() &&
|
||||||
(Compare(hidden, NS_LITERAL_STRING("false"), nsCaseInsensitiveStringComparator()) != 0) &&
|
!hidden.Equals(NS_LITERAL_STRING("false"), nsCaseInsensitiveStringComparator()) &&
|
||||||
(Compare(hidden, NS_LITERAL_STRING("no"), nsCaseInsensitiveStringComparator()) != 0) &&
|
!hidden.Equals(NS_LITERAL_STRING("no"), nsCaseInsensitiveStringComparator()) &&
|
||||||
(Compare(hidden, NS_LITERAL_STRING("off"), nsCaseInsensitiveStringComparator()) != 0)) {
|
!hidden.Equals(NS_LITERAL_STRING("off"), nsCaseInsensitiveStringComparator())) {
|
||||||
// The <embed> or <applet> is hidden.
|
// The <embed> or <applet> is hidden.
|
||||||
return PR_TRUE;
|
return PR_TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1462,10 +1462,10 @@ nsObjectFrame::IsHidden() const
|
||||||
// not to hide the <embed> once you'd put the 'hidden' attribute
|
// not to hide the <embed> once you'd put the 'hidden' attribute
|
||||||
// on the tag...
|
// on the tag...
|
||||||
// these |NS_ConvertASCIItoUCS2|s can't be |NS_LITERAL_STRING|s until |EqualsIgnoreCase| get's fixed
|
// these |NS_ConvertASCIItoUCS2|s can't be |NS_LITERAL_STRING|s until |EqualsIgnoreCase| get's fixed
|
||||||
if (hidden.Length() &&
|
if (!hidden.IsEmpty() &&
|
||||||
(Compare(hidden, NS_LITERAL_STRING("false"), nsCaseInsensitiveStringComparator()) != 0) &&
|
!hidden.Equals(NS_LITERAL_STRING("false"), nsCaseInsensitiveStringComparator()) &&
|
||||||
(Compare(hidden, NS_LITERAL_STRING("no"), nsCaseInsensitiveStringComparator()) != 0) &&
|
!hidden.Equals(NS_LITERAL_STRING("no"), nsCaseInsensitiveStringComparator()) &&
|
||||||
(Compare(hidden, NS_LITERAL_STRING("off"), nsCaseInsensitiveStringComparator()) != 0)) {
|
!hidden.Equals(NS_LITERAL_STRING("off"), nsCaseInsensitiveStringComparator())) {
|
||||||
// The <embed> or <applet> is hidden.
|
// The <embed> or <applet> is hidden.
|
||||||
return PR_TRUE;
|
return PR_TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5521,7 +5521,7 @@ nsCSSDeclaration::TryBackgroundPosition(nsAWritableString & aString,
|
||||||
AppendValueToString(eCSSProperty_background_x_position, backgroundXValue);
|
AppendValueToString(eCSSProperty_background_x_position, backgroundXValue);
|
||||||
AppendValueToString(eCSSProperty_background_y_position, backgroundYValue);
|
AppendValueToString(eCSSProperty_background_y_position, backgroundYValue);
|
||||||
aString.Append(backgroundYValue);
|
aString.Append(backgroundYValue);
|
||||||
if (Compare(backgroundXValue, backgroundYValue, nsCaseInsensitiveStringComparator())) {
|
if (!backgroundXValue.Equals(backgroundYValue, nsCaseInsensitiveStringComparator())) {
|
||||||
// the two values are different
|
// the two values are different
|
||||||
aString.Append(PRUnichar(' '));
|
aString.Append(PRUnichar(' '));
|
||||||
aString.Append(backgroundXValue);
|
aString.Append(backgroundXValue);
|
||||||
|
|
|
@ -638,9 +638,8 @@ SheetLoadData::OnStreamComplete(nsIStreamLoader* aLoader,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (mLoader->mNavQuirkMode ||
|
if (mLoader->mNavQuirkMode ||
|
||||||
Compare(contentType,
|
contentType.Equals(NS_LITERAL_CSTRING("text/css"),
|
||||||
NS_LITERAL_CSTRING("text/css"),
|
nsCaseInsensitiveCStringComparator()) ||
|
||||||
nsCaseInsensitiveCStringComparator()) == 0 ||
|
|
||||||
contentType.IsEmpty()) {
|
contentType.IsEmpty()) {
|
||||||
/*
|
/*
|
||||||
* First determine the charset (if one is indicated)
|
* 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_x_position, backgroundXValue);
|
||||||
AppendValueToString(eCSSProperty_background_y_position, backgroundYValue);
|
AppendValueToString(eCSSProperty_background_y_position, backgroundYValue);
|
||||||
aString.Append(backgroundYValue);
|
aString.Append(backgroundYValue);
|
||||||
if (Compare(backgroundXValue, backgroundYValue, nsCaseInsensitiveStringComparator())) {
|
if (!backgroundXValue.Equals(backgroundYValue, nsCaseInsensitiveStringComparator())) {
|
||||||
// the two values are different
|
// the two values are different
|
||||||
aString.Append(PRUnichar(' '));
|
aString.Append(PRUnichar(' '));
|
||||||
aString.Append(backgroundXValue);
|
aString.Append(backgroundXValue);
|
||||||
|
|
|
@ -201,9 +201,8 @@ PRBool AtomKey_base::Equals(const nsHashKey* aKey) const
|
||||||
const PRUnichar *theirStr = nsnull;
|
const PRUnichar *theirStr = nsnull;
|
||||||
theirAtom->GetUnicode(&theirStr);
|
theirAtom->GetUnicode(&theirStr);
|
||||||
|
|
||||||
return Compare(nsDependentString(myStr),
|
return nsDependentString(myStr).Equals(nsDependentString(theirStr),
|
||||||
nsDependentString(theirStr),
|
nsCaseInsensitiveStringComparator());
|
||||||
nsCaseInsensitiveStringComparator()) == 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -3352,9 +3351,8 @@ static PRBool ValueIncludes(const nsString& aValueList, const nsString& aValue,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (!Compare(nsDependentString(value),
|
if (nsDependentString(value).Equals(nsDependentString(start),
|
||||||
nsDependentString(start),
|
nsCaseInsensitiveStringComparator())) {
|
||||||
nsCaseInsensitiveStringComparator())) {
|
|
||||||
return PR_TRUE;
|
return PR_TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3648,9 +3646,9 @@ static PRBool SelectorMatches(RuleProcessorData &data,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (isCaseSensitive)
|
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
|
else
|
||||||
result = PRBool(localTrue == !Compare(Substring(value, 0, selLen), attr->mValue, nsCaseInsensitiveStringComparator()));
|
result = PRBool(localTrue == Substring(value, 0, selLen).Equals(attr->mValue, nsCaseInsensitiveStringComparator()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -3662,9 +3660,9 @@ static PRBool SelectorMatches(RuleProcessorData &data,
|
||||||
result = localFalse;
|
result = localFalse;
|
||||||
} else {
|
} else {
|
||||||
if (isCaseSensitive)
|
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
|
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;
|
break;
|
||||||
|
@ -3676,9 +3674,9 @@ static PRBool SelectorMatches(RuleProcessorData &data,
|
||||||
result = localFalse;
|
result = localFalse;
|
||||||
} else {
|
} else {
|
||||||
if (isCaseSensitive)
|
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
|
else
|
||||||
result = PRBool(localTrue == !Compare(Substring(value, 0, selLen), attr->mValue, nsCaseInsensitiveStringComparator()));
|
result = PRBool(localTrue == Substring(value, 0, selLen).Equals(attr->mValue, nsCaseInsensitiveStringComparator()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -3718,8 +3716,8 @@ static PRBool SelectorMatches(RuleProcessorData &data,
|
||||||
const PRUnichar* id2Str;
|
const PRUnichar* id2Str;
|
||||||
IDList->mAtom->GetUnicode(&id2Str);
|
IDList->mAtom->GetUnicode(&id2Str);
|
||||||
nsDependentString id2(id2Str);
|
nsDependentString id2(id2Str);
|
||||||
if (localTrue ==
|
if (localTrue !=
|
||||||
(Compare(id1, id2, nsCaseInsensitiveStringComparator()) != 0)) {
|
id1.Equals(id2, nsCaseInsensitiveStringComparator())) {
|
||||||
result = PR_FALSE;
|
result = PR_FALSE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -266,7 +266,8 @@ nsMenuBarFrame::FindMenuWithShortcut(PRUint32 aLetter)
|
||||||
if (!shortcutKey.IsEmpty()) {
|
if (!shortcutKey.IsEmpty()) {
|
||||||
// We've got something.
|
// We've got something.
|
||||||
PRUnichar letter = PRUnichar(aLetter); // throw away the high-zero-fill
|
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!
|
// We match!
|
||||||
nsCOMPtr<nsIMenuFrame> menuFrame = do_QueryInterface(currFrame);
|
nsCOMPtr<nsIMenuFrame> menuFrame = do_QueryInterface(currFrame);
|
||||||
if (menuFrame)
|
if (menuFrame)
|
||||||
|
|
|
@ -2816,15 +2816,20 @@ nsAbSync::GetTypeOfPhoneNumber(nsString tagName)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
phoneType.Cut(0, loc+1);
|
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;
|
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;
|
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;
|
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;
|
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;
|
return ABSYNC_CELL_PHONE_ID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2914,7 +2919,8 @@ nsAbSync::AddValueToNewCard(nsIAbCard *aCard, nsString *aTagName, nsString *aTag
|
||||||
PR_FREEIF(tValue);
|
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;
|
nsString tempVal;
|
||||||
tempVal.Append(*aTagName +
|
tempVal.Append(*aTagName +
|
||||||
|
|
|
@ -100,8 +100,8 @@ PRBool nsAbAutoCompleteSession::ItsADuplicate(PRUnichar* fullAddrStr, nsIAutoCom
|
||||||
rv = resultItem->GetValue(valueStr);
|
rv = resultItem->GetValue(valueStr);
|
||||||
if (NS_SUCCEEDED(rv) && !valueStr.IsEmpty())
|
if (NS_SUCCEEDED(rv) && !valueStr.IsEmpty())
|
||||||
{
|
{
|
||||||
if (Compare(nsDependentString(fullAddrStr), valueStr,
|
if (nsDependentString(fullAddrStr).Equals(valueStr,
|
||||||
nsCaseInsensitiveStringComparator())==0)
|
nsCaseInsensitiveStringComparator()))
|
||||||
return PR_TRUE;
|
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)))
|
if (!aSubstrLen || (nsCRT::strlen(aString) < NS_STATIC_CAST(PRUint32, aSubstrLen)))
|
||||||
return PR_FALSE;
|
return PR_FALSE;
|
||||||
|
|
||||||
return (Compare(Substring(aString, aString+aSubstrLen),
|
return (Substring(aString,
|
||||||
Substring(aSubstr, aSubstr+aSubstrLen),
|
aString+aSubstrLen).Equals(Substring(aSubstr, aSubstr+aSubstrLen),
|
||||||
nsCaseInsensitiveStringComparator()) == 0);
|
nsCaseInsensitiveStringComparator()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -295,46 +295,48 @@ nsAbAutoCompleteSession::CheckEntry(nsAbAutoCompleteSearchString* searchStr,
|
||||||
fullStringLen = searchStr->mFullStringLen;
|
fullStringLen = searchStr->mFullStringLen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nsDependentString fullStringStr(fullString, fullStringLen);
|
||||||
|
|
||||||
// First check for a Nickname exact match
|
// First check for a Nickname exact match
|
||||||
if (nickName && Compare(nsDependentString(fullString),
|
if (nickName &&
|
||||||
nsDependentString(nickName),
|
fullStringStr.Equals(nsDependentString(nickName),
|
||||||
nsCaseInsensitiveStringComparator()) == 0)
|
nsCaseInsensitiveStringComparator()))
|
||||||
{
|
{
|
||||||
*matchType = NICKNAME_EXACT_MATCH;
|
*matchType = NICKNAME_EXACT_MATCH;
|
||||||
return PR_TRUE;
|
return PR_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Then check for a display Name exact match
|
// Then check for a display Name exact match
|
||||||
if (displayName && Compare(nsDependentString(fullString),
|
if (displayName &&
|
||||||
nsDependentString(displayName),
|
fullStringStr.Equals(nsDependentString(displayName),
|
||||||
nsCaseInsensitiveStringComparator()) == 0)
|
nsCaseInsensitiveStringComparator()))
|
||||||
{
|
{
|
||||||
*matchType = NAME_EXACT_MATCH;
|
*matchType = NAME_EXACT_MATCH;
|
||||||
return PR_TRUE;
|
return PR_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Then check for a fisrt Name exact match
|
// Then check for a fisrt Name exact match
|
||||||
if (firstName && Compare(nsDependentString(fullString),
|
if (firstName &&
|
||||||
nsDependentString(firstName),
|
fullStringStr.Equals(nsDependentString(firstName),
|
||||||
nsCaseInsensitiveStringComparator()) == 0)
|
nsCaseInsensitiveStringComparator()))
|
||||||
{
|
{
|
||||||
*matchType = NAME_EXACT_MATCH;
|
*matchType = NAME_EXACT_MATCH;
|
||||||
return PR_TRUE;
|
return PR_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Then check for a last Name exact match
|
// Then check for a last Name exact match
|
||||||
if (lastName && Compare(nsDependentString(fullString),
|
if (lastName &&
|
||||||
nsDependentString(lastName),
|
fullStringStr.Equals(nsDependentString(lastName),
|
||||||
nsCaseInsensitiveStringComparator()) == 0)
|
nsCaseInsensitiveStringComparator()))
|
||||||
{
|
{
|
||||||
*matchType = NAME_EXACT_MATCH;
|
*matchType = NAME_EXACT_MATCH;
|
||||||
return PR_TRUE;
|
return PR_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Then check for a Email exact match
|
// Then check for a Email exact match
|
||||||
if (emailAddress && Compare(nsDependentString(fullString),
|
if (emailAddress &&
|
||||||
nsDependentString(emailAddress),
|
fullStringStr.Equals(nsDependentString(emailAddress),
|
||||||
nsCaseInsensitiveStringComparator()) == 0)
|
nsCaseInsensitiveStringComparator()))
|
||||||
{
|
{
|
||||||
*matchType = EMAIL_EXACT_MATCH;
|
*matchType = EMAIL_EXACT_MATCH;
|
||||||
return PR_TRUE;
|
return PR_TRUE;
|
||||||
|
|
|
@ -1037,7 +1037,9 @@ PRBool PR_CALLBACK nsMsgAccountManager::cleanupOnExit(nsHashKey *aKey, void *aDa
|
||||||
nsCOMPtr<nsIMsgFolder>inboxFolder = do_QueryInterface(aSupport);
|
nsCOMPtr<nsIMsgFolder>inboxFolder = do_QueryInterface(aSupport);
|
||||||
nsXPIDLString folderName;
|
nsXPIDLString folderName;
|
||||||
inboxFolder->GetName(getter_Copies(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 */);
|
rv1 = inboxFolder->Compact(urlListener, nsnull /* msgwindow */);
|
||||||
if (NS_SUCCEEDED(rv1))
|
if (NS_SUCCEEDED(rv1))
|
||||||
|
|
|
@ -937,8 +937,9 @@ NS_IMETHODIMP nsMsgFolder::GetChildNamed(const char *name, nsISupports ** aChild
|
||||||
|
|
||||||
rv = folder->GetName(getter_Copies(folderName));
|
rv = folder->GetName(getter_Copies(folderName));
|
||||||
// case-insensitive compare is probably LCD across OS filesystems
|
// case-insensitive compare is probably LCD across OS filesystems
|
||||||
if (NS_SUCCEEDED(rv) && Compare(folderName, uniName,
|
if (NS_SUCCEEDED(rv) &&
|
||||||
nsCaseInsensitiveStringComparator()) == 0)
|
folderName.Equals(uniName,
|
||||||
|
nsCaseInsensitiveStringComparator()))
|
||||||
{
|
{
|
||||||
*aChild = folder;
|
*aChild = folder;
|
||||||
NS_ADDREF(*aChild);
|
NS_ADDREF(*aChild);
|
||||||
|
|
|
@ -438,7 +438,8 @@ PRBool nsMsgI18Nmultibyte_charset(const char *charset)
|
||||||
if (NS_SUCCEEDED(res)) {
|
if (NS_SUCCEEDED(res)) {
|
||||||
res = ccm2->GetCharsetData2(charsetAtom, NS_LITERAL_STRING(".isMultibyte").get(), &charsetData);
|
res = ccm2->GetCharsetData2(charsetAtom, NS_LITERAL_STRING(".isMultibyte").get(), &charsetData);
|
||||||
if (NS_SUCCEEDED(res)) {
|
if (NS_SUCCEEDED(res)) {
|
||||||
result = !Compare(charsetData, NS_LITERAL_STRING("true"), nsCaseInsensitiveStringComparator());
|
result = charsetData.Equals(NS_LITERAL_STRING("true"),
|
||||||
|
nsCaseInsensitiveStringComparator());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2328,9 +2328,8 @@ nsresult nsMsgComposeSendListener::OnStopSending(const char *aMsgID, nsresult aS
|
||||||
{
|
{
|
||||||
if (!fieldsFCC.IsEmpty())
|
if (!fieldsFCC.IsEmpty())
|
||||||
{
|
{
|
||||||
if (Compare(nsDependentString(fieldsFCC),
|
if (fieldsFCC.Equals(NS_LITERAL_STRING("nocopy://"),
|
||||||
NS_LITERAL_STRING("nocopy://"),
|
nsCaseInsensitiveStringComparator()))
|
||||||
nsCaseInsensitiveStringComparator()) == 0)
|
|
||||||
{
|
{
|
||||||
compose->NotifyStateListeners(eComposeProcessDone, NS_OK);
|
compose->NotifyStateListeners(eComposeProcessDone, NS_OK);
|
||||||
if (progress)
|
if (progress)
|
||||||
|
@ -3805,7 +3804,8 @@ nsresult nsMsgCompose::TagConvertible(nsIDOMNode *node, PRInt32 *_retval)
|
||||||
if (NS_SUCCEEDED(pItem->GetNodeValue(typeValue)))
|
if (NS_SUCCEEDED(pItem->GetNodeValue(typeValue)))
|
||||||
{
|
{
|
||||||
typeValue.StripChars("\"");
|
typeValue.StripChars("\"");
|
||||||
if (!Compare(typeValue, NS_LITERAL_STRING("cite"), nsCaseInsensitiveStringComparator()))
|
if (typeValue.Equals(NS_LITERAL_STRING("cite"),
|
||||||
|
nsCaseInsensitiveStringComparator()))
|
||||||
*_retval = nsIMsgCompConvertible::Plain;
|
*_retval = nsIMsgCompConvertible::Plain;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1680,7 +1680,8 @@ nsMsgComposeAndSend::ProcessMultipartRelated(PRInt32 *aMailboxCount, PRInt32 *aN
|
||||||
nsAutoString attributeValue;
|
nsAutoString attributeValue;
|
||||||
if (NS_SUCCEEDED(domElement->GetAttribute(NS_LITERAL_STRING("moz-do-not-send"), 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;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -710,12 +710,12 @@ NS_IMETHODIMP nsImapMailFolder::CreateSubfolder(const PRUnichar* folderName, nsI
|
||||||
nsresult rv = NS_ERROR_NULL_POINTER;
|
nsresult rv = NS_ERROR_NULL_POINTER;
|
||||||
if (!folderName) return rv;
|
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);
|
AlertSpecialFolderExists(msgWindow);
|
||||||
return NS_MSG_FOLDER_EXISTS;
|
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);
|
AlertSpecialFolderExists(msgWindow);
|
||||||
return NS_MSG_FOLDER_EXISTS;
|
return NS_MSG_FOLDER_EXISTS;
|
||||||
|
@ -3882,9 +3882,8 @@ PRBool nsImapMailFolder::ShowDeletedMessages()
|
||||||
{
|
{
|
||||||
nsXPIDLString folderName;
|
nsXPIDLString folderName;
|
||||||
GetName(getter_Copies(folderName));
|
GetName(getter_Copies(folderName));
|
||||||
if (!Compare(Substring(folderName,0,convertedName.Length()),
|
if (Substring(folderName,0,convertedName.Length()).Equals(convertedName,
|
||||||
convertedName,
|
nsCaseInsensitiveStringComparator()))
|
||||||
nsCaseInsensitiveStringComparator()))
|
|
||||||
showDeleted = PR_TRUE;
|
showDeleted = PR_TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -504,7 +504,7 @@ void nsEudoraCompose::ExtractType( nsString& str)
|
||||||
// valid multipart!
|
// valid multipart!
|
||||||
if (str.Length() > 10) {
|
if (str.Length() > 10) {
|
||||||
str.Left( tStr, 10);
|
str.Left( tStr, 10);
|
||||||
if (!Compare(tStr, NS_LITERAL_STRING("multipart/"), nsCaseInsensitiveStringComparator()))
|
if (tStr.Equals(NS_LITERAL_STRING("multipart/"), nsCaseInsensitiveStringComparator()))
|
||||||
str.Truncate();
|
str.Truncate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1030,7 +1030,7 @@ PRBool nsEudoraMac::IsValidMailboxName( nsCString& fName)
|
||||||
{
|
{
|
||||||
if (m_depth > 1)
|
if (m_depth > 1)
|
||||||
return( PR_TRUE);
|
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_FALSE);
|
||||||
return( PR_TRUE);
|
return( PR_TRUE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -694,7 +694,7 @@ void nsEudoraWin32::GetAccountName( const char *pSection, nsString& str)
|
||||||
|
|
||||||
nsCString s(pSection);
|
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.Assign(NS_LITERAL_STRING("Eudora "));
|
||||||
str.AppendWithConversion( pSection);
|
str.AppendWithConversion( pSection);
|
||||||
}
|
}
|
||||||
|
@ -703,7 +703,7 @@ void nsEudoraWin32::GetAccountName( const char *pSection, nsString& str)
|
||||||
str.AssignWithConversion(pSection);
|
str.AssignWithConversion(pSection);
|
||||||
if (s.Length() > 8) {
|
if (s.Length() > 8) {
|
||||||
s.Left( tStr, 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);
|
s.Right( tStr, s.Length() - 8);
|
||||||
str.AssignWithConversion(tStr.get());
|
str.AssignWithConversion(tStr.get());
|
||||||
}
|
}
|
||||||
|
@ -1378,9 +1378,8 @@ nsresult nsEudoraWin32::FoundAddressBook( nsIFileSpec *spec, const PRUnichar *pN
|
||||||
nsCRT::free( pLeaf);
|
nsCRT::free( pLeaf);
|
||||||
nsString tStr;
|
nsString tStr;
|
||||||
name.Right( tStr, 4);
|
name.Right( tStr, 4);
|
||||||
if (! Compare(tStr,
|
if (tStr.Equals(NS_LITERAL_STRING(".txt"),
|
||||||
NS_LITERAL_STRING(".txt"),
|
nsCaseInsensitiveStringComparator())) {
|
||||||
nsCaseInsensitiveStringComparator())) {
|
|
||||||
name.Left( tStr, name.Length() - 4);
|
name.Left( tStr, name.Length() - 4);
|
||||||
name = tStr;
|
name = tStr;
|
||||||
}
|
}
|
||||||
|
|
|
@ -293,7 +293,7 @@ PRBool nsOEScanBoxes::FindMailBoxes( nsIFileSpec* descFile)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
pEntry->fileName.Right( ext, 4);
|
pEntry->fileName.Right( ext, 4);
|
||||||
if (Compare(ext, mbxExt))
|
if (!ext.Equals(mbxExt))
|
||||||
pEntry->fileName.Append( ".mbx");
|
pEntry->fileName.Append( ".mbx");
|
||||||
|
|
||||||
m_entryArray.AppendElement( pEntry);
|
m_entryArray.AppendElement( pEntry);
|
||||||
|
|
|
@ -306,24 +306,25 @@ CGetStoreFoldersIter::CGetStoreFoldersIter( CMapiApi *pApi, CMapiFolderList& fol
|
||||||
BOOL CGetStoreFoldersIter::ExcludeFolderClass( const PRUnichar *pName)
|
BOOL CGetStoreFoldersIter::ExcludeFolderClass( const PRUnichar *pName)
|
||||||
{
|
{
|
||||||
BOOL bResult;
|
BOOL bResult;
|
||||||
|
nsDependentString pNameStr(pName);
|
||||||
if (m_isMail) {
|
if (m_isMail) {
|
||||||
bResult = FALSE;
|
bResult = FALSE;
|
||||||
if (!Compare(nsDependentString(pName), NS_LITERAL_STRING("IPF.Appointment")))
|
if (pNameStr.Equals(NS_LITERAL_STRING("IPF.Appointment")))
|
||||||
bResult = TRUE;
|
bResult = TRUE;
|
||||||
else if (!Compare(nsDependentString(pName), NS_LITERAL_STRING("IPF.Contact")))
|
else if (pNameStr.Equals(NS_LITERAL_STRING("IPF.Contact")))
|
||||||
bResult = TRUE;
|
bResult = TRUE;
|
||||||
else if (!Compare(nsDependentString(pName), NS_LITERAL_STRING("IPF.Journal")))
|
else if (pNameStr.Equals(NS_LITERAL_STRING("IPF.Journal")))
|
||||||
bResult = TRUE;
|
bResult = TRUE;
|
||||||
else if (!Compare(nsDependentString(pName), NS_LITERAL_STRING("IPF.StickyNote")))
|
else if (pNameStr.Equals(NS_LITERAL_STRING("IPF.StickyNote")))
|
||||||
bResult = TRUE;
|
bResult = TRUE;
|
||||||
else if (!Compare(nsDependentString(pName), NS_LITERAL_STRING("IPF.Task")))
|
else if (pNameStr.Equals(NS_LITERAL_STRING("IPF.Task")))
|
||||||
bResult = TRUE;
|
bResult = TRUE;
|
||||||
// else if (!stricmp( pName, "IPF.Note"))
|
// else if (!stricmp( pName, "IPF.Note"))
|
||||||
// bResult = TRUE;
|
// bResult = TRUE;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
bResult = TRUE;
|
bResult = TRUE;
|
||||||
if (!Compare( nsDependentString(pName), NS_LITERAL_STRING("IPF.Contact")))
|
if (pNameStr.Equals(NS_LITERAL_STRING("IPF.Contact")))
|
||||||
bResult = FALSE;
|
bResult = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -799,8 +799,8 @@ nsMsgLocalMailFolder::CheckIfFolderExists(const PRUnichar *folderName, nsFileSpe
|
||||||
PR_FREEIF(leaf);
|
PR_FREEIF(leaf);
|
||||||
|
|
||||||
if (!leafName.IsEmpty() &&
|
if (!leafName.IsEmpty() &&
|
||||||
Compare(nsDependentString(folderName), leafName,
|
leafName.Equals(nsDependentString(folderName),
|
||||||
nsCaseInsensitiveStringComparator()) == 0)
|
nsCaseInsensitiveStringComparator()))
|
||||||
{
|
{
|
||||||
if (msgWindow)
|
if (msgWindow)
|
||||||
AlertFolderExists(msgWindow);
|
AlertFolderExists(msgWindow);
|
||||||
|
|
|
@ -723,7 +723,8 @@ nsJAR::ParseOneFile(nsISignatureVerifier* verifier,
|
||||||
|
|
||||||
//-- Lines to look for:
|
//-- Lines to look for:
|
||||||
// (1) Digest:
|
// (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
|
//-- This is a digest line, save the data in the appropriate place
|
||||||
{
|
{
|
||||||
if(aFileType == JAR_MF)
|
if(aFileType == JAR_MF)
|
||||||
|
@ -739,7 +740,8 @@ nsJAR::ParseOneFile(nsISignatureVerifier* verifier,
|
||||||
}
|
}
|
||||||
|
|
||||||
// (2) Name: associates this manifest section with a file in the jar.
|
// (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;
|
curItemName = lineData;
|
||||||
foundName = PR_TRUE;
|
foundName = PR_TRUE;
|
||||||
|
@ -749,9 +751,11 @@ nsJAR::ParseOneFile(nsISignatureVerifier* verifier,
|
||||||
// (3) Magic: this may be an inline Javascript.
|
// (3) Magic: this may be an inline Javascript.
|
||||||
// We can't do any other kind of magic.
|
// We can't do any other kind of magic.
|
||||||
if ( aFileType == JAR_MF &&
|
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;
|
curItemMF->mType = JAR_EXTERNAL;
|
||||||
else
|
else
|
||||||
curItemMF->mType = JAR_INVALID;
|
curItemMF->mType = JAR_INVALID;
|
||||||
|
|
|
@ -591,7 +591,7 @@ nsCacheEntryHashTable::MatchEntry(PLDHashTable * /* table */,
|
||||||
NS_ASSERTION(key != nsnull, "### nsCacheEntryHashTable::MatchEntry : null key");
|
NS_ASSERTION(key != nsnull, "### nsCacheEntryHashTable::MatchEntry : null key");
|
||||||
nsCacheEntry *cacheEntry = ((nsCacheEntryHashTableEntry *)hashEntry)->cacheEntry;
|
nsCacheEntry *cacheEntry = ((nsCacheEntryHashTableEntry *)hashEntry)->cacheEntry;
|
||||||
|
|
||||||
return Compare(*cacheEntry->mKey, *(nsCString *)key) == 0;
|
return cacheEntry->mKey->Equals(*(nsCString *)key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2125,7 +2125,7 @@ nsFtpState::SendFTPCommand(nsCString& command)
|
||||||
|
|
||||||
// we don't want to log the password:
|
// we don't want to log the password:
|
||||||
nsCAutoString logcmd(command);
|
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";
|
logcmd = "PASS xxxxx";
|
||||||
|
|
||||||
PR_LOG(gFTPLog, PR_LOG_DEBUG, ("(%x)(dwait=%d) Writing \"%s\"\n", this, mWaitingForDConn, logcmd.get()));
|
PR_LOG(gFTPLog, PR_LOG_DEBUG, ("(%x)(dwait=%d) Writing \"%s\"\n", this, mWaitingForDConn, logcmd.get()));
|
||||||
|
|
|
@ -542,11 +542,10 @@ mozTXTToHTMLConv::ItMatchesDelimited(const PRUnichar * aInString,
|
||||||
nsCRT::IsAsciiDigit(textAfterPos) ||
|
nsCRT::IsAsciiDigit(textAfterPos) ||
|
||||||
textAfterPos == *rep
|
textAfterPos == *rep
|
||||||
) ||
|
) ||
|
||||||
Compare(Substring(nsDependentString(aInString, aInLength),
|
!Substring(nsDependentString(aInString, aInLength),
|
||||||
(before == LT_IGNORE ? 0 : 1),
|
(before == LT_IGNORE ? 0 : 1),
|
||||||
aRepLen),
|
aRepLen).Equals(nsDependentString(rep, aRepLen),
|
||||||
nsDependentString(rep, aRepLen),
|
nsCaseInsensitiveStringComparator())
|
||||||
nsCaseInsensitiveStringComparator())
|
|
||||||
)
|
)
|
||||||
return PR_FALSE;
|
return PR_FALSE;
|
||||||
|
|
||||||
|
@ -978,8 +977,9 @@ mozTXTToHTMLConv::CiteLevelTXT(const PRUnichar *line,
|
||||||
const PRUnichar * indexString = &line[logLineStart];
|
const PRUnichar * indexString = &line[logLineStart];
|
||||||
// here, |logLineStart < lineLength| is always true
|
// here, |logLineStart < lineLength| is always true
|
||||||
PRUint32 minlength = MinInt(6,nsCRT::strlen(indexString));
|
PRUint32 minlength = MinInt(6,nsCRT::strlen(indexString));
|
||||||
if (!Compare(Substring(indexString, indexString+minlength),
|
if (Substring(indexString,
|
||||||
Substring(NS_LITERAL_STRING(">From "), 0, minlength), nsCaseInsensitiveStringComparator()))
|
indexString+minlength).Equals(Substring(NS_LITERAL_STRING(">From "), 0, minlength),
|
||||||
|
nsCaseInsensitiveStringComparator()))
|
||||||
//XXX RFC2646
|
//XXX RFC2646
|
||||||
moreCites = PR_FALSE;
|
moreCites = PR_FALSE;
|
||||||
else
|
else
|
||||||
|
|
|
@ -304,8 +304,10 @@ void nsUnknownDecoder::DetermineContentType(nsIRequest* request)
|
||||||
//
|
//
|
||||||
// If the buffer begins with a mailbox delimiter then it is not HTML
|
// 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()) ||
|
else if (Substring(str, 0, 5).Equals(NS_LITERAL_CSTRING("From "),
|
||||||
!Compare(Substring(str, 0, 6), NS_LITERAL_CSTRING(">From "), nsCaseInsensitiveCStringComparator())) {
|
nsCaseInsensitiveCStringComparator()) ||
|
||||||
|
Substring(str, 0, 6).Equals(NS_LITERAL_CSTRING(">From "),
|
||||||
|
nsCaseInsensitiveCStringComparator())) {
|
||||||
mContentType = TEXT_PLAIN;
|
mContentType = TEXT_PLAIN;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
|
|
|
@ -1013,12 +1013,12 @@ nsresult CNavDTD::DidHandleStartTag(nsIParserNode& aNode,eHTMLTags aChildTag){
|
||||||
if(theCount) {
|
if(theCount) {
|
||||||
PRInt32 theIndex=0;
|
PRInt32 theIndex=0;
|
||||||
for(theIndex=0;theIndex<theCount;theIndex++){
|
for(theIndex=0;theIndex<theCount;theIndex++){
|
||||||
nsAutoString theKey(aNode.GetKeyAt(theIndex));
|
const nsAString& theKey = aNode.GetKeyAt(theIndex);
|
||||||
if(!Compare(theKey, NS_LITERAL_STRING("ENTITY"), nsCaseInsensitiveStringComparator())) {
|
if(theKey.Equals(NS_LITERAL_STRING("ENTITY"), nsCaseInsensitiveStringComparator())) {
|
||||||
const nsString& theName=aNode.GetValueAt(theIndex);
|
const nsString& theName=aNode.GetValueAt(theIndex);
|
||||||
theNamePtr=&theName;
|
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...
|
//store the named enity with the context...
|
||||||
const nsString& theValue=aNode.GetValueAt(theIndex);
|
const nsString& theValue=aNode.GetValueAt(theIndex);
|
||||||
theValuePtr=&theValue;
|
theValuePtr=&theValue;
|
||||||
|
|
|
@ -588,12 +588,12 @@ nsresult COtherDTD::DidHandleStartTag(nsIParserNode& aNode,eHTMLTags aChildTag){
|
||||||
if(theCount) {
|
if(theCount) {
|
||||||
PRInt32 theIndex=0;
|
PRInt32 theIndex=0;
|
||||||
for(theIndex=0;theIndex<theCount;theIndex++){
|
for(theIndex=0;theIndex<theCount;theIndex++){
|
||||||
nsAutoString theKey(aNode.GetKeyAt(theIndex));
|
const nsAString& theKey = aNode.GetKeyAt(theIndex);
|
||||||
if(!Compare(theKey, NS_LITERAL_STRING("ENTITY"), nsCaseInsensitiveStringComparator())) {
|
if(theKey.Equals(NS_LITERAL_STRING("ENTITY"), nsCaseInsensitiveStringComparator())) {
|
||||||
const nsString& theName=aNode.GetValueAt(theIndex);
|
const nsString& theName=aNode.GetValueAt(theIndex);
|
||||||
theNamePtr=&theName;
|
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...
|
//store the named enity with the context...
|
||||||
const nsString& theValue=aNode.GetValueAt(theIndex);
|
const nsString& theValue=aNode.GetValueAt(theIndex);
|
||||||
theValuePtr=&theValue;
|
theValuePtr=&theValue;
|
||||||
|
|
|
@ -842,10 +842,10 @@ PRInt32 nsDTDContext::IncrementCounter(eHTMLTags aTag,nsIParserNode& aNode,nsStr
|
||||||
CAbacus::eNumFormat theNumFormat=CAbacus::eDecimal;
|
CAbacus::eNumFormat theNumFormat=CAbacus::eDecimal;
|
||||||
|
|
||||||
for(theIndex=0;theIndex<theCount;theIndex++){
|
for(theIndex=0;theIndex<theCount;theIndex++){
|
||||||
nsAutoString theKey(aNode.GetKeyAt(theIndex));
|
const nsAString& theKey=aNode.GetKeyAt(theIndex);
|
||||||
const nsString& theValue=aNode.GetValueAt(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);
|
theEntity=GetEntity(theValue);
|
||||||
if(!theEntity) {
|
if(!theEntity) {
|
||||||
theEntity=RegisterEntity(theValue,theValue);
|
theEntity=RegisterEntity(theValue,theValue);
|
||||||
|
@ -853,10 +853,10 @@ PRInt32 nsDTDContext::IncrementCounter(eHTMLTags aTag,nsIParserNode& aNode,nsStr
|
||||||
}
|
}
|
||||||
aTag=eHTMLTag_userdefined;
|
aTag=eHTMLTag_userdefined;
|
||||||
}
|
}
|
||||||
else if(!Compare(theKey, NS_LITERAL_STRING("noincr"), nsCaseInsensitiveStringComparator())){
|
else if(theKey.Equals(NS_LITERAL_STRING("noincr"), nsCaseInsensitiveStringComparator())){
|
||||||
theIncrValue=0;
|
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);
|
PRUnichar theChar=theValue.CharAt(0);
|
||||||
if('"'==theChar)
|
if('"'==theChar)
|
||||||
theChar=theValue.CharAt(1);
|
theChar=theValue.CharAt(1);
|
||||||
|
@ -873,7 +873,7 @@ PRInt32 nsDTDContext::IncrementCounter(eHTMLTags aTag,nsIParserNode& aNode,nsStr
|
||||||
}
|
}
|
||||||
//determine numbering style
|
//determine numbering style
|
||||||
}
|
}
|
||||||
else if(!Compare(theKey, NS_LITERAL_STRING("value"), nsCaseInsensitiveStringComparator())){
|
else if(theKey.Equals(NS_LITERAL_STRING("value"), nsCaseInsensitiveStringComparator())){
|
||||||
PRInt32 err=0;
|
PRInt32 err=0;
|
||||||
theNewValue=theValue.ToInteger(&err);
|
theNewValue=theValue.ToInteger(&err);
|
||||||
if(!err) {
|
if(!err) {
|
||||||
|
|
|
@ -413,7 +413,7 @@ void nsHTMLContentSinkStream::WriteAttributes(const nsIParserNode& aNode)
|
||||||
if(theCount) {
|
if(theCount) {
|
||||||
int i=0;
|
int i=0;
|
||||||
for(i=0;i<theCount;i++){
|
for(i=0;i<theCount;i++){
|
||||||
nsAutoString key(aNode.GetKeyAt(i));
|
const nsAString& key = aNode.GetKeyAt(i);
|
||||||
|
|
||||||
// See if there's an attribute:
|
// See if there's an attribute:
|
||||||
// note that we copy here, because we're going to have to trim quotes.
|
// note that we copy here, because we're going to have to trim quotes.
|
||||||
|
@ -423,7 +423,7 @@ void nsHTMLContentSinkStream::WriteAttributes(const nsIParserNode& aNode)
|
||||||
value.Trim("\"", PR_TRUE, PR_TRUE);
|
value.Trim("\"", PR_TRUE, PR_TRUE);
|
||||||
|
|
||||||
// Filter out any attribute starting with _moz
|
// Filter out any attribute starting with _moz
|
||||||
if (!Compare(key, NS_LITERAL_STRING("_moz"), nsCaseInsensitiveStringComparator())
|
if (key.Equals(NS_LITERAL_STRING("_moz"), nsCaseInsensitiveStringComparator()))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -437,8 +437,8 @@ void nsHTMLContentSinkStream::WriteAttributes(const nsIParserNode& aNode)
|
||||||
// used by the editor. Bug 16988. Yuck.
|
// used by the editor. Bug 16988. Yuck.
|
||||||
//
|
//
|
||||||
if ((eHTMLTags)aNode.GetNodeType() == eHTMLTag_br
|
if ((eHTMLTags)aNode.GetNodeType() == eHTMLTag_br
|
||||||
&& (!Compare((key, NS_LITERAL_STRING("type"), nsCaseInsensitiveStringComparator())
|
&& key.Equals(NS_LITERAL_STRING("type"), nsCaseInsensitiveStringComparator())
|
||||||
&& value.Equals(NS_LITERAL_STRING("_moz")))))
|
&& value.Equals(NS_LITERAL_STRING("_moz")))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (mLowerCaseTags == PR_TRUE)
|
if (mLowerCaseTags == PR_TRUE)
|
||||||
|
@ -456,8 +456,8 @@ void nsHTMLContentSinkStream::WriteAttributes(const nsIParserNode& aNode)
|
||||||
|
|
||||||
// Make all links absolute when converting only the selection:
|
// Make all links absolute when converting only the selection:
|
||||||
if ((mFlags & nsIDocumentEncoder::OutputAbsoluteLinks)
|
if ((mFlags & nsIDocumentEncoder::OutputAbsoluteLinks)
|
||||||
&& (!Compare(key, NS_LITERAL_STRING("href"), nsCaseInsensitiveStringComparator())
|
&& (key.Equals(NS_LITERAL_STRING("href"), nsCaseInsensitiveStringComparator())
|
||||||
|| !Compare(key, NS_LITERAL_STRING("src"), nsCaseInsensitiveStringComparator())
|
|| key.Equals(NS_LITERAL_STRING("src"), nsCaseInsensitiveStringComparator())
|
||||||
// Would be nice to handle OBJECT and APPLET tags,
|
// Would be nice to handle OBJECT and APPLET tags,
|
||||||
// but that gets more complicated since we have to
|
// but that gets more complicated since we have to
|
||||||
// search the tag list for CODEBASE as well.
|
// search the tag list for CODEBASE as well.
|
||||||
|
|
|
@ -1203,7 +1203,7 @@ NS_IMETHODIMP CViewSourceHTML::HandleToken(CToken* aToken,nsIParser* aParser) {
|
||||||
{
|
{
|
||||||
nsAutoString theStr;
|
nsAutoString theStr;
|
||||||
theStr.Assign(aToken->GetStringValue());
|
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);
|
PRUnichar theChar=theStr.CharAt(0);
|
||||||
if((nsCRT::IsAsciiDigit(theChar)) || ('X'==theChar) || ('x'==theChar)){
|
if((nsCRT::IsAsciiDigit(theChar)) || ('X'==theChar) || ('x'==theChar)){
|
||||||
theStr.Assign(NS_LITERAL_STRING("#") + theStr);
|
theStr.Assign(NS_LITERAL_STRING("#") + theStr);
|
||||||
|
|
|
@ -92,8 +92,8 @@ rdf_RequiresAbsoluteURI(const nsString& uri)
|
||||||
// cheap shot at figuring out if this requires an absolute url translation
|
// cheap shot at figuring out if this requires an absolute url translation
|
||||||
if (Substring(uri, 0, 4).Equals(NS_LITERAL_STRING("urn:")) ||
|
if (Substring(uri, 0, 4).Equals(NS_LITERAL_STRING("urn:")) ||
|
||||||
Substring(uri, 0, 9).Equals(NS_LITERAL_STRING("chrome:")) ||
|
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())) {
|
nsCaseInsensitiveStringComparator())) {
|
||||||
return PR_FALSE;
|
return PR_FALSE;
|
||||||
}
|
}
|
||||||
return PR_TRUE;
|
return PR_TRUE;
|
||||||
|
|
|
@ -1705,9 +1705,8 @@ nsresult nsExternalHelperAppService::GetMIMEInfoForExtensionFromExtras(const cha
|
||||||
while (start != end)
|
while (start != end)
|
||||||
{
|
{
|
||||||
FindCharInReadable(',', iter, end);
|
FindCharInReadable(',', iter, end);
|
||||||
if (Compare(Substring(start, iter),
|
if (Substring(start, iter).Equals(extension,
|
||||||
extension,
|
nsCaseInsensitiveCStringComparator()))
|
||||||
nsCaseInsensitiveCStringComparator()) == 0)
|
|
||||||
{
|
{
|
||||||
// This is the one. Create MIMEInfo object and set
|
// This is the one. Create MIMEInfo object and set
|
||||||
// attributes appropriately.
|
// attributes appropriately.
|
||||||
|
|
|
@ -442,9 +442,8 @@ GetTypeAndDescriptionFromMimetypesFile(const nsAString& aFilename,
|
||||||
|
|
||||||
while (start != end) {
|
while (start != end) {
|
||||||
FindCharInReadable(',', iter, end);
|
FindCharInReadable(',', iter, end);
|
||||||
if (Compare(Substring(start, iter),
|
if (Substring(start, iter).Equals(aFileExtension,
|
||||||
aFileExtension,
|
nsCaseInsensitiveStringComparator())) {
|
||||||
nsCaseInsensitiveStringComparator()) == 0) {
|
|
||||||
// it's a match. Assign the type and description and run
|
// it's a match. Assign the type and description and run
|
||||||
aMajorType.Assign(Substring(majorTypeStart, majorTypeEnd));
|
aMajorType.Assign(Substring(majorTypeStart, majorTypeEnd));
|
||||||
aMinorType.Assign(Substring(minorTypeStart, minorTypeEnd));
|
aMinorType.Assign(Substring(minorTypeStart, minorTypeEnd));
|
||||||
|
@ -574,12 +573,12 @@ GetExtensionsAndDescriptionFromMimetypesFile(const nsAString& aFilename,
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (NS_SUCCEEDED(rv) &&
|
if (NS_SUCCEEDED(rv) &&
|
||||||
Compare(Substring(majorTypeStart, majorTypeEnd),
|
Substring(majorTypeStart,
|
||||||
aMajorType,
|
majorTypeEnd).Equals(aMajorType,
|
||||||
nsCaseInsensitiveStringComparator()) == 0 &&
|
nsCaseInsensitiveStringComparator())&&
|
||||||
Compare(Substring(minorTypeStart, minorTypeEnd),
|
Substring(minorTypeStart,
|
||||||
aMinorType,
|
minorTypeEnd).Equals(aMinorType,
|
||||||
nsCaseInsensitiveStringComparator()) == 0) {
|
nsCaseInsensitiveStringComparator())) {
|
||||||
// it's a match
|
// it's a match
|
||||||
aFileExtensions.Assign(extensions);
|
aFileExtensions.Assign(extensions);
|
||||||
aDescription.Assign(Substring(descriptionStart, descriptionEnd));
|
aDescription.Assign(Substring(descriptionStart, descriptionEnd));
|
||||||
|
@ -948,13 +947,14 @@ GetHandlerAndDescriptionFromMailcapFile(const nsAString& aFilename,
|
||||||
rv = ParseMIMEType(start_iter, majorTypeStart, majorTypeEnd,
|
rv = ParseMIMEType(start_iter, majorTypeStart, majorTypeEnd,
|
||||||
minorTypeStart, minorTypeEnd, semicolon_iter);
|
minorTypeStart, minorTypeEnd, semicolon_iter);
|
||||||
if (NS_SUCCEEDED(rv) &&
|
if (NS_SUCCEEDED(rv) &&
|
||||||
Compare(Substring(majorTypeStart, majorTypeEnd),
|
Substring(majorTypeStart,
|
||||||
aMajorType,
|
majorTypeEnd).Equals(aMajorType,
|
||||||
nsCaseInsensitiveStringComparator()) == 0 &&
|
nsCaseInsensitiveStringComparator()) &&
|
||||||
(Substring(minorTypeStart, minorTypeEnd).Equals(NS_LITERAL_STRING("*")) ||
|
(Substring(minorTypeStart,
|
||||||
Compare(Substring(minorTypeStart, minorTypeEnd),
|
minorTypeEnd).Equals(NS_LITERAL_STRING("*")) ||
|
||||||
aMinorType,
|
Substring(minorTypeStart,
|
||||||
nsCaseInsensitiveStringComparator()) == 0)) { // we have a match
|
minorTypeEnd).Equals(aMinorType,
|
||||||
|
nsCaseInsensitiveStringComparator()))) { // we have a match
|
||||||
PRBool match = PR_TRUE;
|
PRBool match = PR_TRUE;
|
||||||
++semicolon_iter; // point at the first char past the semicolon
|
++semicolon_iter; // point at the first char past the semicolon
|
||||||
start_iter = semicolon_iter; // handler string starts here
|
start_iter = semicolon_iter; // handler string starts here
|
||||||
|
|
|
@ -931,27 +931,22 @@ BookmarkParser::Unescape(nsString &text)
|
||||||
|
|
||||||
while((offset = text.FindChar((PRUnichar('&')), offset)) >= 0)
|
while((offset = text.FindChar((PRUnichar('&')), offset)) >= 0)
|
||||||
{
|
{
|
||||||
// XXX get max of 6 chars; change the value below if
|
if (Substring(text, offset, 4).Equals(NS_LITERAL_STRING("<"), nsCaseInsensitiveStringComparator()))
|
||||||
// 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)
|
|
||||||
{
|
{
|
||||||
text.Cut(offset, 4);
|
text.Cut(offset, 4);
|
||||||
text.Insert(PRUnichar('<'), offset);
|
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.Cut(offset, 4);
|
||||||
text.Insert(PRUnichar('>'), offset);
|
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.Cut(offset, 5);
|
||||||
text.Insert(PRUnichar('&'), offset);
|
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.Cut(offset, 6);
|
||||||
text.Insert(PRUnichar('\"'), offset);
|
text.Insert(PRUnichar('\"'), offset);
|
||||||
|
|
|
@ -556,27 +556,22 @@ RelatedLinksStreamListener::Unescape(nsString &text)
|
||||||
|
|
||||||
while((offset = text.FindChar((PRUnichar('&')), offset)) >= 0)
|
while((offset = text.FindChar((PRUnichar('&')), offset)) >= 0)
|
||||||
{
|
{
|
||||||
// XXX get max of 6 chars; change the value below if
|
if (Substring(text, offset, 4).Equals(NS_LITERAL_STRING("<"), nsCaseInsensitiveStringComparator()))
|
||||||
// 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)
|
|
||||||
{
|
{
|
||||||
text.Cut(offset, 4);
|
text.Cut(offset, 4);
|
||||||
text.Insert(PRUnichar('<'), offset);
|
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.Cut(offset, 4);
|
||||||
text.Insert(PRUnichar('>'), offset);
|
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.Cut(offset, 5);
|
||||||
text.Insert(PRUnichar('&'), offset);
|
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.Cut(offset, 6);
|
||||||
text.Insert(PRUnichar('\"'), offset);
|
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
|
// which doesn't make any sense (since the "!= 0" was inside the
|
||||||
// parentheses)
|
// parentheses)
|
||||||
if (searchStrLen < prevSearchStrLen ||
|
if (searchStrLen < prevSearchStrLen ||
|
||||||
Compare(Substring(searchStr, searchStr+prevSearchStrLen),
|
!Substring(searchStr,
|
||||||
nsDependentString(prevSearchString, prevSearchStrLen),
|
searchStr+prevSearchStrLen).Equals(nsDependentString(prevSearchString, prevSearchStrLen),
|
||||||
nsCaseInsensitiveStringComparator())!= 0)
|
nsCaseInsensitiveStringComparator()))
|
||||||
return NS_ERROR_ABORT;
|
return NS_ERROR_ABORT;
|
||||||
|
|
||||||
nsCOMPtr<nsISupportsArray> array;
|
nsCOMPtr<nsISupportsArray> array;
|
||||||
|
@ -368,9 +368,9 @@ nsUrlbarHistory::SearchPreviousResults(const PRUnichar *searchStr, nsIAutoComple
|
||||||
|
|
||||||
if (itemValue.IsEmpty())
|
if (itemValue.IsEmpty())
|
||||||
continue;
|
continue;
|
||||||
if (Compare(nsDependentString(searchStr, searchStrLen),
|
if (nsDependentString(searchStr,
|
||||||
Substring(itemValue, 0, searchStrLen),
|
searchStrLen).Equals(Substring(itemValue, 0, searchStrLen),
|
||||||
nsCaseInsensitiveStringComparator()) == 0)
|
nsCaseInsensitiveStringComparator()))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -626,8 +626,8 @@ nsUrlbarHistory::CheckItemAvailability(const PRUnichar * aItem, nsIAutoCompleteR
|
||||||
resultItem->GetValue(itemValue);
|
resultItem->GetValue(itemValue);
|
||||||
// Using nsIURI to do comparisons didn't quite work out.
|
// Using nsIURI to do comparisons didn't quite work out.
|
||||||
// So use nsCRT methods
|
// So use nsCRT methods
|
||||||
if (Compare(itemValue, nsDependentString(aItem),
|
if (itemValue.Equals(nsDependentString(aItem),
|
||||||
nsCaseInsensitiveStringComparator()) == 0)
|
nsCaseInsensitiveStringComparator()))
|
||||||
{
|
{
|
||||||
//printf("In CheckItemAvailability. Item already found\n");
|
//printf("In CheckItemAvailability. Item already found\n");
|
||||||
*aResult = PR_TRUE;
|
*aResult = PR_TRUE;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче