From 0d69ddce331fb2031b7e8d4fe98a0ec76497e049 Mon Sep 17 00:00:00 2001 From: "mjudge%netscape.com" Date: Wed, 18 Apr 2001 06:26:19 +0000 Subject: [PATCH] forgot 1 change sr=scc r=anthonyd 76442 --- editor/base/nsInternetCiter.cpp | 20 +++++++++++--------- editor/libeditor/text/nsInternetCiter.cpp | 20 +++++++++++--------- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/editor/base/nsInternetCiter.cpp b/editor/base/nsInternetCiter.cpp index d82f285d0657..a05f698eb4a2 100644 --- a/editor/base/nsInternetCiter.cpp +++ b/editor/base/nsInternetCiter.cpp @@ -79,33 +79,35 @@ NS_IMETHODIMP nsInternetCiter::GetCiteString(const nsAReadableString& aInString, nsAWritableString& aOutString) { PRInt32 i = 0; - PRInt32 length = aInString.Length(); aOutString.SetLength(0); PRUnichar uch = nl; // Strip trailing new lines which will otherwise turn up // as ugly quoted empty lines. - nsString tString(aInString); //CRAPCRAP - while(length > 0 && - (tString[length-1] == cr || - tString[length-1] == nl)) + nsReadingIterator beginIter,endIter; + aInString.BeginReading(beginIter); + aInString.EndReading(endIter); + while(beginIter!= endIter && + (*endIter == cr || + *endIter == nl)) { - --length; + --endIter; } // Loop over the string: - while (i < length) + while (beginIter != endIter) { if (uch == nl) { aOutString.Append(gt); // No space between >: this is ">>> " style quoting, for // compatability with RFC 2646 and format=flowed. - if (tString[i] != gt) + if (*beginIter != gt) aOutString.Append(space); } - uch = tString[i++]; + uch = *beginIter; + ++beginIter; aOutString += uch; } diff --git a/editor/libeditor/text/nsInternetCiter.cpp b/editor/libeditor/text/nsInternetCiter.cpp index d82f285d0657..a05f698eb4a2 100644 --- a/editor/libeditor/text/nsInternetCiter.cpp +++ b/editor/libeditor/text/nsInternetCiter.cpp @@ -79,33 +79,35 @@ NS_IMETHODIMP nsInternetCiter::GetCiteString(const nsAReadableString& aInString, nsAWritableString& aOutString) { PRInt32 i = 0; - PRInt32 length = aInString.Length(); aOutString.SetLength(0); PRUnichar uch = nl; // Strip trailing new lines which will otherwise turn up // as ugly quoted empty lines. - nsString tString(aInString); //CRAPCRAP - while(length > 0 && - (tString[length-1] == cr || - tString[length-1] == nl)) + nsReadingIterator beginIter,endIter; + aInString.BeginReading(beginIter); + aInString.EndReading(endIter); + while(beginIter!= endIter && + (*endIter == cr || + *endIter == nl)) { - --length; + --endIter; } // Loop over the string: - while (i < length) + while (beginIter != endIter) { if (uch == nl) { aOutString.Append(gt); // No space between >: this is ">>> " style quoting, for // compatability with RFC 2646 and format=flowed. - if (tString[i] != gt) + if (*beginIter != gt) aOutString.Append(space); } - uch = tString[i++]; + uch = *beginIter; + ++beginIter; aOutString += uch; }