more fixes.

git-svn-id: svn://10.0.0.236/trunk@67470 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
sspitzer%netscape.com 2000-04-28 04:23:05 +00:00
parent 17f63bc50f
commit 9dd26ceee3
8 changed files with 35 additions and 32 deletions

View File

@ -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:

View File

@ -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;
}

View File

@ -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();
}
}

View File

@ -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);

View File

@ -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)

View File

@ -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, ',');
}

View File

@ -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<nsIMsgIdentity> 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);

View File

@ -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());
}