diff --git a/mozilla/mailnews/import/outlook/src/MapiApi.cpp b/mozilla/mailnews/import/outlook/src/MapiApi.cpp index b00fcb7afb3..f391594a58d 100644 --- a/mozilla/mailnews/import/outlook/src/MapiApi.cpp +++ b/mozilla/mailnews/import/outlook/src/MapiApi.cpp @@ -1140,7 +1140,7 @@ BOOL CMapiApi::GetStringFromProp( LPSPropValue pVal, nsCString& val, BOOL delVal val = pVal->Value.lpszA; } else if ( pVal && (PROP_TYPE( pVal->ulPropTag) == PT_UNICODE)) { - val = (PRUnichar *) pVal->Value.lpszW; + val.AssignWithConversion((PRUnichar *) pVal->Value.lpszW); } else if (pVal && (PROP_TYPE( pVal->ulPropTag) == PT_NULL)) { val.Truncate(); @@ -1256,8 +1256,8 @@ void CMapiApi::ReportLongProp( const char *pTag, LPSPropValue pVal) nsCString num; nsCString num2; - num.Append( (PRInt32) pVal->Value.l); - num2.Append( (PRInt32) pVal->Value.l, 16); + num.AppendInt( (PRInt32) pVal->Value.l); + num2.AppendInt( (PRInt32) pVal->Value.l, 16); MAPI_TRACE3( "%s %s, 0x%s\n", pTag, num, num2); } else if (pVal && (PROP_TYPE( pVal->ulPropTag) == PT_NULL)) { @@ -1380,9 +1380,9 @@ void CMapiApi::ListPropertyValue( LPSPropValue pVal, nsCString& s) s += strVal; break; case PT_LONG: - s.Append( (PRInt32) pVal->Value.l); + s.AppendInt( (PRInt32) pVal->Value.l); s += ", 0x"; - s.Append( (PRInt32) pVal->Value.l, 16); + s.AppendInt( (PRInt32) pVal->Value.l, 16); s += nBuff; break; case PT_BOOLEAN: diff --git a/mozilla/mailnews/import/outlook/src/MapiMessage.cpp b/mozilla/mailnews/import/outlook/src/MapiMessage.cpp index 8c46f9e3cd0..76de541d8d1 100644 --- a/mozilla/mailnews/import/outlook/src/MapiMessage.cpp +++ b/mozilla/mailnews/import/outlook/src/MapiMessage.cpp @@ -263,7 +263,7 @@ BOOL CMapiMessage::IsMultipart( void) { nsCString left; m_mimeContentType.Left( left, 10); - if (!left.Compare( "multipart/", PR_TRUE)) + if (!left.CompareWithConversion( "multipart/", PR_TRUE)) return( TRUE); return( FALSE); } @@ -273,7 +273,7 @@ void CMapiMessage::GenerateBoundary( void) m_mimeBoundary = "===============_NSImport_Boundary_"; PRUint32 t = ::GetTickCount(); nsCString hex; - hex.Append( (PRInt32) t, 16); + hex.AppendInt( (PRInt32) t, 16); m_mimeBoundary += hex; m_mimeBoundary += "===="; } @@ -305,9 +305,9 @@ void CMapiMessage::ProcessHeaderLine( nsCString& line) line.Left( left8, 8); line.Left( left5, 5); - if (!left13.Compare( "Mime-Version:", PR_TRUE)) + if (!left13.CompareWithConversion( "Mime-Version:", PR_TRUE)) m_bMimeVersion = TRUE; - else if (!left13.Compare( "Content-Type:", PR_TRUE)) { + else if (!left13.CompareWithConversion( "Content-Type:", PR_TRUE)) { // Note: this isn't a complete parser, the content type // we extract could have rfc822 comments in it len = 13; @@ -331,9 +331,9 @@ void CMapiMessage::ProcessHeaderLine( nsCString& line) len++; if (len - start) { line.Mid( tStr, start, len - start); - if (!tStr.Compare( "boundary", PR_TRUE)) + if (!tStr.CompareWithConversion( "boundary", PR_TRUE)) haveB = TRUE; - else if (!tStr.Compare( "charset", PR_TRUE)) + else if (!tStr.CompareWithConversion( "charset", PR_TRUE)) haveC = TRUE; } len++; @@ -346,12 +346,12 @@ void CMapiMessage::ProcessHeaderLine( nsCString& line) while (len < line.Length()) { if (slash) { slash = FALSE; - tStr += line.CharAt( len); + tStr.AppendWithConversion(line.CharAt( len)); } else if (line.CharAt( len) == '"') break; else if (line.CharAt( len) != '\\') - tStr += line.CharAt( len); + tStr.AppendWithConversion(line.CharAt( len)); else slash = TRUE; len++; @@ -368,7 +368,7 @@ void CMapiMessage::ProcessHeaderLine( nsCString& line) } tStr.Truncate(); while ((len < line.Length()) && (line.CharAt( len) != ';')) { - tStr += line.CharAt( len); + tStr.AppendWithConversion(line.CharAt( len)); len++; } len++; @@ -383,14 +383,14 @@ void CMapiMessage::ProcessHeaderLine( nsCString& line) } } - else if (!left26.Compare( "Content-Transfer-Encoding:", PR_TRUE)) { + else if (!left26.CompareWithConversion( "Content-Transfer-Encoding:", PR_TRUE)) { m_bMimeEncoding = TRUE; } - else if (!left8.Compare( "Subject:", PR_TRUE)) + else if (!left8.CompareWithConversion( "Subject:", PR_TRUE)) m_bHasSubject = TRUE; - else if (!left5.Compare( "From:", PR_TRUE)) + else if (!left5.CompareWithConversion( "From:", PR_TRUE)) m_bHasFrom = TRUE; - else if (!left5.Compare( "Date: ", PR_TRUE)) + else if (!left5.CompareWithConversion( "Date: ", PR_TRUE)) m_bHasDate = TRUE; } diff --git a/mozilla/mailnews/import/outlook/src/nsOutlookCompose.cpp b/mozilla/mailnews/import/outlook/src/nsOutlookCompose.cpp index f9e99369526..276e336f7c5 100644 --- a/mozilla/mailnews/import/outlook/src/nsOutlookCompose.cpp +++ b/mozilla/mailnews/import/outlook/src/nsOutlookCompose.cpp @@ -195,7 +195,8 @@ nsresult nsOutlookCompose::CreateIdentity( void) NS_WITH_PROXIED_SERVICE(nsIMsgAccountManager, accMgr, kMsgAccountMgrCID, NS_UI_THREAD_EVENTQ, &rv); if (NS_FAILED(rv)) return( rv); rv = accMgr->CreateIdentity( &m_pIdentity); - nsString name = "Import Identity"; + nsString name; + name.AssignWithConversion("Import Identity"); if (m_pIdentity) { m_pIdentity->SetFullName( name.GetUnicode()); m_pIdentity->SetIdentityName( name.GetUnicode()); @@ -480,7 +481,7 @@ void nsOutlookCompose::ExtractType( nsString& str) // valid multipart! if (str.Length() > 10) { str.Left( tStr, 10); - if (!tStr.Compare( "multipart/", PR_TRUE)) + if (!tStr.CompareWithConversion( "multipart/", PR_TRUE)) str.Truncate(); } } diff --git a/mozilla/mailnews/import/outlook/src/nsOutlookCompose.h b/mozilla/mailnews/import/outlook/src/nsOutlookCompose.h index 185dc950977..3da27b4b1fe 100644 --- a/mozilla/mailnews/import/outlook/src/nsOutlookCompose.h +++ b/mozilla/mailnews/import/outlook/src/nsOutlookCompose.h @@ -126,7 +126,7 @@ private: val.Truncate(); nsCString hVal; GetHeaderValue( pData, dataLen, pHeader, hVal, PR_TRUE); - val = hVal; + val.AssignWithConversion(hVal); } void ExtractCharset( nsString& str); void ExtractType( nsString& str); diff --git a/mozilla/mailnews/import/outlook/src/nsOutlookImport.cpp b/mozilla/mailnews/import/outlook/src/nsOutlookImport.cpp index 6b9d927dfe0..cc2c152852b 100644 --- a/mozilla/mailnews/import/outlook/src/nsOutlookImport.cpp +++ b/mozilla/mailnews/import/outlook/src/nsOutlookImport.cpp @@ -378,7 +378,7 @@ NS_IMETHODIMP ImportMailImpl::FindMailboxes( nsIFileSpec *pLoc, nsISupportsArray void ImportMailImpl::AddLinebreak( nsString *pStream) { if (pStream) - pStream->Append( NS_LINEBREAK); + pStream->AppendWithConversion(NS_LINEBREAK); } void ImportMailImpl::ReportSuccess( nsString& name, PRInt32 count, nsString *pStream) diff --git a/mozilla/mailnews/import/outlook/src/nsOutlookMail.cpp b/mozilla/mailnews/import/outlook/src/nsOutlookMail.cpp index ec626745d62..6dbf7f89109 100644 --- a/mozilla/mailnews/import/outlook/src/nsOutlookMail.cpp +++ b/mozilla/mailnews/import/outlook/src/nsOutlookMail.cpp @@ -928,7 +928,7 @@ nsresult nsOutlookMail::ImportAddresses( PRUint32 *pCount, PRUint32 *pTotal, con if (pVal) { type.Truncate( 0); m_mapi.GetStringFromProp( pVal, type); - if (!type.Compare( "IPM.Contact")) { + if (!type.CompareWithConversion( "IPM.Contact")) { // This is a contact, add it to the address book! subject.Truncate( 0); pVal = m_mapi.GetMapiProperty( lpMsg, PR_SUBJECT); @@ -960,7 +960,7 @@ nsresult nsOutlookMail::ImportAddresses( PRUint32 *pCount, PRUint32 *pTotal, con void nsOutlookMail::SanitizeValue( nsString& val) { - val.ReplaceSubstring( "\x0D\x0A", ", "); + val.ReplaceSubstring(NS_ConvertASCIItoUCS2("\x0D\x0A"),NS_ConvertASCIItoUCS2(", ")); val.ReplaceChar( 13, ','); val.ReplaceChar( 10, ','); } diff --git a/mozilla/mailnews/import/outlook/src/nsOutlookSettings.cpp b/mozilla/mailnews/import/outlook/src/nsOutlookSettings.cpp index e8c34c1d8e2..3fcc4c0d5e3 100644 --- a/mozilla/mailnews/import/outlook/src/nsOutlookSettings.cpp +++ b/mozilla/mailnews/import/outlook/src/nsOutlookSettings.cpp @@ -288,11 +288,11 @@ PRBool OutlookSettings::DoIMAPServer( nsIMsgAccountManager *pMgr, HKEY hKey, cha BYTE *pAccName = nsOutlookRegUtil::GetValueBytes( hKey, "Account Name"); nsString prettyName; if (pAccName) { - prettyName = (const char *)pAccName; + prettyName.AssignWithConversion((const char *)pAccName); nsOutlookRegUtil::FreeValueBytes( pAccName); } else - prettyName = (const char *)pServerName; + prettyName.AssignWithConversion((const char *)pServerName); PRUnichar *pretty = prettyName.ToNewUnicode(); @@ -353,11 +353,11 @@ PRBool OutlookSettings::DoPOP3Server( nsIMsgAccountManager *pMgr, HKEY hKey, cha BYTE *pAccName = nsOutlookRegUtil::GetValueBytes( hKey, "Account Name"); nsString prettyName; if (pAccName) { - prettyName = (const char *)pAccName; + prettyName.AssignWithConversion((const char *)pAccName); nsOutlookRegUtil::FreeValueBytes( pAccName); } else - prettyName = (const char *)pServerName; + prettyName.AssignWithConversion((const char *)pServerName); PRUnichar *pretty = prettyName.ToNewUnicode(); @@ -454,7 +454,8 @@ void OutlookSettings::SetIdentities( nsIMsgAccountManager *pMgr, nsIMsgAccount * nsCOMPtr id; rv = pMgr->CreateIdentity( getter_AddRefs( id)); if (id) { - nsString name = pName; + nsString name; + name.AssignWithConversion(pName); id->SetFullName( name.GetUnicode()); id->SetIdentityName( name.GetUnicode()); id->SetEmail( pEmail); diff --git a/mozilla/mailnews/import/outlook/src/nsOutlookStringBundle.cpp b/mozilla/mailnews/import/outlook/src/nsOutlookStringBundle.cpp index 93b3a9696a2..0b0c211112d 100644 --- a/mozilla/mailnews/import/outlook/src/nsOutlookStringBundle.cpp +++ b/mozilla/mailnews/import/outlook/src/nsOutlookStringBundle.cpp @@ -96,9 +96,10 @@ PRUnichar *nsOutlookStringBundle::GetStringByID(PRInt32 stringID, nsIStringBundl return( ptrv); } - nsString resultString( "[StringID "); - resultString.Append(stringID, 10); - resultString += "?]"; + nsString resultString; + resultString.AppendWithConversion("[StringID "); + resultString.AppendInt(stringID, 10); + resultString.AppendWithConversion("?]"); return( resultString.ToNewUnicode()); }