diff --git a/base/src/nsString.cpp b/base/src/nsString.cpp index 72a033a4df0..ed6377962e2 100644 --- a/base/src/nsString.cpp +++ b/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/rdf/datasource/src/nsBookmarkDataSource.cpp b/rdf/datasource/src/nsBookmarkDataSource.cpp index 2f4981025b4..fb71fc991ba 100644 --- a/rdf/datasource/src/nsBookmarkDataSource.cpp +++ b/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/string/obsolete/nsString.cpp b/string/obsolete/nsString.cpp index 72a033a4df0..ed6377962e2 100644 --- a/string/obsolete/nsString.cpp +++ b/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