Bug 113228: Replace ns{C}String::To{Upper,Lower}Case with global versions. r=bzbarsky, sr=jst

git-svn-id: svn://10.0.0.236/trunk@110611 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
jaggernaut%netscape.com
2001-12-17 07:14:49 +00:00
parent 28a3b1348b
commit 576ec93128
134 changed files with 759 additions and 216 deletions

View File

@@ -34,6 +34,7 @@ REQUIRES = xpcom \
necko \
docshell \
uriloader \
unicharutil \
$(NULL)
CPPSRCS = nsDebugRobot.cpp nsRobotSink.cpp

View File

@@ -33,11 +33,13 @@ REQUIRES = xpcom \
necko \
docshell \
uriloader \
unicharutil \
$(NULL)
include <$(DEPTH)\config\config.mak>
LLIBS= \
$(DIST)\lib\unicharutil_s.lib \
$(DIST)\lib\xpcom.lib \
$(LIBNSPR) \
!ifndef NECKO

View File

@@ -42,6 +42,7 @@
#include "nsIParser.h"
#include "nsString.h"
#include "nsReadableUtils.h"
#include "nsUnicharUtils.h"
#include "nsIURL.h"
#include "nsIURL.h"
#include "nsIServiceManager.h"
@@ -243,7 +244,7 @@ NS_IMETHODIMP RobotSink::CloseFrameset(const nsIParserNode& aNode)
NS_IMETHODIMP RobotSink::OpenContainer(const nsIParserNode& aNode)
{
nsAutoString tmp; tmp.Assign(aNode.GetText());
tmp.ToLowerCase();
ToLowerCase(tmp);
if (tmp.Equals(NS_LITERAL_STRING("a"))) {
nsAutoString k, v;
PRInt32 ac = aNode.GetAttributeCount();
@@ -251,7 +252,7 @@ NS_IMETHODIMP RobotSink::OpenContainer(const nsIParserNode& aNode)
// Get upper-cased key
const nsAReadableString& key = aNode.GetKeyAt(i);
k.Assign(key);
k.ToLowerCase();
ToLowerCase(k);
if (k.Equals(NS_LITERAL_STRING("href"))) {
// Get value and remove mandatory quotes
v.Truncate();

View File

@@ -43,6 +43,7 @@ endif
LIBS = \
$(EXTRA_DSO_LIBS) \
$(MOZ_UNICHARUTIL_LIBS) \
$(MOZ_COMPONENT_LIBS) \
$(NULL)

View File

@@ -31,6 +31,7 @@ PROGRAM = .\$(OBJDIR)\htmlrobot.exe
LLIBS= \
$(DIST)\lib\DebugRobot.lib \
$(DIST)\lib\unicharutil_s.lib \
$(DIST)\lib\xpcom.lib \
$(LIBNSPR) \
$(NULL)

View File

@@ -442,9 +442,9 @@ void nsHTMLContentSinkStream::WriteAttributes(const nsIParserNode& aNode)
continue;
if (mLowerCaseTags == PR_TRUE)
key.ToLowerCase();
ToLowerCase(key);
else
key.ToUpperCase();
ToUpperCase(key);
EnsureBufferSize(key.Length() + 1);
key.ToCString(mBuffer,mBufferSize);
@@ -661,9 +661,9 @@ void nsHTMLContentSinkStream::AddStartTag(const nsIParserNode& aNode)
}
if (mLowerCaseTags == PR_TRUE)
tagName.ToLowerCase();
ToLowerCase(tagName);
else
tagName.ToUpperCase();
ToUpperCase(tagName);
#ifdef DEBUG_prettyprint
if (isDirty)
@@ -777,9 +777,9 @@ void nsHTMLContentSinkStream::AddEndTag(const nsIParserNode& aNode)
tagName.AssignWithConversion(nsHTMLTags::GetStringValue(tag));
}
if (mLowerCaseTags == PR_TRUE)
tagName.ToLowerCase();
ToLowerCase(tagName);
// else
// tagName.ToUpperCase();
// ToUpperCase(tagName);
if (IndentChildren(tag))
mIndent--;

View File

@@ -352,7 +352,7 @@ nsHTMLTags::AddRefTable(void)
for (i = 0; i < NS_HTML_TAG_MAX; ++i) {
nsCAutoString temp1(kTagASCIIDebugTable[i]);
nsCAutoString temp2(kTagASCIIDebugTable[i]);
temp1.ToLowerCase();
ToLowerCase(temp1);
NS_ASSERTION(temp1.Equals(temp2), "upper case char in table");
}

View File

@@ -49,6 +49,7 @@
#include "nsHTMLEntities.h"
#include "CParserContext.h"
#include "nsReadableUtils.h"
#include "nsUnicharUtils.h"
/************************************************************************
And now for the main class -- nsHTMLTokenizer...
@@ -974,7 +975,7 @@ nsresult nsHTMLTokenizer::ConsumeSpecialMarkup(PRUnichar aChar,CToken*& aToken,n
nsresult result=NS_OK;
nsAutoString theBufCopy;
aScanner.Peek(theBufCopy, 20);
theBufCopy.ToUpperCase();
ToUpperCase(theBufCopy);
PRInt32 theIndex=theBufCopy.Find("DOCTYPE");
nsTokenAllocator* theAllocator=this->GetTokenAllocator();

View File

@@ -980,7 +980,7 @@ static void VerifyPublicIDs()
}
for (i = 0; i < ELEMENTS_OF(kPublicIDs); ++i) {
nsCAutoString lcPubID(kPublicIDs[i].name);
lcPubID.ToLowerCase();
ToLowerCase(lcPubID);
if (nsCRT::strcmp(kPublicIDs[i].name, lcPubID.get()) != 0) {
NS_NOTREACHED("doctype not lower case");
printf("Doctype %s not lower case.\n", kPublicIDs[i].name);
@@ -1029,7 +1029,7 @@ static void DetermineHTMLParseMode(nsString& aBuffer,
// See comment above definition of kPublicIDs about case
// sensitivity.
publicID.ToLowerCase();
ToLowerCase(publicID);
// binary search to see if we can find the correct public ID
// These must be signed since maximum can go below zero and we'll