From b89e506039cc024e1cfac4aa6063567783af78ec Mon Sep 17 00:00:00 2001 From: "rickg%netscape.com" Date: Mon, 26 Jul 1999 00:47:36 +0000 Subject: [PATCH] replaced call to deprecated nsString API git-svn-id: svn://10.0.0.236/trunk@41077 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/chrome/src/nsChromeRegistry.cpp | 2 +- mozilla/network/module/nsNetService.cpp | 6 +++--- mozilla/network/protocol/http/nsCookie.cpp | 16 ++++++++-------- mozilla/rdf/base/src/nsRDFParserUtils.cpp | 6 +++--- mozilla/rdf/base/src/nsRDFXMLDataSource.cpp | 6 +++--- mozilla/rdf/chrome/src/nsChromeRegistry.cpp | 2 +- mozilla/rdf/content/src/nsRDFContentUtils.cpp | 2 +- .../rdf/datasource/src/nsSearchDataSource.cpp | 12 ++++++------ mozilla/rdf/datasource/src/nsXULContentSink.cpp | 2 +- 9 files changed, 27 insertions(+), 27 deletions(-) diff --git a/mozilla/chrome/src/nsChromeRegistry.cpp b/mozilla/chrome/src/nsChromeRegistry.cpp index 93c8d58ce15..735e2c65189 100644 --- a/mozilla/chrome/src/nsChromeRegistry.cpp +++ b/mozilla/chrome/src/nsChromeRegistry.cpp @@ -293,7 +293,7 @@ nsChromeRegistry::ConvertChromeURL(nsIURI* aChromeURL) { // There is something to the right of that slash. A provider type must have // been specified. - slashIndex = restOfURL.Find('/', 1); + slashIndex = restOfURL.FindChar('/', PR_FALSE,1); if (slashIndex == -1) slashIndex = restOfURL.Length(); diff --git a/mozilla/network/module/nsNetService.cpp b/mozilla/network/module/nsNetService.cpp index e408413a612..fb35db1bf93 100644 --- a/mozilla/network/module/nsNetService.cpp +++ b/mozilla/network/module/nsNetService.cpp @@ -860,7 +860,7 @@ nsNetlibService::SetProxyHTTP(nsString& aProxyHTTP) { return NS_OK; } - if ( (colonIdx = aProxyHTTP.Find(colon)) < 0 ) + if ( (colonIdx = aProxyHTTP.FindChar(colon)) < 0 ) return NS_FALSE; aProxyHTTP.Left(nsSProxy, colonIdx); @@ -964,7 +964,7 @@ nsNetlibService::SetCustomUserAgent(nsString aCustom) nsString newAppVersion = XP_AppVersion; - inIdx = newAppVersion.Find(inChar); + inIdx = newAppVersion.FindChar(inChar); if (0 > inIdx) { newAppVersion.Insert(aCustom, inIdx + 1); } @@ -1074,7 +1074,7 @@ nsNetlibService::CreateURL(nsIURI* *aURL, nsILoadGroup* aGroup) { nsAutoString protoName; - PRInt32 pos = aSpec.Find(':'); + PRInt32 pos = aSpec.FindChar(':'); if (pos >= 0) { aSpec.Left(protoName, pos); } diff --git a/mozilla/network/protocol/http/nsCookie.cpp b/mozilla/network/protocol/http/nsCookie.cpp index ced0d8416f2..d8aa0628fef 100644 --- a/mozilla/network/protocol/http/nsCookie.cpp +++ b/mozilla/network/protocol/http/nsCookie.cpp @@ -1899,7 +1899,7 @@ net_ReadCookiePermissions() int hostIndex, permissionIndex; hostIndex = 0; - if ((permissionIndex=buffer->Find('\t', hostIndex)+1) == 0) { + if ((permissionIndex=buffer->FindChar('\t',PR_FALSE, hostIndex)+1) == 0) { PR_Free(buffer); continue; } @@ -2080,12 +2080,12 @@ net_ReadCookies() int hostIndex, isDomainIndex, pathIndex, xxxIndex, expiresIndex, nameIndex, cookieIndex; hostIndex = 0; - if ((isDomainIndex=buffer->Find('\t', hostIndex)+1) == 0 || - (pathIndex=buffer->Find('\t', isDomainIndex)+1) == 0 || - (xxxIndex=buffer->Find('\t', pathIndex)+1) == 0 || - (expiresIndex=buffer->Find('\t', xxxIndex)+1) == 0 || - (nameIndex=buffer->Find('\t', expiresIndex)+1) == 0 || - (cookieIndex=buffer->Find('\t', nameIndex)+1) == 0 ) { + if ((isDomainIndex=buffer->FindChar('\t', PR_FALSE,hostIndex)+1) == 0 || + (pathIndex=buffer->FindChar('\t', PR_FALSE,isDomainIndex)+1) == 0 || + (xxxIndex=buffer->FindChar('\t', PR_FALSE,pathIndex)+1) == 0 || + (expiresIndex=buffer->FindChar('\t', PR_FALSE,xxxIndex)+1) == 0 || + (nameIndex=buffer->FindChar('\t', PR_FALSE,expiresIndex)+1) == 0 || + (cookieIndex=buffer->FindChar('\t', PR_FALSE,nameIndex)+1) == 0 ) { PR_Free(buffer); continue; } @@ -2802,7 +2802,7 @@ cookie_FindValueInArgs(nsAutoString results, char* name) { return nsAutoString("").ToNewCString(); } start += PL_strlen(name); /* get passed the |name| part */ - length = results.Find('|', start) - start; + length = results.FindChar('|', PR_FALSE,start) - start; results.Mid(value, start, length); return value.ToNewCString(); } diff --git a/mozilla/rdf/base/src/nsRDFParserUtils.cpp b/mozilla/rdf/base/src/nsRDFParserUtils.cpp index a6e884fe61a..b50149e5668 100644 --- a/mozilla/rdf/base/src/nsRDFParserUtils.cpp +++ b/mozilla/rdf/base/src/nsRDFParserUtils.cpp @@ -210,14 +210,14 @@ static const char kApostrophe = '\''; offset = aSource.Find(aAttribute); if (-1 != offset) { - offset = aSource.Find('=', offset); + offset = aSource.FindChar('=', PR_FALSE,offset); PRUnichar next = aSource.CharAt(++offset); if (kQuote == next) { - endOffset = aSource.Find(kQuote, ++offset); + endOffset = aSource.FindChar(kQuote, PR_FALSE,++offset); } else if (kApostrophe == next) { - endOffset = aSource.Find(kApostrophe, ++offset); + endOffset = aSource.FindChar(kApostrophe, PR_FALSE,++offset); } if (-1 != endOffset) { diff --git a/mozilla/rdf/base/src/nsRDFXMLDataSource.cpp b/mozilla/rdf/base/src/nsRDFXMLDataSource.cpp index 329ecdd92bc..a3cfb9e61dc 100644 --- a/mozilla/rdf/base/src/nsRDFXMLDataSource.cpp +++ b/mozilla/rdf/base/src/nsRDFXMLDataSource.cpp @@ -1137,12 +1137,12 @@ static void rdf_EscapeAngleBrackets(nsString& s) { PRInt32 i; - while ((i = s.Find('<')) != -1) { + while ((i = s.FindChar('<')) != -1) { s.SetCharAt('&', i); s.Insert(nsAutoString("lt;"), i + 1); } - while ((i = s.Find('>')) != -1) { + while ((i = s.FindChar('>')) != -1) { s.SetCharAt('&', i); s.Insert(nsAutoString("gt;"), i + 1); } @@ -1152,7 +1152,7 @@ static void rdf_EscapeAmpersands(nsString& s) { PRInt32 i = 0; - while ((i = s.Find('&', i)) != -1) { + while ((i = s.FindChar('&', PR_FALSE,i)) != -1) { s.SetCharAt('&', i); s.Insert(nsAutoString("amp;"), i + 1); i += 4; diff --git a/mozilla/rdf/chrome/src/nsChromeRegistry.cpp b/mozilla/rdf/chrome/src/nsChromeRegistry.cpp index 93c8d58ce15..735e2c65189 100644 --- a/mozilla/rdf/chrome/src/nsChromeRegistry.cpp +++ b/mozilla/rdf/chrome/src/nsChromeRegistry.cpp @@ -293,7 +293,7 @@ nsChromeRegistry::ConvertChromeURL(nsIURI* aChromeURL) { // There is something to the right of that slash. A provider type must have // been specified. - slashIndex = restOfURL.Find('/', 1); + slashIndex = restOfURL.FindChar('/', PR_FALSE,1); if (slashIndex == -1) slashIndex = restOfURL.Length(); diff --git a/mozilla/rdf/content/src/nsRDFContentUtils.cpp b/mozilla/rdf/content/src/nsRDFContentUtils.cpp index 78c45cb864c..e61dc355ec3 100644 --- a/mozilla/rdf/content/src/nsRDFContentUtils.cpp +++ b/mozilla/rdf/content/src/nsRDFContentUtils.cpp @@ -482,7 +482,7 @@ nsRDFContentUtils::MakeElementURI(nsIDocument* aDocument, const nsString& aEleme // Convert an element's ID to a URI that can be used to refer to // the element in the XUL graph. - if (aElementID.Find(':') > 0) { + if (aElementID.FindChar(':') > 0) { // Assume it's absolute already. Use as is. aURI = aElementID; } diff --git a/mozilla/rdf/datasource/src/nsSearchDataSource.cpp b/mozilla/rdf/datasource/src/nsSearchDataSource.cpp index 8b4f6395245..e0034efbffb 100755 --- a/mozilla/rdf/datasource/src/nsSearchDataSource.cpp +++ b/mozilla/rdf/datasource/src/nsSearchDataSource.cpp @@ -1404,13 +1404,13 @@ SearchDataSource::GetInputs(nsString data, nsString text, nsString &input) PRInt32 nameOffset = line.Find("name", PR_TRUE); if (nameOffset >= 0) { - PRInt32 equal = line.Find(PRUnichar('='), nameOffset); + PRInt32 equal = line.FindChar(PRUnichar('='), nameOffset); if (equal >= 0) { - PRInt32 startQuote = line.Find(PRUnichar('\"'), equal + 1); + PRInt32 startQuote = line.FindChar(PRUnichar('\"'), equal + 1); if (startQuote >= 0) { - PRInt32 endQuote = line.Find(PRUnichar('\"'), startQuote + 1); + PRInt32 endQuote = line.FindChar(PRUnichar('\"'), startQuote + 1); if (endQuote >= 0) { line.Mid(nameAttrib, startQuote+1, endQuote-startQuote-1); @@ -1437,13 +1437,13 @@ SearchDataSource::GetInputs(nsString data, nsString text, nsString &input) PRInt32 valueOffset = line.Find("value", PR_TRUE); if (valueOffset >= 0) { - PRInt32 equal = line.Find(PRUnichar('='), valueOffset); + PRInt32 equal = line.FindChar(PRUnichar('='), valueOffset); if (equal >= 0) { - PRInt32 startQuote = line.Find(PRUnichar('\"'), equal + 1); + PRInt32 startQuote = line.FindChar(PRUnichar('\"'), equal + 1); if (startQuote >= 0) { - PRInt32 endQuote = line.Find(PRUnichar('\"'), startQuote + 1); + PRInt32 endQuote = line.FindChar(PRUnichar('\"'), startQuote + 1); if (endQuote >= 0) { line.Mid(valueAttrib, startQuote+1, endQuote-startQuote-1); diff --git a/mozilla/rdf/datasource/src/nsXULContentSink.cpp b/mozilla/rdf/datasource/src/nsXULContentSink.cpp index b6585ff13d0..b86084d3bf2 100644 --- a/mozilla/rdf/datasource/src/nsXULContentSink.cpp +++ b/mozilla/rdf/datasource/src/nsXULContentSink.cpp @@ -753,7 +753,7 @@ static void SplitMimeType(const nsString& aValue, nsString& aType, nsString& aPa { aType.Truncate(); aParams.Truncate(); - PRInt32 semiIndex = aValue.Find(PRUnichar(';')); + PRInt32 semiIndex = aValue.FindChar(PRUnichar(';')); if (-1 != semiIndex) { aValue.Left(aType, semiIndex); aValue.Right(aParams, (aValue.Length() - semiIndex) - 1);