зеркало из https://github.com/mozilla/pjs.git
Testing performance impact of backout of what's left of the patch from
bug 115289. See bug 123947 for details. a=mcafee
This commit is contained in:
Родитель
7f1c441ffd
Коммит
260814c5be
|
@ -92,8 +92,9 @@ ChangeCSSInlineStyleTxn::ValueIncludes(const nsAReadableString &aValueList, cons
|
|||
}
|
||||
}
|
||||
else {
|
||||
if (nsDependentString(value).Equals(nsDependentString(start),
|
||||
nsCaseInsensitiveStringComparator())) {
|
||||
if (!Compare(nsDependentString(value),
|
||||
nsDependentString(start),
|
||||
nsCaseInsensitiveStringComparator())) {
|
||||
result = PR_TRUE;
|
||||
break;
|
||||
}
|
||||
|
@ -369,9 +370,8 @@ ChangeCSSInlineStyleTxn::AcceptsMoreThanOneValue(nsIAtom *aCSSProperty)
|
|||
NS_IMETHODIMP
|
||||
ChangeCSSInlineStyleTxn::AddValueToMultivalueProperty(nsAWritableString & aValues, const nsAReadableString & aNewValue)
|
||||
{
|
||||
if (aValues.IsEmpty()
|
||||
|| aValues.Equals(NS_LITERAL_STRING("none"),
|
||||
nsCaseInsensitiveStringComparator())) {
|
||||
if (!aValues.Length()
|
||||
|| !Compare(aValues, NS_LITERAL_STRING("none"), nsCaseInsensitiveStringComparator())) {
|
||||
// the list of values is empty of the value is 'none'
|
||||
aValues.Assign(aNewValue);
|
||||
}
|
||||
|
|
|
@ -1179,8 +1179,7 @@ nsHTMLCSSUtils::IsCSSEquivalentToHTMLInlineStyleSet(nsIDOMNode * aNode,
|
|||
if (!htmlValueString.Equals(NS_LITERAL_STRING(""))) {
|
||||
nsAutoString leftHTMLValue;
|
||||
htmlValueString.Left(leftHTMLValue, 5);
|
||||
aIsSet = leftHTMLValue.Equals(leftCSSValue,
|
||||
nsCaseInsensitiveStringComparator());
|
||||
aIsSet = PRBool(!Compare(leftHTMLValue, leftCSSValue, nsCaseInsensitiveStringComparator()));
|
||||
}
|
||||
else {
|
||||
aIsSet = (leftCSSValue.Equals(NS_LITERAL_STRING("times")) ||
|
||||
|
@ -1203,8 +1202,7 @@ nsHTMLCSSUtils::IsCSSEquivalentToHTMLInlineStyleSet(nsIDOMNode * aNode,
|
|||
}
|
||||
|
||||
if (!htmlValueString.Equals(NS_LITERAL_STRING(""))) {
|
||||
if (htmlValueString.Equals(valueString,
|
||||
nsCaseInsensitiveStringComparator())) {
|
||||
if (!Compare(htmlValueString, valueString, nsCaseInsensitiveStringComparator())) {
|
||||
aIsSet = PR_TRUE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2492,7 +2492,7 @@ nsHTMLEditRules::WillMakeList(nsISelection *aSelection,
|
|||
nsAutoString itemType;
|
||||
if (aItemType)
|
||||
itemType = *aItemType;
|
||||
else if (aListType->Equals(NS_LITERAL_STRING("dl"),nsCaseInsensitiveStringComparator()))
|
||||
else if (!Compare(*aListType,NS_LITERAL_STRING("dl"),nsCaseInsensitiveStringComparator()))
|
||||
itemType.Assign(NS_LITERAL_STRING("dd"));
|
||||
else
|
||||
itemType.Assign(NS_LITERAL_STRING("li"));
|
||||
|
@ -6148,7 +6148,7 @@ nsHTMLEditRules::ApplyBlockStyle(nsISupportsArray *arrayOfNodes, const nsAReadab
|
|||
else if (IsInlineNode(curNode))
|
||||
{
|
||||
// if curNode is a non editable, drop it if we are going to <pre>
|
||||
if (tString.Equals(NS_LITERAL_STRING("pre"),nsCaseInsensitiveStringComparator())
|
||||
if (!Compare(tString,NS_LITERAL_STRING("pre"),nsCaseInsensitiveStringComparator())
|
||||
&& (!mHTMLEditor->IsEditable(curNode)))
|
||||
continue; // do nothing to this block
|
||||
|
||||
|
|
|
@ -2461,7 +2461,7 @@ nsHTMLEditor::RemoveList(const nsAReadableString& aListType)
|
|||
if (!selection) return NS_ERROR_NULL_POINTER;
|
||||
|
||||
nsTextRulesInfo ruleInfo(nsTextEditRules::kRemoveList);
|
||||
if (aListType.Equals(NS_LITERAL_STRING("ol"),nsCaseInsensitiveStringComparator()))
|
||||
if (!Compare(aListType,NS_LITERAL_STRING("ol"),nsCaseInsensitiveStringComparator()))
|
||||
ruleInfo.bOrdered = PR_TRUE;
|
||||
else ruleInfo.bOrdered = PR_FALSE;
|
||||
res = mRules->WillDoAction(selection, &ruleInfo, &cancel, &handled);
|
||||
|
@ -2584,7 +2584,7 @@ nsHTMLEditor::Indent(const nsAReadableString& aIndent)
|
|||
PRBool cancel, handled;
|
||||
PRInt32 theAction = nsTextEditRules::kIndent;
|
||||
PRInt32 opID = kOpIndent;
|
||||
if (aIndent.Equals(NS_LITERAL_STRING("outdent"),nsCaseInsensitiveStringComparator()))
|
||||
if (!Compare(aIndent,NS_LITERAL_STRING("outdent"),nsCaseInsensitiveStringComparator()))
|
||||
{
|
||||
theAction = nsTextEditRules::kOutdent;
|
||||
opID = kOpOutdent;
|
||||
|
@ -3571,8 +3571,7 @@ nsHTMLEditor::GetEmbeddedObjects(nsISupportsArray** aNodeList)
|
|||
{
|
||||
nsAutoString href;
|
||||
if (NS_SUCCEEDED(anchor->GetHref(href)))
|
||||
if (Substring(href, 0, 5).Equals(NS_LITERAL_STRING("file:"),
|
||||
nsCaseInsensitiveStringComparator()))
|
||||
if (Compare(Substring(href, 0, 5), NS_LITERAL_STRING("file:"), nsCaseInsensitiveStringComparator()) == 0)
|
||||
(*aNodeList)->AppendElement(node);
|
||||
}
|
||||
}
|
||||
|
@ -3864,20 +3863,20 @@ PRBool
|
|||
nsHTMLEditor::TagCanContainTag(const nsAReadableString& aParentTag, const nsAReadableString& aChildTag)
|
||||
{
|
||||
// COtherDTD gives some unwanted results. We override them here.
|
||||
if (aParentTag.Equals(NS_LITERAL_STRING("ol"),nsCaseInsensitiveStringComparator()) ||
|
||||
aParentTag.Equals(NS_LITERAL_STRING("ul"),nsCaseInsensitiveStringComparator()))
|
||||
if (!Compare(aParentTag,NS_LITERAL_STRING("ol"),nsCaseInsensitiveStringComparator()) ||
|
||||
!Compare(aParentTag,NS_LITERAL_STRING("ul"),nsCaseInsensitiveStringComparator()))
|
||||
{
|
||||
// if parent is a list and tag is also a list, say "yes".
|
||||
// This is because the editor does sublists illegally for now.
|
||||
if (aChildTag.Equals(NS_LITERAL_STRING("ol"),nsCaseInsensitiveStringComparator()) ||
|
||||
aChildTag.Equals(NS_LITERAL_STRING("ul"),nsCaseInsensitiveStringComparator()))
|
||||
if (!Compare(aChildTag,NS_LITERAL_STRING("ol"),nsCaseInsensitiveStringComparator()) ||
|
||||
!Compare(aChildTag,NS_LITERAL_STRING("ul"),nsCaseInsensitiveStringComparator()))
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
if (aParentTag.Equals(NS_LITERAL_STRING("li"),nsCaseInsensitiveStringComparator()))
|
||||
if (!Compare(aParentTag,NS_LITERAL_STRING("li"),nsCaseInsensitiveStringComparator()))
|
||||
{
|
||||
// list items cant contain list items
|
||||
if (aChildTag.Equals(NS_LITERAL_STRING("li"),nsCaseInsensitiveStringComparator()))
|
||||
if (!Compare(aChildTag,NS_LITERAL_STRING("li"),nsCaseInsensitiveStringComparator()))
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -715,7 +715,7 @@ nsresult nsHTMLEditor::RemoveStyleInside(nsIDOMNode *aNode,
|
|||
}
|
||||
if ( aProperty == nsIEditProperty::font && // or node is big or small and we are setting font size
|
||||
(NodeIsType(aNode, nsIEditProperty::big) || NodeIsType(aNode, nsIEditProperty::small)) &&
|
||||
aAttribute->Equals(NS_LITERAL_STRING("size"),nsCaseInsensitiveStringComparator()))
|
||||
!Compare(*aAttribute,NS_LITERAL_STRING("size"),nsCaseInsensitiveStringComparator()))
|
||||
{
|
||||
res = RemoveContainer(aNode); // if we are setting font size, remove any nested bigs and smalls
|
||||
}
|
||||
|
@ -741,10 +741,10 @@ PRBool nsHTMLEditor::IsOnlyAttribute(nsIDOMNode *aNode,
|
|||
if (!attrName) continue; // ooops
|
||||
attrName->ToString(attrString);
|
||||
// if it's the attribute we know about, keep looking
|
||||
if (attrString.Equals(*aAttribute,nsCaseInsensitiveStringComparator())) continue;
|
||||
if (!Compare(attrString,*aAttribute,nsCaseInsensitiveStringComparator())) continue;
|
||||
// if it's a special _moz... attribute, keep looking
|
||||
attrString.Left(tmp,4);
|
||||
if (tmp.Equals(NS_LITERAL_STRING("_moz"),nsCaseInsensitiveStringComparator())) continue;
|
||||
if (!Compare(tmp,NS_LITERAL_STRING("_moz"),nsCaseInsensitiveStringComparator())) continue;
|
||||
// otherwise, it's another attribute, so return false
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
@ -798,7 +798,7 @@ PRBool nsHTMLEditor::HasAttrVal(nsIDOMNode *aNode,
|
|||
attNode->GetValue(attrVal);
|
||||
|
||||
// do values match?
|
||||
if (attrVal.Equals(*aValue,nsCaseInsensitiveStringComparator())) return PR_TRUE;
|
||||
if (!Compare(attrVal,*aValue,nsCaseInsensitiveStringComparator())) return PR_TRUE;
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -107,7 +107,7 @@ nsAOLCiter::StripCites(const nsAReadableString& aInString, nsAWritableString& aO
|
|||
nsReadingIterator <PRUnichar> iter,enditer;
|
||||
aInString.BeginReading(iter);
|
||||
aInString.EndReading(enditer);
|
||||
if (Substring(aInString,0,2).Equals(NS_LITERAL_STRING(">>")))
|
||||
if (!Compare(Substring(aInString,0,2),NS_LITERAL_STRING(">>")))
|
||||
{
|
||||
iter.advance(2);
|
||||
while (nsCRT::IsAsciiSpace(*iter))
|
||||
|
|
|
@ -1466,27 +1466,27 @@ ChromeContextMenuListener :: ContextMenu ( nsIDOMEvent* aMouseEvent )
|
|||
element->GetTagName(tag);
|
||||
|
||||
// Test what kind of element we're dealing with here
|
||||
if (tag.Equals(NS_LITERAL_STRING("img"), nsCaseInsensitiveStringComparator()))
|
||||
if (!Compare(tag, NS_LITERAL_STRING("img"), nsCaseInsensitiveStringComparator()))
|
||||
{
|
||||
flags |= nsIContextMenuListener::CONTEXT_IMAGE;
|
||||
targetDOMnode = node;
|
||||
// if we see an image, keep searching for a possible anchor
|
||||
}
|
||||
else if (tag.Equals(NS_LITERAL_STRING("input"), nsCaseInsensitiveStringComparator()))
|
||||
else if (!Compare(tag, NS_LITERAL_STRING("input"), nsCaseInsensitiveStringComparator()))
|
||||
{
|
||||
// INPUT element - button, combo, checkbox, text etc.
|
||||
flags |= nsIContextMenuListener::CONTEXT_INPUT;
|
||||
targetDOMnode = node;
|
||||
break; // exit do-while
|
||||
}
|
||||
else if (tag.Equals(NS_LITERAL_STRING("textarea"), nsCaseInsensitiveStringComparator()))
|
||||
else if (!Compare(tag, NS_LITERAL_STRING("textarea"), nsCaseInsensitiveStringComparator()))
|
||||
{
|
||||
// text area
|
||||
flags |= nsIContextMenuListener::CONTEXT_TEXT;
|
||||
targetDOMnode = node;
|
||||
break; // exit do-while
|
||||
}
|
||||
else if (tag.Equals(NS_LITERAL_STRING("html"), nsCaseInsensitiveStringComparator()))
|
||||
else if (!Compare(tag, NS_LITERAL_STRING("html"), nsCaseInsensitiveStringComparator()))
|
||||
{
|
||||
// only care about this if no other context was found.
|
||||
if (!flags) {
|
||||
|
@ -1508,7 +1508,8 @@ ChromeContextMenuListener :: ContextMenu ( nsIDOMEvent* aMouseEvent )
|
|||
if (attributes)
|
||||
{
|
||||
nsCOMPtr<nsIDOMNode> hrefNode;
|
||||
attributes->GetNamedItem(NS_LITERAL_STRING("href"), getter_AddRefs(hrefNode));
|
||||
nsAutoString href(NS_LITERAL_STRING("href"));
|
||||
attributes->GetNamedItem(href, getter_AddRefs(hrefNode));
|
||||
if (hrefNode)
|
||||
{
|
||||
flags |= nsIContextMenuListener::CONTEXT_LINK;
|
||||
|
|
|
@ -429,7 +429,7 @@ nsWalletlibService::OnStateChange(nsIWebProgress* aWebProgress,
|
|||
nsAutoString type;
|
||||
rv = inputElement->GetType(type);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
if (type.Equals(NS_LITERAL_STRING("password"), nsCaseInsensitiveStringComparator())) {
|
||||
if (Compare(type, NS_LITERAL_STRING("password"), nsCaseInsensitiveStringComparator()) == 0) {
|
||||
passwordCount++;
|
||||
}
|
||||
}
|
||||
|
@ -449,11 +449,8 @@ nsWalletlibService::OnStateChange(nsIWebProgress* aWebProgress,
|
|||
nsAutoString type;
|
||||
rv = inputElement->GetType(type);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
if (type.IsEmpty() ||
|
||||
type.Equals(NS_LITERAL_STRING("text"),
|
||||
nsCaseInsensitiveStringComparator()) ||
|
||||
type.Equals(NS_LITERAL_STRING("password"),
|
||||
nsCaseInsensitiveStringComparator())) {
|
||||
if ((type.IsEmpty()) || (Compare(type, NS_LITERAL_STRING("text"), nsCaseInsensitiveStringComparator()) == 0) ||
|
||||
(Compare(type, NS_LITERAL_STRING("password"), nsCaseInsensitiveStringComparator()) == 0)) {
|
||||
nsAutoString field;
|
||||
rv = inputElement->GetName(field);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
|
|
|
@ -1960,16 +1960,14 @@ wallet_StepForwardOrBack
|
|||
if (goForward) {
|
||||
if (NS_SUCCEEDED(result) &&
|
||||
(type.IsEmpty() ||
|
||||
type.Equals(NS_LITERAL_STRING("text"),
|
||||
nsCaseInsensitiveStringComparator()))) {
|
||||
(Compare(type, NS_LITERAL_STRING("text"),
|
||||
nsCaseInsensitiveStringComparator()) == 0))) {
|
||||
/* at <input> element and it's type is either "text" or is missing ("text" by default) */
|
||||
atInputOrSelect = PR_TRUE;
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (NS_SUCCEEDED(result) &&
|
||||
!type.Equals(NS_LITERAL_STRING("hidden"),
|
||||
nsCaseInsensitiveStringComparator())) {
|
||||
if (NS_SUCCEEDED(result) && (Compare(type, NS_LITERAL_STRING("hidden"), nsCaseInsensitiveStringComparator()) != 0)) {
|
||||
/* at <input> element and it's type is not "hidden" */
|
||||
atInputOrSelect = PR_TRUE;
|
||||
return;
|
||||
|
@ -2404,10 +2402,7 @@ wallet_GetPrefills(
|
|||
if ((NS_SUCCEEDED(result)) && (nsnull != inputElement)) {
|
||||
nsAutoString type;
|
||||
result = inputElement->GetType(type);
|
||||
if (NS_SUCCEEDED(result) &&
|
||||
(type.IsEmpty() ||
|
||||
type.Equals(NS_LITERAL_STRING("text"),
|
||||
nsCaseInsensitiveStringComparator()))) {
|
||||
if ((NS_SUCCEEDED(result)) && ((type.IsEmpty()) || (Compare(type, NS_LITERAL_STRING("text"), nsCaseInsensitiveStringComparator()) == 0))) {
|
||||
nsAutoString field;
|
||||
result = inputElement->GetName(field);
|
||||
if (NS_SUCCEEDED(result)) {
|
||||
|
@ -3641,10 +3636,8 @@ wallet_CaptureInputElement(nsIDOMNode* elementNode, nsIDocument* doc) {
|
|||
/* it's an input element */
|
||||
nsAutoString type;
|
||||
result = inputElement->GetType(type);
|
||||
if (NS_SUCCEEDED(result) &&
|
||||
(type.IsEmpty() ||
|
||||
type.Equals(NS_LITERAL_STRING("text"),
|
||||
nsCaseInsensitiveStringComparator()))) {
|
||||
if ((NS_SUCCEEDED(result)) &&
|
||||
(type.IsEmpty() || (Compare(type, NS_LITERAL_STRING("text"), nsCaseInsensitiveStringComparator()) == 0))) {
|
||||
nsAutoString field;
|
||||
result = inputElement->GetName(field);
|
||||
if (NS_SUCCEEDED(result)) {
|
||||
|
@ -3999,8 +3992,8 @@ WLLT_OnSubmit(nsIContent* currentForm, nsIDOMWindowInternal* window) {
|
|||
rv = inputElement->GetType(type);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
|
||||
PRBool isText = (type.IsEmpty() || type.Equals(NS_LITERAL_STRING("text"), nsCaseInsensitiveStringComparator()));
|
||||
PRBool isPassword = type.Equals(NS_LITERAL_STRING("password"), nsCaseInsensitiveStringComparator());
|
||||
PRBool isText = (type.IsEmpty() || (Compare(type, NS_LITERAL_STRING("text"), nsCaseInsensitiveStringComparator())==0));
|
||||
PRBool isPassword = (Compare(type, NS_LITERAL_STRING("password"), nsCaseInsensitiveStringComparator())==0);
|
||||
|
||||
// don't save password if field was left blank
|
||||
if (isPassword) {
|
||||
|
|
|
@ -1013,12 +1013,12 @@ nsresult CNavDTD::DidHandleStartTag(nsIParserNode& aNode,eHTMLTags aChildTag){
|
|||
if(theCount) {
|
||||
PRInt32 theIndex=0;
|
||||
for(theIndex=0;theIndex<theCount;theIndex++){
|
||||
const nsAString& theKey = aNode.GetKeyAt(theIndex);
|
||||
if(theKey.Equals(NS_LITERAL_STRING("ENTITY"), nsCaseInsensitiveStringComparator())) {
|
||||
nsAutoString theKey(aNode.GetKeyAt(theIndex));
|
||||
if(!Compare(theKey, NS_LITERAL_STRING("ENTITY"), nsCaseInsensitiveStringComparator())) {
|
||||
const nsString& theName=aNode.GetValueAt(theIndex);
|
||||
theNamePtr=&theName;
|
||||
}
|
||||
else if(theKey.Equals(NS_LITERAL_STRING("VALUE"), nsCaseInsensitiveStringComparator())) {
|
||||
else if(!Compare(theKey, NS_LITERAL_STRING("VALUE"), nsCaseInsensitiveStringComparator())) {
|
||||
//store the named enity with the context...
|
||||
const nsString& theValue=aNode.GetValueAt(theIndex);
|
||||
theValuePtr=&theValue;
|
||||
|
|
|
@ -588,12 +588,12 @@ nsresult COtherDTD::DidHandleStartTag(nsIParserNode& aNode,eHTMLTags aChildTag){
|
|||
if(theCount) {
|
||||
PRInt32 theIndex=0;
|
||||
for(theIndex=0;theIndex<theCount;theIndex++){
|
||||
const nsAString& theKey = aNode.GetKeyAt(theIndex);
|
||||
if(theKey.Equals(NS_LITERAL_STRING("ENTITY"), nsCaseInsensitiveStringComparator())) {
|
||||
nsAutoString theKey(aNode.GetKeyAt(theIndex));
|
||||
if(!Compare(theKey, NS_LITERAL_STRING("ENTITY"), nsCaseInsensitiveStringComparator())) {
|
||||
const nsString& theName=aNode.GetValueAt(theIndex);
|
||||
theNamePtr=&theName;
|
||||
}
|
||||
else if(theKey.Equals(NS_LITERAL_STRING("VALUE"), nsCaseInsensitiveStringComparator())) {
|
||||
else if(!Compare(theKey, NS_LITERAL_STRING("VALUE"), nsCaseInsensitiveStringComparator())) {
|
||||
//store the named enity with the context...
|
||||
const nsString& theValue=aNode.GetValueAt(theIndex);
|
||||
theValuePtr=&theValue;
|
||||
|
|
|
@ -842,10 +842,10 @@ PRInt32 nsDTDContext::IncrementCounter(eHTMLTags aTag,nsIParserNode& aNode,nsStr
|
|||
CAbacus::eNumFormat theNumFormat=CAbacus::eDecimal;
|
||||
|
||||
for(theIndex=0;theIndex<theCount;theIndex++){
|
||||
const nsAString& theKey=aNode.GetKeyAt(theIndex);
|
||||
nsAutoString theKey(aNode.GetKeyAt(theIndex));
|
||||
const nsString& theValue=aNode.GetValueAt(theIndex);
|
||||
|
||||
if(theKey.Equals(NS_LITERAL_STRING("name"), nsCaseInsensitiveStringComparator())){
|
||||
if(!Compare(theKey, NS_LITERAL_STRING("name"), nsCaseInsensitiveStringComparator())){
|
||||
theEntity=GetEntity(theValue);
|
||||
if(!theEntity) {
|
||||
theEntity=RegisterEntity(theValue,theValue);
|
||||
|
@ -853,10 +853,10 @@ PRInt32 nsDTDContext::IncrementCounter(eHTMLTags aTag,nsIParserNode& aNode,nsStr
|
|||
}
|
||||
aTag=eHTMLTag_userdefined;
|
||||
}
|
||||
else if(theKey.Equals(NS_LITERAL_STRING("noincr"), nsCaseInsensitiveStringComparator())){
|
||||
else if(!Compare(theKey, NS_LITERAL_STRING("noincr"), nsCaseInsensitiveStringComparator())){
|
||||
theIncrValue=0;
|
||||
}
|
||||
else if(theKey.Equals(NS_LITERAL_STRING("format"), nsCaseInsensitiveStringComparator())){
|
||||
else if(!Compare(theKey, NS_LITERAL_STRING("format"), nsCaseInsensitiveStringComparator())){
|
||||
PRUnichar theChar=theValue.CharAt(0);
|
||||
if('"'==theChar)
|
||||
theChar=theValue.CharAt(1);
|
||||
|
@ -873,7 +873,7 @@ PRInt32 nsDTDContext::IncrementCounter(eHTMLTags aTag,nsIParserNode& aNode,nsStr
|
|||
}
|
||||
//determine numbering style
|
||||
}
|
||||
else if(theKey.Equals(NS_LITERAL_STRING("value"), nsCaseInsensitiveStringComparator())){
|
||||
else if(!Compare(theKey, NS_LITERAL_STRING("value"), nsCaseInsensitiveStringComparator())){
|
||||
PRInt32 err=0;
|
||||
theNewValue=theValue.ToInteger(&err);
|
||||
if(!err) {
|
||||
|
|
|
@ -413,7 +413,7 @@ void nsHTMLContentSinkStream::WriteAttributes(const nsIParserNode& aNode)
|
|||
if(theCount) {
|
||||
int i=0;
|
||||
for(i=0;i<theCount;i++){
|
||||
const nsAString& key = aNode.GetKeyAt(i);
|
||||
nsAutoString key(aNode.GetKeyAt(i));
|
||||
|
||||
// See if there's an attribute:
|
||||
// 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);
|
||||
|
||||
// Filter out any attribute starting with _moz
|
||||
if (key.Equals(NS_LITERAL_STRING("_moz"), nsCaseInsensitiveStringComparator()))
|
||||
if (!Compare(key, NS_LITERAL_STRING("_moz"), nsCaseInsensitiveStringComparator())
|
||||
continue;
|
||||
|
||||
//
|
||||
|
@ -437,8 +437,8 @@ void nsHTMLContentSinkStream::WriteAttributes(const nsIParserNode& aNode)
|
|||
// used by the editor. Bug 16988. Yuck.
|
||||
//
|
||||
if ((eHTMLTags)aNode.GetNodeType() == eHTMLTag_br
|
||||
&& key.Equals(NS_LITERAL_STRING("type"), nsCaseInsensitiveStringComparator())
|
||||
&& value.Equals(NS_LITERAL_STRING("_moz")))
|
||||
&& (!Compare((key, NS_LITERAL_STRING("type"), nsCaseInsensitiveStringComparator())
|
||||
&& value.Equals(NS_LITERAL_STRING("_moz")))))
|
||||
continue;
|
||||
|
||||
if (mLowerCaseTags == PR_TRUE)
|
||||
|
@ -456,8 +456,8 @@ void nsHTMLContentSinkStream::WriteAttributes(const nsIParserNode& aNode)
|
|||
|
||||
// Make all links absolute when converting only the selection:
|
||||
if ((mFlags & nsIDocumentEncoder::OutputAbsoluteLinks)
|
||||
&& (key.Equals(NS_LITERAL_STRING("href"), nsCaseInsensitiveStringComparator())
|
||||
|| key.Equals(NS_LITERAL_STRING("src"), nsCaseInsensitiveStringComparator())
|
||||
&& (!Compare(key, NS_LITERAL_STRING("href"), nsCaseInsensitiveStringComparator())
|
||||
|| !Compare(key, NS_LITERAL_STRING("src"), nsCaseInsensitiveStringComparator())
|
||||
// Would be nice to handle OBJECT and APPLET tags,
|
||||
// but that gets more complicated since we have to
|
||||
// search the tag list for CODEBASE as well.
|
||||
|
|
|
@ -1203,7 +1203,7 @@ NS_IMETHODIMP CViewSourceHTML::HandleToken(CToken* aToken,nsIParser* aParser) {
|
|||
{
|
||||
nsAutoString theStr;
|
||||
theStr.Assign(aToken->GetStringValue());
|
||||
if(!theStr.Equals(NS_LITERAL_STRING("XI"), nsCaseInsensitiveStringComparator())) {
|
||||
if(Compare(theStr, NS_LITERAL_STRING("XI"), nsCaseInsensitiveStringComparator()) != 0) {
|
||||
PRUnichar theChar=theStr.CharAt(0);
|
||||
if((nsCRT::IsAsciiDigit(theChar)) || ('X'==theChar) || ('x'==theChar)){
|
||||
theStr.Assign(NS_LITERAL_STRING("#") + theStr);
|
||||
|
|
|
@ -106,8 +106,7 @@ NS_IMETHODIMP nsMetaCharsetObserver::Notify(
|
|||
const PRUnichar* valueArray[])
|
||||
{
|
||||
|
||||
if(!nsDependentString(aTag).Equals(NS_LITERAL_STRING("META"),
|
||||
nsCaseInsensitiveStringComparator()))
|
||||
if(0 != Compare(nsDependentString(aTag), NS_LITERAL_STRING("META"), nsCaseInsensitiveStringComparator()))
|
||||
return NS_ERROR_ILLEGAL_VALUE;
|
||||
else
|
||||
return Notify(aDocumentID, numOfAttributes, nameArray, valueArray);
|
||||
|
@ -148,8 +147,8 @@ NS_IMETHODIMP nsMetaCharsetObserver::Notify(
|
|||
const PRUnichar* aTag,
|
||||
const nsStringArray* keys, const nsStringArray* values)
|
||||
{
|
||||
if(!nsDependentString(aTag).Equals(NS_LITERAL_STRING("META"),
|
||||
nsCaseInsensitiveStringComparator()))
|
||||
if(0 != Compare(nsDependentString(aTag), NS_LITERAL_STRING("META"),
|
||||
nsCaseInsensitiveStringComparator()))
|
||||
return NS_ERROR_ILLEGAL_VALUE;
|
||||
else
|
||||
return Notify(aWebShell, aChannel, keys, values);
|
||||
|
@ -216,14 +215,17 @@ NS_IMETHODIMP nsMetaCharsetObserver::Notify(
|
|||
while(IS_SPACE_CHARS(*keyStr))
|
||||
keyStr++;
|
||||
|
||||
if(Substring(keyStr, keyStr+10).Equals(NS_LITERAL_STRING("HTTP-EQUIV"),
|
||||
nsCaseInsensitiveStringComparator()))
|
||||
if(0 == Compare(Substring(keyStr, keyStr+10),
|
||||
NS_LITERAL_STRING("HTTP-EQUIV"),
|
||||
nsCaseInsensitiveStringComparator()))
|
||||
httpEquivValue = values->StringAt(i)->get();
|
||||
else if(Substring(keyStr, keyStr+7).Equals(NS_LITERAL_STRING("content"),
|
||||
nsCaseInsensitiveStringComparator()))
|
||||
else if(0 == Compare(Substring(keyStr, keyStr+7),
|
||||
NS_LITERAL_STRING("content"),
|
||||
nsCaseInsensitiveStringComparator()))
|
||||
contentValue = values->StringAt(i)->get();
|
||||
else if (Substring(keyStr, keyStr+7).Equals(NS_LITERAL_STRING("charset"),
|
||||
nsCaseInsensitiveStringComparator()))
|
||||
else if (0 == Compare(Substring(keyStr, keyStr+7),
|
||||
NS_LITERAL_STRING("charset"),
|
||||
nsCaseInsensitiveStringComparator()))
|
||||
charsetValue = values->StringAt(i)->get();
|
||||
}
|
||||
NS_NAMED_LITERAL_STRING(contenttype, "Content-Type");
|
||||
|
@ -239,26 +241,26 @@ NS_IMETHODIMP nsMetaCharsetObserver::Notify(
|
|||
|
||||
if(
|
||||
// first try unquoted strings
|
||||
((Substring(httpEquivValue,
|
||||
httpEquivValue+contenttype.Length()).Equals(contenttype,
|
||||
nsCaseInsensitiveStringComparator())) ||
|
||||
((0==Compare(Substring(httpEquivValue,httpEquivValue+contenttype.Length()),
|
||||
contenttype,
|
||||
nsCaseInsensitiveStringComparator())) ||
|
||||
// now try "quoted" or 'quoted' strings
|
||||
(( (httpEquivValue[0]=='\'') ||
|
||||
(httpEquivValue[0]=='\"') ) &&
|
||||
(Substring(httpEquivValue+1,
|
||||
httpEquivValue+1+contenttype.Length()).Equals(contenttype,
|
||||
nsCaseInsensitiveStringComparator()))
|
||||
(0==Compare(Substring(httpEquivValue+1, httpEquivValue+1+contenttype.Length()),
|
||||
contenttype,
|
||||
nsCaseInsensitiveStringComparator()))
|
||||
)) &&
|
||||
// first try unquoted strings
|
||||
((Substring(contentValue,
|
||||
contentValue+texthtml.Length()).Equals(texthtml,
|
||||
nsCaseInsensitiveStringComparator())) ||
|
||||
((0==Compare(Substring(contentValue,contentValue+texthtml.Length()),
|
||||
texthtml,
|
||||
nsCaseInsensitiveStringComparator())) ||
|
||||
// now try "quoted" or 'quoted' strings
|
||||
(((contentValue[0]=='\'') ||
|
||||
(contentValue[0]=='\"'))&&
|
||||
(Substring(contentValue+1,
|
||||
contentValue+1+texthtml.Length()).Equals(texthtml,
|
||||
nsCaseInsensitiveStringComparator()))
|
||||
(0==Compare(Substring(contentValue+1, contentValue+1+texthtml.Length()),
|
||||
texthtml,
|
||||
nsCaseInsensitiveStringComparator()))
|
||||
))
|
||||
)
|
||||
{
|
||||
|
@ -350,8 +352,8 @@ NS_IMETHODIMP nsMetaCharsetObserver::GetCharsetFromCompatibilityTag(
|
|||
// e.g. <META charset="ISO-8859-1">
|
||||
PRInt32 numOfAttributes = keys->Count();
|
||||
if ((numOfAttributes >= 3) &&
|
||||
(keys->StringAt(0)->Equals(NS_LITERAL_STRING("charset"),
|
||||
nsCaseInsensitiveStringComparator())))
|
||||
(0 == Compare(*keys->StringAt(0), NS_LITERAL_STRING("charset"),
|
||||
nsCaseInsensitiveStringComparator())))
|
||||
{
|
||||
nsAutoString srcStr((values->StringAt(numOfAttributes-2))->get());
|
||||
PRInt32 err;
|
||||
|
|
|
@ -94,8 +94,8 @@ NS_IMETHODIMP nsXMLEncodingObserver::Notify(
|
|||
const PRUnichar* nameArray[],
|
||||
const PRUnichar* valueArray[])
|
||||
{
|
||||
if(!nsDependentString(aTag).Equals(NS_LITERAL_STRING("?XML"),
|
||||
nsCaseInsensitiveStringComparator()))
|
||||
if(0 != Compare(nsDependentString(aTag), NS_LITERAL_STRING("?XML"),
|
||||
nsCaseInsensitiveStringComparator()))
|
||||
return NS_ERROR_ILLEGAL_VALUE;
|
||||
else
|
||||
return Notify(aDocumentID, numOfAttributes, nameArray, valueArray);
|
||||
|
@ -143,8 +143,8 @@ NS_IMETHODIMP nsXMLEncodingObserver::Notify(
|
|||
} else if(0==nsCRT::strcmp(nameArray[i], NS_LITERAL_STRING("charsetSource").get())) {
|
||||
bGotCurrentCharsetSource = PR_TRUE;
|
||||
charsetSourceStr = valueArray[i];
|
||||
} else if(nsDependentString(nameArray[i]).Equals(NS_LITERAL_STRING("encoding"),
|
||||
nsCaseInsensitiveStringComparator())) {
|
||||
} else if(0==Compare(nsDependentString(nameArray[i]), NS_LITERAL_STRING("encoding"),
|
||||
nsCaseInsensitiveStringComparator())) {
|
||||
bGotEncoding = PR_TRUE;
|
||||
encoding = valueArray[i];
|
||||
}
|
||||
|
|
|
@ -96,9 +96,7 @@ nsresult nsCollationUnix::Initialize(nsILocale* locale)
|
|||
PRUnichar *prefValue;
|
||||
res = prefs->GetLocalizedUnicharPref("intl.collationOption", &prefValue);
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
mUseCodePointOrder =
|
||||
nsDependentString(prefValue).Equals(NS_LITERAL_STRING("useCodePointOrder"),
|
||||
nsCaseInsensitiveStringComparator());
|
||||
mUseCodePointOrder = (Compare(nsDependentString(prefValue), NS_LITERAL_STRING("useCodePointOrder"), nsCaseInsensitiveStringComparator())==0);
|
||||
nsMemory::Free(prefValue);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -127,7 +127,7 @@ NS_IMETHODIMP nsCharsetAlias2::Equals(const nsAReadableString& aCharset1, const
|
|||
{
|
||||
nsresult res = NS_OK;
|
||||
|
||||
if(aCharset1.Equals(aCharset2, nsCaseInsensitiveStringComparator())) {
|
||||
if(Compare(aCharset1, aCharset2, nsCaseInsensitiveStringComparator()) == 0) {
|
||||
*oResult = PR_TRUE;
|
||||
return res;
|
||||
}
|
||||
|
|
|
@ -2816,20 +2816,15 @@ nsAbSync::GetTypeOfPhoneNumber(nsString tagName)
|
|||
continue;
|
||||
|
||||
phoneType.Cut(0, loc+1);
|
||||
if (phoneType.Equals(NS_LITERAL_STRING(ABSYNC_HOME_PHONE_TYPE),
|
||||
nsCaseInsensitiveStringComparator()))
|
||||
if (!Compare(phoneType, NS_LITERAL_STRING(ABSYNC_HOME_PHONE_TYPE), nsCaseInsensitiveStringComparator()))
|
||||
return ABSYNC_HOME_PHONE_ID;
|
||||
else if (phoneType.Equals(NS_LITERAL_STRING(ABSYNC_WORK_PHONE_TYPE),
|
||||
nsCaseInsensitiveStringComparator()))
|
||||
else if (!Compare(phoneType, NS_LITERAL_STRING(ABSYNC_WORK_PHONE_TYPE), nsCaseInsensitiveStringComparator()))
|
||||
return ABSYNC_WORK_PHONE_ID;
|
||||
else if (phoneType.Equals(NS_LITERAL_STRING(ABSYNC_FAX_PHONE_TYPE),
|
||||
nsCaseInsensitiveStringComparator()))
|
||||
else if (!Compare(phoneType, NS_LITERAL_STRING(ABSYNC_FAX_PHONE_TYPE), nsCaseInsensitiveStringComparator()))
|
||||
return ABSYNC_FAX_PHONE_ID;
|
||||
else if (phoneType.Equals(NS_LITERAL_STRING(ABSYNC_PAGER_PHONE_TYPE),
|
||||
nsCaseInsensitiveStringComparator()))
|
||||
else if (!Compare(phoneType, NS_LITERAL_STRING(ABSYNC_PAGER_PHONE_TYPE), nsCaseInsensitiveStringComparator()))
|
||||
return ABSYNC_PAGER_PHONE_ID;
|
||||
else if (phoneType.Equals(NS_LITERAL_STRING(ABSYNC_CELL_PHONE_TYPE),
|
||||
nsCaseInsensitiveStringComparator()))
|
||||
else if (!Compare(phoneType, NS_LITERAL_STRING(ABSYNC_CELL_PHONE_TYPE), nsCaseInsensitiveStringComparator()))
|
||||
return ABSYNC_CELL_PHONE_ID;
|
||||
}
|
||||
}
|
||||
|
@ -2919,8 +2914,7 @@ nsAbSync::AddValueToNewCard(nsIAbCard *aCard, nsString *aTagName, nsString *aTag
|
|||
PR_FREEIF(tValue);
|
||||
}
|
||||
|
||||
if (Substring(*aTagName, 0, 5).Equals(NS_LITERAL_STRING("phone"),
|
||||
nsCaseInsensitiveStringComparator()))
|
||||
if (!Compare(Substring(*aTagName, 0, 5), NS_LITERAL_STRING("phone"), nsCaseInsensitiveStringComparator()))
|
||||
{
|
||||
nsString tempVal;
|
||||
tempVal.Append(*aTagName +
|
||||
|
|
|
@ -100,8 +100,8 @@ PRBool nsAbAutoCompleteSession::ItsADuplicate(PRUnichar* fullAddrStr, nsIAutoCom
|
|||
rv = resultItem->GetValue(valueStr);
|
||||
if (NS_SUCCEEDED(rv) && !valueStr.IsEmpty())
|
||||
{
|
||||
if (nsDependentString(fullAddrStr).Equals(valueStr,
|
||||
nsCaseInsensitiveStringComparator()))
|
||||
if (Compare(nsDependentString(fullAddrStr), valueStr,
|
||||
nsCaseInsensitiveStringComparator())==0)
|
||||
return PR_TRUE;
|
||||
}
|
||||
}
|
||||
|
@ -266,9 +266,9 @@ static PRBool CommonPrefix(const PRUnichar *aString, const PRUnichar *aSubstr, P
|
|||
if (!aSubstrLen || (nsCRT::strlen(aString) < NS_STATIC_CAST(PRUint32, aSubstrLen)))
|
||||
return PR_FALSE;
|
||||
|
||||
return (Substring(aString,
|
||||
aString+aSubstrLen).Equals(Substring(aSubstr, aSubstr+aSubstrLen),
|
||||
nsCaseInsensitiveStringComparator()));
|
||||
return (Compare(Substring(aString, aString+aSubstrLen),
|
||||
Substring(aSubstr, aSubstr+aSubstrLen),
|
||||
nsCaseInsensitiveStringComparator()) == 0);
|
||||
}
|
||||
|
||||
|
||||
|
@ -295,48 +295,46 @@ nsAbAutoCompleteSession::CheckEntry(nsAbAutoCompleteSearchString* searchStr,
|
|||
fullStringLen = searchStr->mFullStringLen;
|
||||
}
|
||||
|
||||
nsDependentString fullStringStr(fullString, fullStringLen);
|
||||
|
||||
// First check for a Nickname exact match
|
||||
if (nickName &&
|
||||
fullStringStr.Equals(nsDependentString(nickName),
|
||||
nsCaseInsensitiveStringComparator()))
|
||||
if (nickName && Compare(nsDependentString(fullString),
|
||||
nsDependentString(nickName),
|
||||
nsCaseInsensitiveStringComparator()) == 0)
|
||||
{
|
||||
*matchType = NICKNAME_EXACT_MATCH;
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
// Then check for a display Name exact match
|
||||
if (displayName &&
|
||||
fullStringStr.Equals(nsDependentString(displayName),
|
||||
nsCaseInsensitiveStringComparator()))
|
||||
if (displayName && Compare(nsDependentString(fullString),
|
||||
nsDependentString(displayName),
|
||||
nsCaseInsensitiveStringComparator()) == 0)
|
||||
{
|
||||
*matchType = NAME_EXACT_MATCH;
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
// Then check for a fisrt Name exact match
|
||||
if (firstName &&
|
||||
fullStringStr.Equals(nsDependentString(firstName),
|
||||
nsCaseInsensitiveStringComparator()))
|
||||
if (firstName && Compare(nsDependentString(fullString),
|
||||
nsDependentString(firstName),
|
||||
nsCaseInsensitiveStringComparator()) == 0)
|
||||
{
|
||||
*matchType = NAME_EXACT_MATCH;
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
// Then check for a last Name exact match
|
||||
if (lastName &&
|
||||
fullStringStr.Equals(nsDependentString(lastName),
|
||||
nsCaseInsensitiveStringComparator()))
|
||||
if (lastName && Compare(nsDependentString(fullString),
|
||||
nsDependentString(lastName),
|
||||
nsCaseInsensitiveStringComparator()) == 0)
|
||||
{
|
||||
*matchType = NAME_EXACT_MATCH;
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
// Then check for a Email exact match
|
||||
if (emailAddress &&
|
||||
fullStringStr.Equals(nsDependentString(emailAddress),
|
||||
nsCaseInsensitiveStringComparator()))
|
||||
if (emailAddress && Compare(nsDependentString(fullString),
|
||||
nsDependentString(emailAddress),
|
||||
nsCaseInsensitiveStringComparator()) == 0)
|
||||
{
|
||||
*matchType = EMAIL_EXACT_MATCH;
|
||||
return PR_TRUE;
|
||||
|
|
|
@ -1037,9 +1037,7 @@ PRBool PR_CALLBACK nsMsgAccountManager::cleanupOnExit(nsHashKey *aKey, void *aDa
|
|||
nsCOMPtr<nsIMsgFolder>inboxFolder = do_QueryInterface(aSupport);
|
||||
nsXPIDLString folderName;
|
||||
inboxFolder->GetName(getter_Copies(folderName));
|
||||
if (folderName &&
|
||||
folderName.Equals(NS_LITERAL_STRING("INBOX"),
|
||||
nsCaseInsensitiveStringComparator()))
|
||||
if (folderName && Compare(folderName, NS_LITERAL_STRING("INBOX"), nsCaseInsensitiveStringComparator()) ==0)
|
||||
{
|
||||
rv1 = inboxFolder->Compact(urlListener, nsnull /* msgwindow */);
|
||||
if (NS_SUCCEEDED(rv1))
|
||||
|
|
|
@ -938,9 +938,8 @@ NS_IMETHODIMP nsMsgFolder::GetChildNamed(const char *name, nsISupports ** aChild
|
|||
|
||||
rv = folder->GetName(getter_Copies(folderName));
|
||||
// case-insensitive compare is probably LCD across OS filesystems
|
||||
if (NS_SUCCEEDED(rv) &&
|
||||
folderName.Equals(uniName,
|
||||
nsCaseInsensitiveStringComparator()))
|
||||
if (NS_SUCCEEDED(rv) && Compare(folderName, uniName,
|
||||
nsCaseInsensitiveStringComparator()) == 0)
|
||||
{
|
||||
*aChild = folder;
|
||||
NS_ADDREF(*aChild);
|
||||
|
|
|
@ -438,8 +438,7 @@ PRBool nsMsgI18Nmultibyte_charset(const char *charset)
|
|||
if (NS_SUCCEEDED(res)) {
|
||||
res = ccm2->GetCharsetData2(charsetAtom, NS_LITERAL_STRING(".isMultibyte").get(), &charsetData);
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
result = charsetData.Equals(NS_LITERAL_STRING("true"),
|
||||
nsCaseInsensitiveStringComparator());
|
||||
result = !Compare(charsetData, NS_LITERAL_STRING("true"), nsCaseInsensitiveStringComparator());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2324,8 +2324,9 @@ nsresult nsMsgComposeSendListener::OnStopSending(const char *aMsgID, nsresult aS
|
|||
{
|
||||
if (!fieldsFCC.IsEmpty())
|
||||
{
|
||||
if (fieldsFCC.Equals(NS_LITERAL_STRING("nocopy://"),
|
||||
nsCaseInsensitiveStringComparator()))
|
||||
if (Compare(nsDependentString(fieldsFCC),
|
||||
NS_LITERAL_STRING("nocopy://"),
|
||||
nsCaseInsensitiveStringComparator()) == 0)
|
||||
{
|
||||
compose->NotifyStateListeners(eComposeProcessDone, NS_OK);
|
||||
if (progress)
|
||||
|
@ -3800,8 +3801,7 @@ nsresult nsMsgCompose::TagConvertible(nsIDOMNode *node, PRInt32 *_retval)
|
|||
if (NS_SUCCEEDED(pItem->GetNodeValue(typeValue)))
|
||||
{
|
||||
typeValue.StripChars("\"");
|
||||
if (typeValue.Equals(NS_LITERAL_STRING("cite"),
|
||||
nsCaseInsensitiveStringComparator()))
|
||||
if (!Compare(typeValue, NS_LITERAL_STRING("cite"), nsCaseInsensitiveStringComparator()))
|
||||
*_retval = nsIMsgCompConvertible::Plain;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1680,8 +1680,7 @@ nsMsgComposeAndSend::ProcessMultipartRelated(PRInt32 *aMailboxCount, PRInt32 *aN
|
|||
nsAutoString attributeValue;
|
||||
if (NS_SUCCEEDED(domElement->GetAttribute(NS_LITERAL_STRING("moz-do-not-send"), attributeValue)))
|
||||
{
|
||||
if (attributeValue.Equals(NS_LITERAL_STRING("true"),
|
||||
nsCaseInsensitiveStringComparator()))
|
||||
if (!Compare(attributeValue, NS_LITERAL_STRING("true"), nsCaseInsensitiveStringComparator()))
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -710,12 +710,12 @@ NS_IMETHODIMP nsImapMailFolder::CreateSubfolder(const PRUnichar* folderName, nsI
|
|||
nsresult rv = NS_ERROR_NULL_POINTER;
|
||||
if (!folderName) return rv;
|
||||
|
||||
if ( nsDependentString(folderName).Equals(NS_LITERAL_STRING("Trash"),nsCaseInsensitiveStringComparator()) ) // Trash , a special folder
|
||||
if ( Compare(nsDependentString(folderName),NS_LITERAL_STRING("Trash"),nsCaseInsensitiveStringComparator()) == 0 ) // Trash , a special folder
|
||||
{
|
||||
AlertSpecialFolderExists(msgWindow);
|
||||
return NS_MSG_FOLDER_EXISTS;
|
||||
}
|
||||
else if ( nsDependentString(folderName).Equals(NS_LITERAL_STRING("Inbox"),nsCaseInsensitiveStringComparator()) ) // Inbox, a special folder
|
||||
else if ( Compare(nsDependentString(folderName),NS_LITERAL_STRING("Inbox"),nsCaseInsensitiveStringComparator()) == 0 ) // Inbox, a special folder
|
||||
{
|
||||
AlertSpecialFolderExists(msgWindow);
|
||||
return NS_MSG_FOLDER_EXISTS;
|
||||
|
@ -3923,8 +3923,9 @@ PRBool nsImapMailFolder::ShowDeletedMessages()
|
|||
{
|
||||
nsXPIDLString folderName;
|
||||
GetName(getter_Copies(folderName));
|
||||
if (Substring(folderName,0,convertedName.Length()).Equals(convertedName,
|
||||
nsCaseInsensitiveStringComparator()))
|
||||
if (!Compare(Substring(folderName,0,convertedName.Length()),
|
||||
convertedName,
|
||||
nsCaseInsensitiveStringComparator()))
|
||||
showDeleted = PR_TRUE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -504,7 +504,7 @@ void nsEudoraCompose::ExtractType( nsString& str)
|
|||
// valid multipart!
|
||||
if (str.Length() > 10) {
|
||||
str.Left( tStr, 10);
|
||||
if (tStr.Equals(NS_LITERAL_STRING("multipart/"), nsCaseInsensitiveStringComparator()))
|
||||
if (!Compare(tStr, NS_LITERAL_STRING("multipart/"), nsCaseInsensitiveStringComparator()))
|
||||
str.Truncate();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1030,7 +1030,7 @@ PRBool nsEudoraMac::IsValidMailboxName( nsCString& fName)
|
|||
{
|
||||
if (m_depth > 1)
|
||||
return( PR_TRUE);
|
||||
if (fName.Equals(NS_LITERAL_CSTRING("Eudora Nicknames"), nsCaseInsensitiveCStringComparator()))
|
||||
if (!Compare(fName, NS_LITERAL_CSTRING("Eudora Nicknames"), nsCaseInsensitiveCStringComparator()))
|
||||
return( PR_FALSE);
|
||||
return( PR_TRUE);
|
||||
}
|
||||
|
|
|
@ -694,7 +694,7 @@ void nsEudoraWin32::GetAccountName( const char *pSection, nsString& str)
|
|||
|
||||
nsCString s(pSection);
|
||||
|
||||
if (s.Equals(NS_LITERAL_CSTRING("Settings"), nsCaseInsensitiveCStringComparator())) {
|
||||
if (!Compare(s, NS_LITERAL_CSTRING("Settings"), nsCaseInsensitiveCStringComparator())) {
|
||||
str.Assign(NS_LITERAL_STRING("Eudora "));
|
||||
str.AppendWithConversion( pSection);
|
||||
}
|
||||
|
@ -703,7 +703,7 @@ void nsEudoraWin32::GetAccountName( const char *pSection, nsString& str)
|
|||
str.AssignWithConversion(pSection);
|
||||
if (s.Length() > 8) {
|
||||
s.Left( tStr, 8);
|
||||
if (tStr.Equals(NS_LITERAL_CSTRING("Persona-"), nsCaseInsensitiveCStringComparator())) {
|
||||
if (!Compare(tStr, NS_LITERAL_CSTRING("Persona-"), nsCaseInsensitiveCStringComparator())) {
|
||||
s.Right( tStr, s.Length() - 8);
|
||||
str.AssignWithConversion(tStr.get());
|
||||
}
|
||||
|
@ -1378,8 +1378,9 @@ nsresult nsEudoraWin32::FoundAddressBook( nsIFileSpec *spec, const PRUnichar *pN
|
|||
nsCRT::free( pLeaf);
|
||||
nsString tStr;
|
||||
name.Right( tStr, 4);
|
||||
if (tStr.Equals(NS_LITERAL_STRING(".txt"),
|
||||
nsCaseInsensitiveStringComparator())) {
|
||||
if (! Compare(tStr,
|
||||
NS_LITERAL_STRING(".txt"),
|
||||
nsCaseInsensitiveStringComparator())) {
|
||||
name.Left( tStr, name.Length() - 4);
|
||||
name = tStr;
|
||||
}
|
||||
|
|
|
@ -293,7 +293,7 @@ PRBool nsOEScanBoxes::FindMailBoxes( nsIFileSpec* descFile)
|
|||
#endif
|
||||
|
||||
pEntry->fileName.Right( ext, 4);
|
||||
if (!ext.Equals(mbxExt))
|
||||
if (Compare(ext, mbxExt))
|
||||
pEntry->fileName.Append( ".mbx");
|
||||
|
||||
m_entryArray.AppendElement( pEntry);
|
||||
|
|
|
@ -306,25 +306,24 @@ CGetStoreFoldersIter::CGetStoreFoldersIter( CMapiApi *pApi, CMapiFolderList& fol
|
|||
BOOL CGetStoreFoldersIter::ExcludeFolderClass( const PRUnichar *pName)
|
||||
{
|
||||
BOOL bResult;
|
||||
nsDependentString pNameStr(pName);
|
||||
if (m_isMail) {
|
||||
bResult = FALSE;
|
||||
if (pNameStr.Equals(NS_LITERAL_STRING("IPF.Appointment")))
|
||||
if (!Compare(nsDependentString(pName), NS_LITERAL_STRING("IPF.Appointment")))
|
||||
bResult = TRUE;
|
||||
else if (pNameStr.Equals(NS_LITERAL_STRING("IPF.Contact")))
|
||||
else if (!Compare(nsDependentString(pName), NS_LITERAL_STRING("IPF.Contact")))
|
||||
bResult = TRUE;
|
||||
else if (pNameStr.Equals(NS_LITERAL_STRING("IPF.Journal")))
|
||||
else if (!Compare(nsDependentString(pName), NS_LITERAL_STRING("IPF.Journal")))
|
||||
bResult = TRUE;
|
||||
else if (pNameStr.Equals(NS_LITERAL_STRING("IPF.StickyNote")))
|
||||
else if (!Compare(nsDependentString(pName), NS_LITERAL_STRING("IPF.StickyNote")))
|
||||
bResult = TRUE;
|
||||
else if (pNameStr.Equals(NS_LITERAL_STRING("IPF.Task")))
|
||||
else if (!Compare(nsDependentString(pName), NS_LITERAL_STRING("IPF.Task")))
|
||||
bResult = TRUE;
|
||||
// else if (!stricmp( pName, "IPF.Note"))
|
||||
// bResult = TRUE;
|
||||
}
|
||||
else {
|
||||
bResult = TRUE;
|
||||
if (pNameStr.Equals(NS_LITERAL_STRING("IPF.Contact")))
|
||||
if (!Compare( nsDependentString(pName), NS_LITERAL_STRING("IPF.Contact")))
|
||||
bResult = FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -801,8 +801,8 @@ nsMsgLocalMailFolder::CheckIfFolderExists(const PRUnichar *folderName, nsFileSpe
|
|||
PR_FREEIF(leaf);
|
||||
|
||||
if (!leafName.IsEmpty() &&
|
||||
leafName.Equals(nsDependentString(folderName),
|
||||
nsCaseInsensitiveStringComparator()))
|
||||
Compare(nsDependentString(folderName), leafName,
|
||||
nsCaseInsensitiveStringComparator()) == 0)
|
||||
{
|
||||
if (msgWindow)
|
||||
AlertFolderExists(msgWindow);
|
||||
|
|
|
@ -591,7 +591,7 @@ nsCacheEntryHashTable::MatchEntry(PLDHashTable * /* table */,
|
|||
NS_ASSERTION(key != nsnull, "### nsCacheEntryHashTable::MatchEntry : null key");
|
||||
nsCacheEntry *cacheEntry = ((nsCacheEntryHashTableEntry *)hashEntry)->cacheEntry;
|
||||
|
||||
return cacheEntry->mKey->Equals(*(nsCString *)key);
|
||||
return Compare(*cacheEntry->mKey, *(nsCString *)key) == 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -2132,7 +2132,7 @@ nsFtpState::SendFTPCommand(nsCString& command)
|
|||
|
||||
// we don't want to log the password:
|
||||
nsCAutoString logcmd(command);
|
||||
if (Substring(command, 0, 5).Equals(NS_LITERAL_CSTRING("PASS ")))
|
||||
if (Compare(Substring(command, 0, 5), NS_LITERAL_CSTRING("PASS ")) == 0)
|
||||
logcmd = "PASS xxxxx";
|
||||
|
||||
PR_LOG(gFTPLog, PR_LOG_DEBUG, ("(%x)(dwait=%d) Writing \"%s\"\n", this, mWaitingForDConn, logcmd.get()));
|
||||
|
|
|
@ -542,10 +542,11 @@ mozTXTToHTMLConv::ItMatchesDelimited(const PRUnichar * aInString,
|
|||
nsCRT::IsAsciiDigit(textAfterPos) ||
|
||||
textAfterPos == *rep
|
||||
) ||
|
||||
!Substring(nsDependentString(aInString, aInLength),
|
||||
(before == LT_IGNORE ? 0 : 1),
|
||||
aRepLen).Equals(nsDependentString(rep, aRepLen),
|
||||
nsCaseInsensitiveStringComparator())
|
||||
Compare(Substring(nsDependentString(aInString, aInLength),
|
||||
(before == LT_IGNORE ? 0 : 1),
|
||||
aRepLen),
|
||||
nsDependentString(rep, aRepLen),
|
||||
nsCaseInsensitiveStringComparator())
|
||||
)
|
||||
return PR_FALSE;
|
||||
|
||||
|
@ -977,9 +978,8 @@ mozTXTToHTMLConv::CiteLevelTXT(const PRUnichar *line,
|
|||
const PRUnichar * indexString = &line[logLineStart];
|
||||
// here, |logLineStart < lineLength| is always true
|
||||
PRUint32 minlength = MinInt(6,nsCRT::strlen(indexString));
|
||||
if (Substring(indexString,
|
||||
indexString+minlength).Equals(Substring(NS_LITERAL_STRING(">From "), 0, minlength),
|
||||
nsCaseInsensitiveStringComparator()))
|
||||
if (!Compare(Substring(indexString, indexString+minlength),
|
||||
Substring(NS_LITERAL_STRING(">From "), 0, minlength), nsCaseInsensitiveStringComparator()))
|
||||
//XXX RFC2646
|
||||
moreCites = PR_FALSE;
|
||||
else
|
||||
|
|
|
@ -304,10 +304,8 @@ void nsUnknownDecoder::DetermineContentType(nsIRequest* request)
|
|||
//
|
||||
// If the buffer begins with a mailbox delimiter then it is not HTML
|
||||
//
|
||||
else if (Substring(str, 0, 5).Equals(NS_LITERAL_CSTRING("From "),
|
||||
nsCaseInsensitiveCStringComparator()) ||
|
||||
Substring(str, 0, 6).Equals(NS_LITERAL_CSTRING(">From "),
|
||||
nsCaseInsensitiveCStringComparator())) {
|
||||
else if (!Compare(Substring(str, 0, 5), NS_LITERAL_CSTRING("From "), nsCaseInsensitiveCStringComparator()) ||
|
||||
!Compare(Substring(str, 0, 6), NS_LITERAL_CSTRING(">From "), nsCaseInsensitiveCStringComparator())) {
|
||||
mContentType = TEXT_PLAIN;
|
||||
}
|
||||
//
|
||||
|
|
|
@ -1013,12 +1013,12 @@ nsresult CNavDTD::DidHandleStartTag(nsIParserNode& aNode,eHTMLTags aChildTag){
|
|||
if(theCount) {
|
||||
PRInt32 theIndex=0;
|
||||
for(theIndex=0;theIndex<theCount;theIndex++){
|
||||
const nsAString& theKey = aNode.GetKeyAt(theIndex);
|
||||
if(theKey.Equals(NS_LITERAL_STRING("ENTITY"), nsCaseInsensitiveStringComparator())) {
|
||||
nsAutoString theKey(aNode.GetKeyAt(theIndex));
|
||||
if(!Compare(theKey, NS_LITERAL_STRING("ENTITY"), nsCaseInsensitiveStringComparator())) {
|
||||
const nsString& theName=aNode.GetValueAt(theIndex);
|
||||
theNamePtr=&theName;
|
||||
}
|
||||
else if(theKey.Equals(NS_LITERAL_STRING("VALUE"), nsCaseInsensitiveStringComparator())) {
|
||||
else if(!Compare(theKey, NS_LITERAL_STRING("VALUE"), nsCaseInsensitiveStringComparator())) {
|
||||
//store the named enity with the context...
|
||||
const nsString& theValue=aNode.GetValueAt(theIndex);
|
||||
theValuePtr=&theValue;
|
||||
|
|
|
@ -588,12 +588,12 @@ nsresult COtherDTD::DidHandleStartTag(nsIParserNode& aNode,eHTMLTags aChildTag){
|
|||
if(theCount) {
|
||||
PRInt32 theIndex=0;
|
||||
for(theIndex=0;theIndex<theCount;theIndex++){
|
||||
const nsAString& theKey = aNode.GetKeyAt(theIndex);
|
||||
if(theKey.Equals(NS_LITERAL_STRING("ENTITY"), nsCaseInsensitiveStringComparator())) {
|
||||
nsAutoString theKey(aNode.GetKeyAt(theIndex));
|
||||
if(!Compare(theKey, NS_LITERAL_STRING("ENTITY"), nsCaseInsensitiveStringComparator())) {
|
||||
const nsString& theName=aNode.GetValueAt(theIndex);
|
||||
theNamePtr=&theName;
|
||||
}
|
||||
else if(theKey.Equals(NS_LITERAL_STRING("VALUE"), nsCaseInsensitiveStringComparator())) {
|
||||
else if(!Compare(theKey, NS_LITERAL_STRING("VALUE"), nsCaseInsensitiveStringComparator())) {
|
||||
//store the named enity with the context...
|
||||
const nsString& theValue=aNode.GetValueAt(theIndex);
|
||||
theValuePtr=&theValue;
|
||||
|
|
|
@ -842,10 +842,10 @@ PRInt32 nsDTDContext::IncrementCounter(eHTMLTags aTag,nsIParserNode& aNode,nsStr
|
|||
CAbacus::eNumFormat theNumFormat=CAbacus::eDecimal;
|
||||
|
||||
for(theIndex=0;theIndex<theCount;theIndex++){
|
||||
const nsAString& theKey=aNode.GetKeyAt(theIndex);
|
||||
nsAutoString theKey(aNode.GetKeyAt(theIndex));
|
||||
const nsString& theValue=aNode.GetValueAt(theIndex);
|
||||
|
||||
if(theKey.Equals(NS_LITERAL_STRING("name"), nsCaseInsensitiveStringComparator())){
|
||||
if(!Compare(theKey, NS_LITERAL_STRING("name"), nsCaseInsensitiveStringComparator())){
|
||||
theEntity=GetEntity(theValue);
|
||||
if(!theEntity) {
|
||||
theEntity=RegisterEntity(theValue,theValue);
|
||||
|
@ -853,10 +853,10 @@ PRInt32 nsDTDContext::IncrementCounter(eHTMLTags aTag,nsIParserNode& aNode,nsStr
|
|||
}
|
||||
aTag=eHTMLTag_userdefined;
|
||||
}
|
||||
else if(theKey.Equals(NS_LITERAL_STRING("noincr"), nsCaseInsensitiveStringComparator())){
|
||||
else if(!Compare(theKey, NS_LITERAL_STRING("noincr"), nsCaseInsensitiveStringComparator())){
|
||||
theIncrValue=0;
|
||||
}
|
||||
else if(theKey.Equals(NS_LITERAL_STRING("format"), nsCaseInsensitiveStringComparator())){
|
||||
else if(!Compare(theKey, NS_LITERAL_STRING("format"), nsCaseInsensitiveStringComparator())){
|
||||
PRUnichar theChar=theValue.CharAt(0);
|
||||
if('"'==theChar)
|
||||
theChar=theValue.CharAt(1);
|
||||
|
@ -873,7 +873,7 @@ PRInt32 nsDTDContext::IncrementCounter(eHTMLTags aTag,nsIParserNode& aNode,nsStr
|
|||
}
|
||||
//determine numbering style
|
||||
}
|
||||
else if(theKey.Equals(NS_LITERAL_STRING("value"), nsCaseInsensitiveStringComparator())){
|
||||
else if(!Compare(theKey, NS_LITERAL_STRING("value"), nsCaseInsensitiveStringComparator())){
|
||||
PRInt32 err=0;
|
||||
theNewValue=theValue.ToInteger(&err);
|
||||
if(!err) {
|
||||
|
|
|
@ -413,7 +413,7 @@ void nsHTMLContentSinkStream::WriteAttributes(const nsIParserNode& aNode)
|
|||
if(theCount) {
|
||||
int i=0;
|
||||
for(i=0;i<theCount;i++){
|
||||
const nsAString& key = aNode.GetKeyAt(i);
|
||||
nsAutoString key(aNode.GetKeyAt(i));
|
||||
|
||||
// See if there's an attribute:
|
||||
// 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);
|
||||
|
||||
// Filter out any attribute starting with _moz
|
||||
if (key.Equals(NS_LITERAL_STRING("_moz"), nsCaseInsensitiveStringComparator()))
|
||||
if (!Compare(key, NS_LITERAL_STRING("_moz"), nsCaseInsensitiveStringComparator())
|
||||
continue;
|
||||
|
||||
//
|
||||
|
@ -437,8 +437,8 @@ void nsHTMLContentSinkStream::WriteAttributes(const nsIParserNode& aNode)
|
|||
// used by the editor. Bug 16988. Yuck.
|
||||
//
|
||||
if ((eHTMLTags)aNode.GetNodeType() == eHTMLTag_br
|
||||
&& key.Equals(NS_LITERAL_STRING("type"), nsCaseInsensitiveStringComparator())
|
||||
&& value.Equals(NS_LITERAL_STRING("_moz")))
|
||||
&& (!Compare((key, NS_LITERAL_STRING("type"), nsCaseInsensitiveStringComparator())
|
||||
&& value.Equals(NS_LITERAL_STRING("_moz")))))
|
||||
continue;
|
||||
|
||||
if (mLowerCaseTags == PR_TRUE)
|
||||
|
@ -456,8 +456,8 @@ void nsHTMLContentSinkStream::WriteAttributes(const nsIParserNode& aNode)
|
|||
|
||||
// Make all links absolute when converting only the selection:
|
||||
if ((mFlags & nsIDocumentEncoder::OutputAbsoluteLinks)
|
||||
&& (key.Equals(NS_LITERAL_STRING("href"), nsCaseInsensitiveStringComparator())
|
||||
|| key.Equals(NS_LITERAL_STRING("src"), nsCaseInsensitiveStringComparator())
|
||||
&& (!Compare(key, NS_LITERAL_STRING("href"), nsCaseInsensitiveStringComparator())
|
||||
|| !Compare(key, NS_LITERAL_STRING("src"), nsCaseInsensitiveStringComparator())
|
||||
// Would be nice to handle OBJECT and APPLET tags,
|
||||
// but that gets more complicated since we have to
|
||||
// search the tag list for CODEBASE as well.
|
||||
|
|
|
@ -1203,7 +1203,7 @@ NS_IMETHODIMP CViewSourceHTML::HandleToken(CToken* aToken,nsIParser* aParser) {
|
|||
{
|
||||
nsAutoString theStr;
|
||||
theStr.Assign(aToken->GetStringValue());
|
||||
if(!theStr.Equals(NS_LITERAL_STRING("XI"), nsCaseInsensitiveStringComparator())) {
|
||||
if(Compare(theStr, NS_LITERAL_STRING("XI"), nsCaseInsensitiveStringComparator()) != 0) {
|
||||
PRUnichar theChar=theStr.CharAt(0);
|
||||
if((nsCRT::IsAsciiDigit(theChar)) || ('X'==theChar) || ('x'==theChar)){
|
||||
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
|
||||
if (Substring(uri, 0, 4).Equals(NS_LITERAL_STRING("urn:")) ||
|
||||
Substring(uri, 0, 9).Equals(NS_LITERAL_STRING("chrome:")) ||
|
||||
Substring(uri, 0, 3).Equals(NS_LITERAL_STRING("nc:"),
|
||||
nsCaseInsensitiveStringComparator())) {
|
||||
!Compare(Substring(uri, 0, 3), NS_LITERAL_STRING("nc:"),
|
||||
nsCaseInsensitiveStringComparator())) {
|
||||
return PR_FALSE;
|
||||
}
|
||||
return PR_TRUE;
|
||||
|
|
|
@ -1744,8 +1744,9 @@ nsresult nsExternalHelperAppService::GetMIMEInfoForExtensionFromExtras(const cha
|
|||
while (start != end)
|
||||
{
|
||||
FindCharInReadable(',', iter, end);
|
||||
if (Substring(start, iter).Equals(extension,
|
||||
nsCaseInsensitiveCStringComparator()))
|
||||
if (Compare(Substring(start, iter),
|
||||
extension,
|
||||
nsCaseInsensitiveCStringComparator()) == 0)
|
||||
{
|
||||
// This is the one. Create MIMEInfo object and set
|
||||
// attributes appropriately.
|
||||
|
|
|
@ -442,8 +442,9 @@ GetTypeAndDescriptionFromMimetypesFile(const nsAString& aFilename,
|
|||
|
||||
while (start != end) {
|
||||
FindCharInReadable(',', iter, end);
|
||||
if (Substring(start, iter).Equals(aFileExtension,
|
||||
nsCaseInsensitiveStringComparator())) {
|
||||
if (Compare(Substring(start, iter),
|
||||
aFileExtension,
|
||||
nsCaseInsensitiveStringComparator()) == 0) {
|
||||
// it's a match. Assign the type and description and run
|
||||
aMajorType.Assign(Substring(majorTypeStart, majorTypeEnd));
|
||||
aMinorType.Assign(Substring(minorTypeStart, minorTypeEnd));
|
||||
|
@ -573,12 +574,12 @@ GetExtensionsAndDescriptionFromMimetypesFile(const nsAString& aFilename,
|
|||
}
|
||||
#endif
|
||||
if (NS_SUCCEEDED(rv) &&
|
||||
Substring(majorTypeStart,
|
||||
majorTypeEnd).Equals(aMajorType,
|
||||
nsCaseInsensitiveStringComparator())&&
|
||||
Substring(minorTypeStart,
|
||||
minorTypeEnd).Equals(aMinorType,
|
||||
nsCaseInsensitiveStringComparator())) {
|
||||
Compare(Substring(majorTypeStart, majorTypeEnd),
|
||||
aMajorType,
|
||||
nsCaseInsensitiveStringComparator()) == 0 &&
|
||||
Compare(Substring(minorTypeStart, minorTypeEnd),
|
||||
aMinorType,
|
||||
nsCaseInsensitiveStringComparator()) == 0) {
|
||||
// it's a match
|
||||
aFileExtensions.Assign(extensions);
|
||||
aDescription.Assign(Substring(descriptionStart, descriptionEnd));
|
||||
|
@ -947,14 +948,13 @@ GetHandlerAndDescriptionFromMailcapFile(const nsAString& aFilename,
|
|||
rv = ParseMIMEType(start_iter, majorTypeStart, majorTypeEnd,
|
||||
minorTypeStart, minorTypeEnd, semicolon_iter);
|
||||
if (NS_SUCCEEDED(rv) &&
|
||||
Substring(majorTypeStart,
|
||||
majorTypeEnd).Equals(aMajorType,
|
||||
nsCaseInsensitiveStringComparator()) &&
|
||||
(Substring(minorTypeStart,
|
||||
minorTypeEnd).Equals(NS_LITERAL_STRING("*")) ||
|
||||
Substring(minorTypeStart,
|
||||
minorTypeEnd).Equals(aMinorType,
|
||||
nsCaseInsensitiveStringComparator()))) { // we have a match
|
||||
Compare(Substring(majorTypeStart, majorTypeEnd),
|
||||
aMajorType,
|
||||
nsCaseInsensitiveStringComparator()) == 0 &&
|
||||
(Substring(minorTypeStart, minorTypeEnd).Equals(NS_LITERAL_STRING("*")) ||
|
||||
Compare(Substring(minorTypeStart, minorTypeEnd),
|
||||
aMinorType,
|
||||
nsCaseInsensitiveStringComparator()) == 0)) { // we have a match
|
||||
PRBool match = PR_TRUE;
|
||||
++semicolon_iter; // point at the first char past the semicolon
|
||||
start_iter = semicolon_iter; // handler string starts here
|
||||
|
|
|
@ -934,22 +934,27 @@ BookmarkParser::Unescape(nsString &text)
|
|||
|
||||
while((offset = text.FindChar((PRUnichar('&')), offset)) >= 0)
|
||||
{
|
||||
if (Substring(text, offset, 4).Equals(NS_LITERAL_STRING("<"), nsCaseInsensitiveStringComparator()))
|
||||
// XXX get max of 6 chars; change the value below if
|
||||
// we ever start looking for longer HTML-escaped values
|
||||
nsAutoString temp;
|
||||
text.Mid(temp, offset, 6);
|
||||
|
||||
if (Compare(Substring(temp, 0, 4), NS_LITERAL_STRING("<"), nsCaseInsensitiveStringComparator()) == 0)
|
||||
{
|
||||
text.Cut(offset, 4);
|
||||
text.Insert(PRUnichar('<'), offset);
|
||||
}
|
||||
else if (Substring(text, offset, 4).Equals(NS_LITERAL_STRING(">"), nsCaseInsensitiveStringComparator()))
|
||||
if (Compare(Substring(temp, 0, 4), NS_LITERAL_STRING(">"), nsCaseInsensitiveStringComparator()) == 0)
|
||||
{
|
||||
text.Cut(offset, 4);
|
||||
text.Insert(PRUnichar('>'), offset);
|
||||
}
|
||||
else if (Substring(text, offset, 5).Equals(NS_LITERAL_STRING("&"), nsCaseInsensitiveStringComparator()))
|
||||
if (Compare(Substring(temp, 0, 5), NS_LITERAL_STRING("&"), nsCaseInsensitiveStringComparator()) == 0)
|
||||
{
|
||||
text.Cut(offset, 5);
|
||||
text.Insert(PRUnichar('&'), offset);
|
||||
}
|
||||
else if (Substring(text, offset, 6).Equals(NS_LITERAL_STRING("""), nsCaseInsensitiveStringComparator()))
|
||||
if (Compare(Substring(temp, 0, 6), NS_LITERAL_STRING("""), nsCaseInsensitiveStringComparator()) == 0)
|
||||
{
|
||||
text.Cut(offset, 6);
|
||||
text.Insert(PRUnichar('\"'), offset);
|
||||
|
|
|
@ -556,22 +556,27 @@ RelatedLinksStreamListener::Unescape(nsString &text)
|
|||
|
||||
while((offset = text.FindChar((PRUnichar('&')), offset)) >= 0)
|
||||
{
|
||||
if (Substring(text, offset, 4).Equals(NS_LITERAL_STRING("<"), nsCaseInsensitiveStringComparator()))
|
||||
// XXX get max of 6 chars; change the value below if
|
||||
// we ever start looking for longer HTML-escaped values
|
||||
nsAutoString temp;
|
||||
text.Mid(temp, offset, 6);
|
||||
|
||||
if (Compare(Substring(temp, 0, 4), NS_LITERAL_STRING("<"), nsCaseInsensitiveStringComparator()) == 0)
|
||||
{
|
||||
text.Cut(offset, 4);
|
||||
text.Insert(PRUnichar('<'), offset);
|
||||
}
|
||||
else if (Substring(text, offset, 4).Equals(NS_LITERAL_STRING(">"), nsCaseInsensitiveStringComparator()))
|
||||
if (Compare(Substring(temp, 0, 4), NS_LITERAL_STRING(">"), nsCaseInsensitiveStringComparator()) == 0)
|
||||
{
|
||||
text.Cut(offset, 4);
|
||||
text.Insert(PRUnichar('>'), offset);
|
||||
}
|
||||
else if (Substring(text, offset, 5).Equals(NS_LITERAL_STRING("&"), nsCaseInsensitiveStringComparator()))
|
||||
if (Compare(Substring(temp, 0, 5), NS_LITERAL_STRING("&"), nsCaseInsensitiveStringComparator()) == 0)
|
||||
{
|
||||
text.Cut(offset, 5);
|
||||
text.Insert(PRUnichar('&'), offset);
|
||||
}
|
||||
else if (Substring(text, offset, 6).Equals(NS_LITERAL_STRING("""), nsCaseInsensitiveStringComparator()))
|
||||
if (Compare(Substring(temp, 0, 6), NS_LITERAL_STRING("""), nsCaseInsensitiveStringComparator()) == 0)
|
||||
{
|
||||
text.Cut(offset, 6);
|
||||
text.Insert(PRUnichar('\"'), offset);
|
||||
|
|
|
@ -337,9 +337,9 @@ nsUrlbarHistory::SearchPreviousResults(const PRUnichar *searchStr, nsIAutoComple
|
|||
// which doesn't make any sense (since the "!= 0" was inside the
|
||||
// parentheses)
|
||||
if (searchStrLen < prevSearchStrLen ||
|
||||
!Substring(searchStr,
|
||||
searchStr+prevSearchStrLen).Equals(nsDependentString(prevSearchString, prevSearchStrLen),
|
||||
nsCaseInsensitiveStringComparator()))
|
||||
Compare(Substring(searchStr, searchStr+prevSearchStrLen),
|
||||
nsDependentString(prevSearchString, prevSearchStrLen),
|
||||
nsCaseInsensitiveStringComparator())!= 0)
|
||||
return NS_ERROR_ABORT;
|
||||
|
||||
nsCOMPtr<nsISupportsArray> array;
|
||||
|
@ -368,9 +368,9 @@ nsUrlbarHistory::SearchPreviousResults(const PRUnichar *searchStr, nsIAutoComple
|
|||
|
||||
if (itemValue.IsEmpty())
|
||||
continue;
|
||||
if (nsDependentString(searchStr,
|
||||
searchStrLen).Equals(Substring(itemValue, 0, searchStrLen),
|
||||
nsCaseInsensitiveStringComparator()))
|
||||
if (Compare(nsDependentString(searchStr, searchStrLen),
|
||||
Substring(itemValue, 0, searchStrLen),
|
||||
nsCaseInsensitiveStringComparator()) == 0)
|
||||
continue;
|
||||
|
||||
}
|
||||
|
@ -626,8 +626,8 @@ nsUrlbarHistory::CheckItemAvailability(const PRUnichar * aItem, nsIAutoCompleteR
|
|||
resultItem->GetValue(itemValue);
|
||||
// Using nsIURI to do comparisons didn't quite work out.
|
||||
// So use nsCRT methods
|
||||
if (itemValue.Equals(nsDependentString(aItem),
|
||||
nsCaseInsensitiveStringComparator()))
|
||||
if (Compare(itemValue, nsDependentString(aItem),
|
||||
nsCaseInsensitiveStringComparator()) == 0)
|
||||
{
|
||||
//printf("In CheckItemAvailability. Item already found\n");
|
||||
*aResult = PR_TRUE;
|
||||
|
|
Загрузка…
Ссылка в новой задаче