From a1384a7aece9bf03b499ad90927301bac411eb73 Mon Sep 17 00:00:00 2001 From: "rickg%netscape.com" Date: Mon, 22 Mar 1999 08:29:26 +0000 Subject: [PATCH] prep work to land nsString2 git-svn-id: svn://10.0.0.236/trunk@24662 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/base/src/nsString.cpp | 10 ++++++++++ mozilla/base/src/nsString.h | 3 +++ mozilla/rdf/base/src/nsRDFXMLDataSource.cpp | 6 +++--- mozilla/rdf/datasource/src/nsBookmarkDataSource.cpp | 2 +- mozilla/string/obsolete/nsString.cpp | 10 ++++++++++ mozilla/string/obsolete/nsString.h | 3 +++ mozilla/xpcom/ds/nsString.cpp | 10 ++++++++++ mozilla/xpcom/ds/nsString.h | 3 +++ mozilla/xpcom/string/obsolete/nsString.cpp | 10 ++++++++++ mozilla/xpcom/string/obsolete/nsString.h | 3 +++ 10 files changed, 56 insertions(+), 4 deletions(-) diff --git a/mozilla/base/src/nsString.cpp b/mozilla/base/src/nsString.cpp index 72a033a4df0..ed6377962e2 100644 --- a/mozilla/base/src/nsString.cpp +++ b/mozilla/base/src/nsString.cpp @@ -419,6 +419,16 @@ PRUnichar& nsString::Last() const{ else return gBadChar; } +PRBool nsString::SetCharAt(PRUnichar aChar,PRInt32 anIndex){ + PRBool result=PR_FALSE; + if(anIndex')) != -1) { - s[index] = '&'; + s.SetCharAt('&',index); s.Insert(nsAutoString("gt;"), index + 1); } } @@ -998,7 +998,7 @@ rdf_EscapeAmpersands(nsString& s) { PRInt32 index = 0; while ((index = s.Find('&', index)) != -1) { - s[index] = '&'; + s.SetCharAt('&',index); s.Insert(nsAutoString("amp;"), index + 1); index += 4; } diff --git a/mozilla/rdf/datasource/src/nsBookmarkDataSource.cpp b/mozilla/rdf/datasource/src/nsBookmarkDataSource.cpp index 2f4981025b4..fb71fc991ba 100644 --- a/mozilla/rdf/datasource/src/nsBookmarkDataSource.cpp +++ b/mozilla/rdf/datasource/src/nsBookmarkDataSource.cpp @@ -277,7 +277,7 @@ BookmarkParser::ParseBookmark(const nsString& aLine, nsIRDFResource* aContainer) static const char kEscape22[] = "%22"; PRInt32 offset; while ((offset = url.Find(kEscape22)) >= 0) { - url[offset] = PRUnichar(' '); + url.SetCharAt(' ',offset); url.Cut(offset + 1, sizeof(kEscape22) - 2); } } diff --git a/mozilla/string/obsolete/nsString.cpp b/mozilla/string/obsolete/nsString.cpp index 72a033a4df0..ed6377962e2 100644 --- a/mozilla/string/obsolete/nsString.cpp +++ b/mozilla/string/obsolete/nsString.cpp @@ -419,6 +419,16 @@ PRUnichar& nsString::Last() const{ else return gBadChar; } +PRBool nsString::SetCharAt(PRUnichar aChar,PRInt32 anIndex){ + PRBool result=PR_FALSE; + if(anIndex