diff --git a/mozilla/extensions/wallet/editor/nsWalletEditor.cpp b/mozilla/extensions/wallet/editor/nsWalletEditor.cpp index 3511802faa6..dc83311c47f 100644 --- a/mozilla/extensions/wallet/editor/nsWalletEditor.cpp +++ b/mozilla/extensions/wallet/editor/nsWalletEditor.cpp @@ -76,7 +76,7 @@ WalletEditorImpl::SetValue(const PRUnichar* aValue, nsIDOMWindow* win) nsresult res; NS_WITH_SERVICE(nsIWalletService, walletservice, kWalletServiceCID, &res); if (NS_FAILED(res)) return res; - nsAutoString walletList = aValue; + nsAutoString walletList( aValue ); res = walletservice->WALLET_PostEdit(walletList); return res; } diff --git a/mozilla/extensions/wallet/signonviewer/nsSignonViewer.cpp b/mozilla/extensions/wallet/signonviewer/nsSignonViewer.cpp index d553bfb9609..5b580c5cb5c 100644 --- a/mozilla/extensions/wallet/signonviewer/nsSignonViewer.cpp +++ b/mozilla/extensions/wallet/signonviewer/nsSignonViewer.cpp @@ -130,7 +130,7 @@ SignonViewerImpl::SetValue(const PRUnichar* aValue, nsIDOMWindow* win) nsresult res; NS_WITH_SERVICE(nsIWalletService, walletservice, kWalletServiceCID, &res); if (NS_FAILED(res)) return res; - nsAutoString walletList = aValue; + nsAutoString walletList( aValue ); res = walletservice->SI_SignonViewerReturn(walletList); return res; } diff --git a/mozilla/extensions/wallet/src/nsWalletService.cpp b/mozilla/extensions/wallet/src/nsWalletService.cpp index 48380e0d597..241082a8513 100644 --- a/mozilla/extensions/wallet/src/nsWalletService.cpp +++ b/mozilla/extensions/wallet/src/nsWalletService.cpp @@ -403,7 +403,7 @@ nsWalletlibService::HaveData(nsIPrompt* dialog, const char *key, const PRUnichar NS_IMETHODIMP nsWalletlibService::WALLET_Encrypt (const PRUnichar *text, char **crypt) { - nsAutoString textAutoString = text; + nsAutoString textAutoString( text ); nsAutoString cryptAutoString; PRBool rv = ::Wallet_Encrypt(textAutoString, cryptAutoString); *crypt = cryptAutoString.ToNewCString(); diff --git a/mozilla/extensions/wallet/src/singsign.cpp b/mozilla/extensions/wallet/src/singsign.cpp index 70a263a13b5..e02e5f8ee4a 100644 --- a/mozilla/extensions/wallet/src/singsign.cpp +++ b/mozilla/extensions/wallet/src/singsign.cpp @@ -2389,7 +2389,7 @@ SINGSIGN_Prompt PUBLIC PRBool SI_InSequence(const nsString& sequence, PRInt32 number) { - nsAutoString tail = sequence; + nsAutoString tail( sequence ); nsAutoString head, temp; PRInt32 separator; diff --git a/mozilla/extensions/wallet/src/wallet.cpp b/mozilla/extensions/wallet/src/wallet.cpp index 3dc9413195b..a92ceff96ac 100644 --- a/mozilla/extensions/wallet/src/wallet.cpp +++ b/mozilla/extensions/wallet/src/wallet.cpp @@ -362,7 +362,7 @@ InputConsumer::Init(nsFileSpec dirSpec, const char *out) mFileName = nsCRT::strdup(out); mFileSpec = dirSpec + mFileName; // Create a temp download filename - nsCAutoString downloadFilename = mFileName; + nsCAutoString downloadFilename( mFileName ); downloadFilename.Append(",d"); mDownloadFileSpec = dirSpec + downloadFilename; return NS_OK; @@ -702,7 +702,7 @@ Wallet_Confirm(PRUnichar * szMessage, nsIDOMWindow* window) return retval; } - const nsAutoString message = szMessage; + const nsAutoString message( szMessage ); retval = PR_FALSE; /* in case user exits dialog by clicking X */ res = dialog->Confirm(nsnull, message.GetUnicode(), &retval); return retval; @@ -803,7 +803,7 @@ wallet_Alert(PRUnichar * szMessage, nsIDOMWindow* window) return; // XXX should return the error } - const nsAutoString message = szMessage; + const nsAutoString message( szMessage ); PRUnichar * title = Wallet_Localize("CaveatTitle"); res = dialog->Alert(title, message.GetUnicode()); Recycle(title); @@ -814,7 +814,7 @@ PRIVATE void wallet_Alert(PRUnichar * szMessage, nsIPrompt* dialog) { nsresult res; - const nsAutoString message = szMessage; + const nsAutoString message( szMessage ); PRUnichar * title = Wallet_Localize("CaveatTitle"); res = dialog->Alert(title, message.GetUnicode()); Recycle(title); @@ -2084,7 +2084,7 @@ wallet_GetSelectIndex( nsAutoString optionText; optionElement->GetValue(optionValue); optionElement->GetText(optionText); - nsAutoString valueLC = value; + nsAutoString valueLC( value ); valueLC.ToLowerCase(); optionValue.ToLowerCase(); optionText.ToLowerCase(); @@ -2832,7 +2832,7 @@ WLLT_PostEdit(const nsString& walletList) return; } - nsAutoString tail = walletList; + nsAutoString tail( walletList ); nsAutoString head, temp; PRInt32 separator; diff --git a/mozilla/extensions/wallet/walletpreview/nsWalletPreview.cpp b/mozilla/extensions/wallet/walletpreview/nsWalletPreview.cpp index 1c97175a3b5..3379f1dfaba 100644 --- a/mozilla/extensions/wallet/walletpreview/nsWalletPreview.cpp +++ b/mozilla/extensions/wallet/walletpreview/nsWalletPreview.cpp @@ -117,7 +117,7 @@ WalletPreviewImpl::SetValue(const PRUnichar* aValue, nsIDOMWindow* win) nsresult res; NS_WITH_SERVICE(nsIWalletService, walletservice, kWalletServiceCID, &res); if (NS_FAILED(res)) return res; - nsAutoString walletList = aValue; + nsAutoString walletList( aValue ); res = walletservice->WALLET_PrefillReturn(walletList); return res; } diff --git a/mozilla/profile/pref-migrator/src/nsPrefMigration.cpp b/mozilla/profile/pref-migrator/src/nsPrefMigration.cpp index e1db30e20cd..542e689bfab 100644 --- a/mozilla/profile/pref-migrator/src/nsPrefMigration.cpp +++ b/mozilla/profile/pref-migrator/src/nsPrefMigration.cpp @@ -2186,7 +2186,7 @@ nsPrefConverter::ConvertPrefsToUTF8IfNecessary() if (NS_FAILED(rv)) return rv; for (PRUint32 i = 0; prefsToConvert[i]; i++) { - nsCString prefnameStr = prefsToConvert[i]; + nsCString prefnameStr( prefsToConvert[i] ); prefsToMigrate.AppendCString(prefnameStr); } diff --git a/mozilla/profile/src/nsProfile.cpp b/mozilla/profile/src/nsProfile.cpp index b062f2d8677..d16b967d0bf 100644 --- a/mozilla/profile/src/nsProfile.cpp +++ b/mozilla/profile/src/nsProfile.cpp @@ -800,7 +800,7 @@ NS_IMETHODIMP nsProfile::GetProfileDir(const PRUnichar *profileName, nsFileSpec* tmpFileSpec.CreateDirectory(); // append profile name - tmpFileSpec += profileName; + tmpFileSpec += NS_ConvertUCS2toUTF8(profileName); // Create New Directory. PersistentDescriptor needs an existing object. if (!tmpFileSpec.Exists()) @@ -1021,7 +1021,7 @@ nsProfile::CreateNewProfile(const PRUnichar* profileName, dirSpec.CreateDirectory(); // append profile name - dirSpec += profileName; + dirSpec += NS_ConvertUCS2toUTF8(profileName); // Make profile directory unique only when the user // decides to not use an already existing profile directory @@ -1029,12 +1029,12 @@ nsProfile::CreateNewProfile(const PRUnichar* profileName, dirSpec.MakeUnique(); } else { - dirSpec = nativeProfileDir; + dirSpec = NS_ConvertUCS2toUTF8(nativeProfileDir); // this prevents people from choosing there profile directory // or another directory, and remove it when they delete the profile. // append profile name - dirSpec += profileName; + dirSpec += NS_ConvertUCS2toUTF8(profileName); // Make profile directory unique only when the user // decides to not use an already existing profile directory @@ -1079,7 +1079,7 @@ nsProfile::CreateNewProfile(const PRUnichar* profileName, // caller prefers locale subdir nsFileSpec tmpdir; tmpdir = defaultsDirSpec; - tmpdir += langcode; + tmpdir += NS_ConvertUCS2toUTF8(langcode); if (tmpdir.Exists()) defaultsDirSpec = tmpdir; @@ -1458,7 +1458,7 @@ nsProfile::MigrateProfile(const PRUnichar* profileName, PRBool showProgressAsMod return NS_ERROR_FAILURE; newSpec->GetFileSpec(&newProfDir); - newProfDir += profileName; + newProfDir += NS_ConvertUCS2toUTF8(profileName); newProfDir.MakeUnique(); if (newProfDir.Exists()) { #ifdef DEBUG_profile @@ -1687,9 +1687,8 @@ nsProfile::ShowProfileWizard(void) kAppShellServiceCID, &rv); if (NS_FAILED(rv)) return rv; - nsCString profURLStr = PROFILE_WIZARD_URL; nsCOMPtr profURI; - rv = NS_NewURI(getter_AddRefs(profURI), (const char *)profURLStr); + rv = NS_NewURI(getter_AddRefs(profURI), NS_LITERAL_CSTRING(PROFILE_WIZARD_URL)); if (NS_FAILED(rv)) return rv; nsCOMPtr newWindow; @@ -1768,7 +1767,7 @@ nsresult nsProfile::RenameProfileDir(const PRUnichar* newProfileName) if (NS_FAILED(rv)) return rv; nsFileSpec renamedDirSpec = dirSpec; - renamedDirSpec.SetLeafName(newProfileName); + renamedDirSpec.SetLeafName(NS_ConvertUCS2toUTF8(newProfileName)); renamedDirSpec.MakeUnique(); // rename the directory @@ -1816,7 +1815,7 @@ NS_IMETHODIMP nsProfile::CloneProfile(const PRUnichar* newProfile) // hash profileName (will MakeUnique do that for us?) // don't allow special characters (like ..) // make acceptable length (will MakeUnique do that for us?) - newProfileDir += newProfile; + newProfileDir += NS_ConvertUCS2toUTF8(newProfile); newProfileDir.MakeUnique(); if (newProfileDir.Exists()) { diff --git a/mozilla/profile/src/nsProfileAccess.cpp b/mozilla/profile/src/nsProfileAccess.cpp index 2df957659b8..6261148ce5c 100644 --- a/mozilla/profile/src/nsProfileAccess.cpp +++ b/mozilla/profile/src/nsProfileAccess.cpp @@ -788,7 +788,9 @@ nsProfileAccess::FixRegEntry(PRUnichar** dirName) PRBool haveHexBytes = PR_TRUE; // Decode the directory name to return the ordinary string - nsInputStringStream stream(*dirName); + nsCAutoString dirNameCString; dirNameCString.AssignWithConversion(*dirName); + nsInputStringStream stream(dirNameCString); +// nsInputStringStream stream(NS_ConvertUCS2toUTF8(*dirName)); nsPersistentFileDescriptor descriptor; char bigBuffer[MAX_PERSISTENT_DATA_SIZE + 1];