use Truncate instead of SetLength(0); r=cmanske, sr=bz, bug=209548

This commit is contained in:
brade%netscape.com 2003-07-18 02:27:19 +00:00
Родитель 137e2c4d90
Коммит 92d49f7efb
5 изменённых файлов: 13 добавлений и 13 удалений

Просмотреть файл

@ -223,7 +223,7 @@ nsEditorSpellCheck::GetSuggestedWord(PRUnichar **aSuggestedWord)
mSuggestedWordIndex++;
} else {
// A blank string signals that there are no more strings
word.SetLength(0);
word.Truncate();
}
*aSuggestedWord = ToNewUnicode(word);
@ -288,7 +288,7 @@ nsEditorSpellCheck::GetPersonalDictionaryWord(PRUnichar **aDictionaryWord)
mDictionaryIndex++;
} else {
// A blank string signals that there are no more strings
word.SetLength(0);
word.Truncate();
}
*aDictionaryWord = ToNewUnicode(word);

Просмотреть файл

@ -1844,7 +1844,7 @@ nsHTMLEditor::GetFontFaceState(PRBool *aMixed, nsAString &outFace)
if (!aMixed)
return NS_ERROR_FAILURE;
*aMixed = PR_TRUE;
outFace.SetLength(0);
outFace.Truncate();
nsresult res;
PRBool first, any, all;
@ -1872,7 +1872,7 @@ nsHTMLEditor::GetFontFaceState(PRBool *aMixed, nsAString &outFace)
if (!any)
{
// there was no font face attrs of any kind. We are in normal font.
outFace.SetLength(0);
outFace.Truncate();
*aMixed = PR_FALSE;
}
return res;
@ -1884,7 +1884,7 @@ nsHTMLEditor::GetFontColorState(PRBool *aMixed, nsAString &aOutColor)
if (!aMixed)
return NS_ERROR_NULL_POINTER;
*aMixed = PR_TRUE;
aOutColor.SetLength(0);
aOutColor.Truncate();
nsresult res;
NS_NAMED_LITERAL_STRING(colorStr, "color");
@ -1902,7 +1902,7 @@ nsHTMLEditor::GetFontColorState(PRBool *aMixed, nsAString &aOutColor)
if (!any)
{
// there was no font color attrs of any kind..
aOutColor.SetLength(0);
aOutColor.Truncate();
*aMixed = PR_FALSE;
}
return res;

Просмотреть файл

@ -3343,7 +3343,7 @@ nsHTMLEditor::GetSelectedOrParentTableElement(nsAString& aTagName,
NS_ENSURE_ARG_POINTER(aTableElement);
NS_ENSURE_ARG_POINTER(aSelectedCount);
*aTableElement = nsnull;
aTagName.SetLength(0);
aTagName.Truncate();
*aSelectedCount = 0;
nsCOMPtr<nsISelection> selection;

Просмотреть файл

@ -73,7 +73,7 @@ NS_IMPL_ISUPPORTS1(nsInternetCiter, nsICiter)
NS_IMETHODIMP
nsInternetCiter::GetCiteString(const nsAString& aInString, nsAString& aOutString)
{
aOutString.SetLength(0);
aOutString.Truncate();
PRUnichar uch = nl;
// Strip trailing new lines which will otherwise turn up
@ -121,7 +121,7 @@ nsInternetCiter::StripCitesAndLinebreaks(const nsAString& aInString,
if (aCiteLevel)
*aCiteLevel = 0;
aOutString.SetLength(0);
aOutString.Truncate();
nsReadingIterator <PRUnichar> beginIter,endIter;
aInString.BeginReading(beginIter);
aInString.EndReading(endIter);

Просмотреть файл

@ -1099,7 +1099,7 @@ nsTextEditRules::WillOutputText(nsISelection *aSelection,
}
else if (mBogusNode)
{ // this means there's no content, so output null string
aOutString->SetLength(0);
aOutString->Truncate();
*aHandled = PR_TRUE;
}
}
@ -1324,7 +1324,7 @@ nsTextEditRules::TruncateInsertionIfNeeded(nsISelection *aSelection,
PRInt32 resultingDocLength = docLength - selectionLength - oldCompStrLength;
if (resultingDocLength >= aMaxLength)
{
aOutString->SetLength(0);
aOutString->Truncate();
return res;
}
else
@ -1342,7 +1342,7 @@ nsTextEditRules::TruncateInsertionIfNeeded(nsISelection *aSelection,
nsresult
nsTextEditRules::ResetIMETextPWBuf()
{
mPasswordIMEText.SetLength(0);
mPasswordIMEText.Truncate();
return NS_OK;
}
@ -1379,7 +1379,7 @@ nsTextEditRules::EchoInsertionToPWBuff(PRInt32 aStart, PRInt32 aEnd, nsAString *
// change the output to '*' only
PRInt32 length = aOutString->Length();
PRInt32 i;
aOutString->SetLength(0);
aOutString->Truncate();
for (i=0; i<length; i++)
{
aOutString->Append(PRUnichar('*'));