convert nsCRT::strn?cmp to Convert() for bug 100214, to depend on string rather than xpcom for case-insensitive unicode support. r=sspitzer for mail stuff, r=jag for everything else, sr=sfraser

git-svn-id: svn://10.0.0.236/trunk@105318 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
alecf%netscape.com
2001-10-13 00:16:32 +00:00
parent daa3b327a3
commit f7b48fa3b1
56 changed files with 382 additions and 265 deletions

View File

@@ -63,6 +63,7 @@
#include "nsIFrame.h"
#include "nsString.h"
#include "nsReadableUtils.h"
#include "nsUnicharUtils.h"
#include "nsVoidArray.h"
#include "nsIUnicharInputStream.h"
#include "nsHTMLIIDs.h"
@@ -186,6 +187,10 @@ PRBool AtomKey_base::Equals(const nsHashKey* aKey) const
return PRBool (((AtomKey_base*)aKey)->mAtom == mAtom);
}
// first try case-sensitive match
if (((AtomKey_base*)aKey)->mAtom == mAtom)
return PR_TRUE;
#ifdef DEBUG_HASH
DebugHashCount(PR_FALSE);
#endif
@@ -197,7 +202,9 @@ PRBool AtomKey_base::Equals(const nsHashKey* aKey) const
const PRUnichar *theirStr = nsnull;
theirAtom->GetUnicode(&theirStr);
return nsCRT::strcasecmp(myStr, theirStr) == 0;
return Compare(nsDependentString(myStr),
nsDependentString(theirStr),
nsCaseInsensitiveStringComparator()) == 0;
}
@@ -3367,7 +3374,9 @@ static PRBool ValueIncludes(const nsString& aValueList, const nsString& aValue,
}
}
else {
if (!nsCRT::strcasecmp(value, start)) {
if (!Compare(nsDependentString(value),
nsDependentString(start),
nsCaseInsensitiveStringComparator())) {
return PR_TRUE;
}
}