sync with nsString2 API

This commit is contained in:
rickg%netscape.com 1999-04-20 07:20:21 +00:00
parent eed35517f2
commit e1012f40b9
13 changed files with 20 additions and 19 deletions

View File

@ -276,7 +276,7 @@ nsChromeRegistry::ConvertChromeURL(nsIURL* aChromeURL)
PRInt32 length = chromeBase.Length();
if (length > 0)
{
PRUnichar c = chromeBase[length-1];
PRUnichar c = chromeBase.CharAt(length-1);
if (c != '/')
chromeBase += "/"; // Ensure that a slash is present.
}
@ -289,7 +289,7 @@ nsChromeRegistry::ConvertChromeURL(nsIURL* aChromeURL)
PRInt32 length = restOfURL.Length();
if (length > 0)
{
PRUnichar c = restOfURL[length-1];
PRUnichar c = restOfURL.CharAt(length-1);
if (c != '/')
restOfURL += "/"; // Ensure that a slash is present.
}

View File

@ -84,7 +84,7 @@ PRBool nsTextEditRules::IsEditable(nsIDOMNode *aNode)
if (0==data.Length()) {
return PR_FALSE;
}
if ('\n'==data[0]) {
if ('\n'==data.CharAt(0)) {
return PR_FALSE;
}
else {

View File

@ -84,7 +84,7 @@ PRBool nsTextEditRules::IsEditable(nsIDOMNode *aNode)
if (0==data.Length()) {
return PR_FALSE;
}
if ('\n'==data[0]) {
if ('\n'==data.CharAt(0)) {
return PR_FALSE;
}
else {

View File

@ -1449,7 +1449,7 @@ nsFrame::XMLQuote(nsString& aString)
{
PRInt32 i, len = aString.Length();
for (i = 0; i < len; i++) {
PRUnichar ch = aString[i];
PRUnichar ch = aString.CharAt(i);
if (ch == '<') {
nsAutoString tmp("&lt;");
aString.Cut(i, 1);

View File

@ -1449,7 +1449,7 @@ nsFrame::XMLQuote(nsString& aString)
{
PRInt32 i, len = aString.Length();
for (i = 0; i < len; i++) {
PRUnichar ch = aString[i];
PRUnichar ch = aString.CharAt(i);
if (ch == '<') {
nsAutoString tmp("&lt;");
aString.Cut(i, 1);

View File

@ -514,7 +514,7 @@ nsTitledButtonFrame::CalculateTitleForWidth(nsIPresContext& aPresContext, nsIRen
int i = 0;
for (i = 0; i < length; i++)
{
PRUnichar ch = mTitle[i];
PRUnichar ch = mTitle.CharAt(i);
aRenderingContext.GetWidth(ch,cwidth);
if (twidth + cwidth > aWidth)
break;
@ -541,7 +541,7 @@ nsTitledButtonFrame::CalculateTitleForWidth(nsIPresContext& aPresContext, nsIRen
int i = length-1;
for (i=length-1; i >= 0; i--)
{
PRUnichar ch = mTitle[i];
PRUnichar ch = mTitle.CharAt(i);
aRenderingContext.GetWidth(ch,cwidth);
if (twidth + cwidth > aWidth)
break;

View File

@ -271,7 +271,7 @@ PRBool INTL_7bit_data_part(const char *charset, const char *inString, const PRUi
PR_Free(aCString);
if (NS_SUCCEEDED(res)) {
for (PRInt32 i = 0; i < outString.Length(); i++) {
if (outString[i] > 127) {
if (outString.CharAt(i) > 127) {
return PR_FALSE;
}
}

View File

@ -122,7 +122,8 @@ NS_IMETHODIMP nsMsgLocalMailFolder::QueryInterface(REFNSIID aIID, void** aInstan
static PRBool
nsShouldIgnoreFile(nsString& name)
{
if (name[0] == '.' || name[0] == '#' || name[name.Length() - 1] == '~')
PRUnichar firstChar=name.CharAt(0);
if (firstChar == '.' || firstChar == '#' || name.CharAt(name.Length() - 1) == '~')
return PR_TRUE;
if (name.EqualsIgnoreCase("rules.dat"))

View File

@ -303,11 +303,11 @@ rdf_IsAnonymousResource(const nsString& aContextURI, nsIRDFResource* aResource)
uri.Cut(0, aContextURI.Length());
// Anonymous resources look like the regexp "\$[0-9]+"
if (uri[0] != '#' || uri[1] != '$')
if (uri.CharAt(0) != '#' || uri.CharAt(1) != '$')
return PR_FALSE;
for (PRInt32 i = uri.Length() - 1; i >= 1; --i) {
if (uri[i] < '0' || uri[i] > '9')
if (uri.CharAt(i) < '0' || uri.CharAt(i) > '9')
return PR_FALSE;
}

View File

@ -276,7 +276,7 @@ nsChromeRegistry::ConvertChromeURL(nsIURL* aChromeURL)
PRInt32 length = chromeBase.Length();
if (length > 0)
{
PRUnichar c = chromeBase[length-1];
PRUnichar c = chromeBase.CharAt(length-1);
if (c != '/')
chromeBase += "/"; // Ensure that a slash is present.
}
@ -289,7 +289,7 @@ nsChromeRegistry::ConvertChromeURL(nsIURL* aChromeURL)
PRInt32 length = restOfURL.Length();
if (length > 0)
{
PRUnichar c = restOfURL[length-1];
PRUnichar c = restOfURL.CharAt(length-1);
if (c != '/')
restOfURL += "/"; // Ensure that a slash is present.
}

View File

@ -2247,14 +2247,14 @@ RDFXULBuilderImpl::CreateBuilder(const nsCID& aBuilderCID, nsIContent* aElement,
PRInt32 first = 0;
while(1) {
while (first < aDataSources.Length() && nsString::IsSpace(aDataSources[first]))
while (first < aDataSources.Length() && nsString::IsSpace(aDataSources.CharAt(first)))
++first;
if (first >= aDataSources.Length())
break;
PRInt32 last = first;
while (last < aDataSources.Length() && !nsString::IsSpace(aDataSources[last]))
while (last < aDataSources.Length() && !nsString::IsSpace(aDataSources.CharAt(last)))
++last;
nsAutoString uri;

View File

@ -250,9 +250,9 @@ BookmarkParser::Parse(nsIRDFResource* aContainer)
rv = ParseBookmark(line, aContainer);
}
else if ((offset = line.Find(kOpenHeading)) >= 0 &&
nsString::IsDigit(line[offset + 2])) {
nsString::IsDigit(line.CharAt(offset + 2))) {
// XXX Ignore <H1> so that bookmarks root _is_ <H1>
if (line[offset + 2] != PRUnichar('1'))
if (line.CharAt(offset + 2) != PRUnichar('1'))
rv = ParseBookmarkHeader(line, aContainer);
}
else if ((offset = line.Find(kSeparator)) >= 0) {

View File

@ -355,7 +355,7 @@ nsWebCrawler::GetOutputFile(nsIURL *aURL, nsString& aOutputName)
char *c = inputFileName;
for (PRInt32 i=fileNameOffset+1; i<fileNameOffset+len; i++)
{
char ch = (char) inputFileFullPath[i];
char ch = (char) inputFileFullPath.CharAt(i);
if (ch == '.') {
// Stop on dot so that we don't keep the old extension
break;