replaced calls to deprecated string methods

This commit is contained in:
rickg%netscape.com 2000-03-12 21:09:50 +00:00
Родитель 92e24087ff
Коммит 0e8a2aaf7a
5 изменённых файлов: 12 добавлений и 12 удалений

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

@ -150,13 +150,13 @@ nsresult ConvertToUnicode(const nsString& aCharset,
return NS_ERROR_NULL_POINTER;
}
else if ('\0' == *inCString) {
outString.SetString("");
outString.Truncate();
return NS_OK;
}
else if (aCharset.IsEmpty() ||
aCharset.EqualsIgnoreCase("us-ascii") ||
aCharset.EqualsIgnoreCase("ISO-8859-1")) {
outString.SetString(inCString);
outString.Assign(inCString);
return NS_OK;
}
@ -192,7 +192,7 @@ nsresult ConvertToUnicode(const nsString& aCharset,
if (unichars != nsnull) {
// convert to unicode
res = decoder->Convert(inCString, &srcLen, unichars, &unicharLength);
outString.SetString(unichars, unicharLength);
outString.Assign(unichars, unicharLength);
PR_Free(unichars);
}
else {
@ -227,7 +227,7 @@ const nsString& msgCompFileSystemCharset()
rv = platformCharset->GetCharset(kPlatformCharsetSel_FileName, aPlatformCharset);
if (NS_FAILED(rv))
aPlatformCharset.SetString("ISO-8859-1");
aPlatformCharset.Assign("ISO-8859-1");
}
return aPlatformCharset;
}
@ -371,7 +371,7 @@ nsresult nsMsgI18NConvertToEntity(const nsString& inString, nsString* outString)
{
nsresult res;
outString->SetString("");
outString->Truncate();
nsCOMPtr <nsIEntityConverter> entityConv;
res = nsComponentManager::CreateInstance(kEntityConverterCID, NULL,
NS_GET_IID(nsIEntityConverter), getter_AddRefs(entityConv));
@ -379,7 +379,7 @@ nsresult nsMsgI18NConvertToEntity(const nsString& inString, nsString* outString)
PRUnichar *entities = NULL;
res = entityConv->ConvertToEntities(inString.GetUnicode(), nsIEntityConverter::html40Latin1, &entities);
if (NS_SUCCEEDED(res) && (NULL != entities)) {
outString->SetString(entities);
outString->Assign(entities);
nsAllocator::Free(entities);
}
}

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

@ -1519,7 +1519,7 @@ msg_pick_real_name (nsMsgAttachmentHandler *attachment, const char *charset)
nsAutoString uStr;
rv = ConvertToUnicode(msgCompFileSystemCharset(), attachment->m_real_name, uStr);
if (NS_FAILED(rv))
uStr.SetString(attachment->m_real_name);
uStr.Assign(attachment->m_real_name);
char *utf8Str = uStr.ToNewUTF8String();

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

@ -161,7 +161,7 @@ TranslateLineEndings(nsString &aString)
if (transBuf)
{
DoLineEndingConJobUnicode(transBuf, aString.Length());
aString.SetString(transBuf);
aString.Assign(transBuf);
PR_FREEIF(transBuf);
}
@ -750,7 +750,7 @@ nsMsgCompose::SendMsgEx(MSG_DeliverMode deliverMode,
m_compFields->SetSubject(nsCAutoString(subject));
// Convert body to mail charset not to utf-8 (because we don't manipulate body text)
aCharset.SetString(m_compFields->GetCharacterSet());
aCharset.Assign(m_compFields->GetCharacterSet());
if (NS_SUCCEEDED(ConvertFromUnicode(aCharset, body, &outCString)))
{
m_compFields->SetBody(outCString);

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

@ -1637,7 +1637,7 @@ NS_IMETHODIMP nsSmtpProtocol::OnLogonRedirectionReply(const PRUnichar * aHost, u
m_logonRedirector = nsnull; // we don't care about it anymore
// remember the logon cookie
mLogonCookie.SetString(aCookieData, aCookieSize);
mLogonCookie.Assign(aCookieData, aCookieSize);
//currently the server isn't returning a valid auth logon capability
// this line is just a HACK to force us to use auth login.

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

@ -2487,12 +2487,12 @@ nsresult nsMsgDatabase::RowCellColumnToCharPtr(nsIMdbRow *row, mdb_token columnT
/* static */void nsMsgDatabase::YarnTonsString(struct mdbYarn *yarn, nsString *str)
{
str->SetString((const char *) yarn->mYarn_Buf, yarn->mYarn_Fill);
str->Assign((const char *) yarn->mYarn_Buf, yarn->mYarn_Fill);
}
/* static */void nsMsgDatabase::YarnTonsCString(struct mdbYarn *yarn, nsCString *str)
{
str->SetString((const char *) yarn->mYarn_Buf, yarn->mYarn_Fill);
str->Assign((const char *) yarn->mYarn_Buf, yarn->mYarn_Fill);
}