From c696d9a508cc0abc87e4ff7669410b1ca276d275 Mon Sep 17 00:00:00 2001 From: "sfraser%netscape.com" Date: Fri, 27 Apr 2001 05:53:22 +0000 Subject: [PATCH] Backing out valeski git-svn-id: svn://10.0.0.236/trunk@93248 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/caps/src/nsScriptSecurityManager.cpp | 3 +- .../html/document/src/nsImageDocument.cpp | 3 +- mozilla/docshell/base/nsDocShell.cpp | 97 ++++++++++++++++++- mozilla/editor/base/nsEditorShell.cpp | 3 +- mozilla/editor/composer/src/nsEditorShell.cpp | 3 +- mozilla/embedding/base/nsEmbedAPI.cpp | 3 +- .../ui/helperAppDlg/nsHelperAppDlg.js | 2 +- .../components/windowwatcher/src/nsPrompt.cpp | 1 + .../windowwatcher/src/nsPromptService.cpp | 3 +- mozilla/extensions/cookie/nsUtils.cpp | 3 +- .../extensions/cookie/tests/TestCookie.cpp | 4 +- mozilla/extensions/p3p/src/nsP3PService.cpp | 1 + mozilla/extensions/psm-glue/src/nsFSDR.cpp | 3 +- .../psm-glue/src/nsSecureBrowserUIImpl.cpp | 3 +- mozilla/extensions/wallet/src/wallet.cpp | 4 +- .../intl/strres/public/nsIStringBundle.idl | 7 +- mozilla/intl/strres/src/nsAcceptLang.cpp | 7 +- mozilla/intl/strres/src/nsStringBundle.cpp | 5 +- .../intl/strres/tests/StringBundleTest.cpp | 54 ++++++++++- mozilla/layout/forms/nsFormControlHelper.cpp | 3 +- .../html/forms/src/nsFormControlHelper.cpp | 3 +- mozilla/layout/xul/base/src/nsMenuFrame.cpp | 1 + .../mailnews/absync/src/nsABSyncDriver.cpp | 3 +- mozilla/mailnews/absync/src/nsAbSync.cpp | 3 +- mozilla/mailnews/base/src/nsMessenger.cpp | 3 +- .../mailnews/base/src/nsMessengerMigrator.cpp | 1 + .../base/src/nsMsgAccountManagerDS.cpp | 1 + mozilla/mailnews/base/src/nsMsgDBView.cpp | 2 +- .../base/src/nsMsgFolderCompactor.cpp | 3 +- .../mailnews/base/src/nsMsgOfflineManager.cpp | 3 +- .../mailnews/base/src/nsMsgPrintEngine.cpp | 3 +- .../mailnews/base/src/nsMsgStatusFeedback.cpp | 1 + mozilla/mailnews/base/util/nsMsgFolder.cpp | 1 + .../base/util/nsMsgIncomingServer.cpp | 3 +- .../compose/src/nsMsgComposeStringBundle.cpp | 2 +- .../imap/src/nsImapIncomingServer.cpp | 4 +- .../mailnews/imap/src/nsImapStringBundle.cpp | 4 +- .../eudora/src/nsEudoraStringBundle.cpp | 3 +- .../import/oexpress/nsOEStringBundle.cpp | 3 +- .../outlook/src/nsOutlookStringBundle.cpp | 3 +- .../import/src/nsImportStringBundle.cpp | 3 +- .../import/text/src/nsTextStringBundle.cpp | 3 +- .../local/src/nsLocalStringBundle.cpp | 2 +- .../local/src/nsPop3IncomingServer.cpp | 1 + mozilla/modules/libpref/src/nsPrefBranch.cpp | 2 +- .../plugin/base/src/nsPluginHostImpl.cpp | 10 +- .../plugin/nglsrc/nsPluginHostImpl.cpp | 10 +- .../pref-migrator/src/nsPrefMigration.cpp | 2 +- 48 files changed, 248 insertions(+), 47 deletions(-) diff --git a/mozilla/caps/src/nsScriptSecurityManager.cpp b/mozilla/caps/src/nsScriptSecurityManager.cpp index a1da7b6bcda..23d05bf46f0 100644 --- a/mozilla/caps/src/nsScriptSecurityManager.cpp +++ b/mozilla/caps/src/nsScriptSecurityManager.cpp @@ -1159,8 +1159,9 @@ Localize(char *genericString, nsString &result) nsCRT::free(spec); return ret; } + nsILocale *locale = nsnull; nsIStringBundle *bundle = nsnull; - ret = pStringService->CreateBundle(spec, &bundle); + ret = pStringService->CreateBundle(spec, locale, &bundle); nsCRT::free(spec); nsServiceManager::ReleaseService(kStringBundleServiceCID, pStringService); if (NS_FAILED(ret)) { diff --git a/mozilla/content/html/document/src/nsImageDocument.cpp b/mozilla/content/html/document/src/nsImageDocument.cpp index a6fe87a54eb..d254a59f088 100644 --- a/mozilla/content/html/document/src/nsImageDocument.cpp +++ b/mozilla/content/html/document/src/nsImageDocument.cpp @@ -468,7 +468,8 @@ nsresult nsImageDocument::UpdateTitle( void ) // Create a bundle for the localization NS_WITH_SERVICE(nsIStringBundleService, stringService, kStringBundleServiceCID, &rv); if (NS_SUCCEEDED(rv) && stringService) { - rv = stringService->CreateBundle(NSIMAGEDOCUMENT_PROPERTIES_URI, getter_AddRefs(bundle)); + nsCOMPtr locale = nsnull; + rv = stringService->CreateBundle(NSIMAGEDOCUMENT_PROPERTIES_URI, locale, getter_AddRefs(bundle)); } if (NS_SUCCEEDED(rv) && bundle) { nsAutoString key; diff --git a/mozilla/docshell/base/nsDocShell.cpp b/mozilla/docshell/base/nsDocShell.cpp index 83b710c1248..9141d418a56 100644 --- a/mozilla/docshell/base/nsDocShell.cpp +++ b/mozilla/docshell/base/nsDocShell.cpp @@ -55,6 +55,7 @@ #include "nsDocShell.h" #include "nsDocShellLoadInfo.h" #include "nsCDefaultURIFixup.h" +#include "nsDocShellEnumerator.h" // Helper Classes #include "nsDOMError.h" @@ -67,6 +68,7 @@ #include "nsIProgressEventSink.h" #include "nsIWebProgress.h" #include "nsILayoutHistoryState.h" +#include "nsILocaleService.h" #include "nsITimer.h" #include "nsIFileStream.h" #include "nsISHistoryInternal.h" @@ -293,6 +295,15 @@ NS_IMETHODIMP nsDocShell::GetInterface(const nsIID& aIID, void** aSink) } return NS_NOINTERFACE; } + else if (aIID.Equals(NS_GET_IID(nsIWebBrowserFind))) + { + nsresult rv = EnsureFind(); + if (NS_FAILED(rv)) return rv; + + *aSink = mFind; + NS_ADDREF((nsISupports*)*aSink); + return NS_OK; + } else { return QueryInterface(aIID, aSink); @@ -774,6 +785,35 @@ nsDocShell::SetAllowSubframes(PRBool aAllowSubframes) return NS_OK; } +NS_IMETHODIMP +nsDocShell::GetDocShellEnumerator(PRInt32 aItemType, PRInt32 aDirection, nsISimpleEnumerator **outEnum) +{ + NS_ENSURE_ARG_POINTER(outEnum); + *outEnum = nsnull; + + nsDocShellEnumerator* docShellEnum; + if (aDirection == ENUMERATE_FORWARDS) + docShellEnum = new nsDocShellForwardsEnumerator; + else + docShellEnum = new nsDocShellBackwardsEnumerator; + + if (!docShellEnum) return NS_ERROR_OUT_OF_MEMORY; + + nsresult rv = docShellEnum->SetEnumDocShellType(aItemType); + if (NS_FAILED(rv)) return rv; + + rv = docShellEnum->SetEnumerationRootItem((nsIDocShellTreeItem *)this); + if (NS_FAILED(rv)) return rv; + + rv = docShellEnum->First(); + if (NS_FAILED(rv)) return rv; + + docShellEnum->AddRef(); // ensure we don't lose the last ref inside the QueryInterface + rv = docShellEnum->QueryInterface(NS_GET_IID(nsISimpleEnumerator), (void **)outEnum); + docShellEnum->Release(); + return rv; +} + NS_IMETHODIMP nsDocShell::GetAppType(PRUint32* aAppType) { *aAppType = mAppType; @@ -4288,6 +4328,7 @@ NS_IMETHODIMP nsDocShell::LoadHistoryEntry(nsISHEntry* aEntry, PRUint32 aLoadTyp NS_ENSURE_SUCCESS(hEntry->GetURI(getter_AddRefs(uri)), NS_ERROR_FAILURE); NS_ENSURE_SUCCESS(aEntry->GetReferrerURI(getter_AddRefs(referrerURI)), NS_ERROR_FAILURE); NS_ENSURE_SUCCESS(aEntry->GetPostData(getter_AddRefs(postData)), NS_ERROR_FAILURE); + NS_ENSURE_SUCCESS(InternalLoad(uri, referrerURI, nsnull, PR_TRUE, PR_FALSE, nsnull, postData, nsnull, aLoadType, aEntry), NS_ERROR_FAILURE); @@ -4519,10 +4560,17 @@ NS_IMETHODIMP nsDocShell::GetPromptAndStringBundle(nsIPrompt** aPrompt, { NS_ENSURE_SUCCESS(GetInterface(NS_GET_IID(nsIPrompt), (void**)aPrompt), NS_ERROR_FAILURE); + nsCOMPtr localeService(do_GetService(NS_LOCALESERVICE_CONTRACTID)); + NS_ENSURE_TRUE(localeService, NS_ERROR_FAILURE); + + nsCOMPtr locale; + localeService->GetSystemLocale(getter_AddRefs(locale)); + NS_ENSURE_TRUE(locale, NS_ERROR_FAILURE); + nsCOMPtr stringBundleService(do_GetService(NS_STRINGBUNDLE_CONTRACTID)); NS_ENSURE_TRUE(stringBundleService, NS_ERROR_FAILURE); - NS_ENSURE_SUCCESS(stringBundleService->CreateBundle(DIALOG_STRING_URI, + NS_ENSURE_SUCCESS(stringBundleService->CreateBundle(DIALOG_STRING_URI, locale, getter_AddRefs(aStringBundle)), NS_ERROR_FAILURE); return NS_OK; @@ -4615,6 +4663,53 @@ NS_IMETHODIMP nsDocShell::EnsureScriptEnvironment() return NS_OK; } +NS_IMETHODIMP nsDocShell::EnsureFind() +{ + nsresult rv; + if (!mFind) + { + mFind = do_CreateInstance("@mozilla.org/embedcomp/find;1", &rv); + if (NS_FAILED(rv)) return rv; + } + + // we promise that the nsIWebBrowserFind that we return has been set + // up to point to the focussed, or content window, so we have to + // set that up each time. + nsCOMPtr scriptGO; + rv = GetScriptGlobalObject(getter_AddRefs(scriptGO)); + if (NS_FAILED(rv)) return rv; + + // default to our window + nsCOMPtr rootWindow = do_QueryInterface(scriptGO); + nsCOMPtr windowToSearch = rootWindow; + + // if we can, search the focussed window + nsCOMPtr ourWindow = do_QueryInterface(scriptGO); + nsCOMPtr focusController; + if (ourWindow) + ourWindow->GetRootFocusController(getter_AddRefs(focusController)); + if (focusController) + { + nsCOMPtr focussedWindow; + focusController->GetFocusedWindow(getter_AddRefs(focussedWindow)); + if (focussedWindow) + { + rootWindow = focussedWindow; // constrain to the focussed window. + windowToSearch = focussedWindow; + } + } + + nsCOMPtr findInFrames = do_QueryInterface(mFind); + if (!findInFrames) return NS_ERROR_NO_INTERFACE; + + rv = findInFrames->SetRootSearchFrame(rootWindow); + if (NS_FAILED(rv)) return rv; + rv = findInFrames->SetCurrentSearchFrame(windowToSearch); + if (NS_FAILED(rv)) return rv; + + return NS_OK; +} + PRBool nsDocShell::IsFrame() { if(mParent) diff --git a/mozilla/editor/base/nsEditorShell.cpp b/mozilla/editor/base/nsEditorShell.cpp index f02e9204af8..a9a18e8f180 100644 --- a/mozilla/editor/base/nsEditorShell.cpp +++ b/mozilla/editor/base/nsEditorShell.cpp @@ -296,7 +296,8 @@ nsEditorShell::Init() NS_WARNING("ERROR: Failed to get StringBundle Service instance.\n"); return res; } - res = stringBundleService->CreateBundle(EDITOR_BUNDLE_URL, getter_AddRefs(mStringBundle)); + nsILocale* aLocale = nsnull; + res = stringBundleService->CreateBundle(EDITOR_BUNDLE_URL, aLocale, getter_AddRefs(mStringBundle)); // XXX: why are we returning NS_OK here rather than res? // is it ok to fail to get a string bundle? if so, it should be documented. diff --git a/mozilla/editor/composer/src/nsEditorShell.cpp b/mozilla/editor/composer/src/nsEditorShell.cpp index f02e9204af8..a9a18e8f180 100644 --- a/mozilla/editor/composer/src/nsEditorShell.cpp +++ b/mozilla/editor/composer/src/nsEditorShell.cpp @@ -296,7 +296,8 @@ nsEditorShell::Init() NS_WARNING("ERROR: Failed to get StringBundle Service instance.\n"); return res; } - res = stringBundleService->CreateBundle(EDITOR_BUNDLE_URL, getter_AddRefs(mStringBundle)); + nsILocale* aLocale = nsnull; + res = stringBundleService->CreateBundle(EDITOR_BUNDLE_URL, aLocale, getter_AddRefs(mStringBundle)); // XXX: why are we returning NS_OK here rather than res? // is it ok to fail to get a string bundle? if so, it should be documented. diff --git a/mozilla/embedding/base/nsEmbedAPI.cpp b/mozilla/embedding/base/nsEmbedAPI.cpp index 0c1e0f14bc5..d63ca86a2ea 100644 --- a/mozilla/embedding/base/nsEmbedAPI.cpp +++ b/mozilla/embedding/base/nsEmbedAPI.cpp @@ -141,7 +141,8 @@ nsresult NS_InitEmbedding(nsILocalFile *mozBinDirectory, { nsCOMPtr stringBundle; char* propertyURL = "chrome://necko/locale/necko.properties"; - rv = sBundleService->CreateBundle(propertyURL, + nsILocale *locale = nsnull; + rv = sBundleService->CreateBundle(propertyURL, locale, getter_AddRefs(stringBundle)); } #endif diff --git a/mozilla/embedding/components/ui/helperAppDlg/nsHelperAppDlg.js b/mozilla/embedding/components/ui/helperAppDlg/nsHelperAppDlg.js index e280a729f6f..22628fab799 100644 --- a/mozilla/embedding/components/ui/helperAppDlg/nsHelperAppDlg.js +++ b/mozilla/embedding/components/ui/helperAppDlg/nsHelperAppDlg.js @@ -96,7 +96,7 @@ nsHelperAppDialog.prototype = { .createInstance( nsIFilePicker ); var bundle = Components.classes[ "@mozilla.org/intl/stringbundle;1" ] .getService( Components.interfaces.nsIStringBundleService ) - .createBundle( "chrome://global/locale/helperAppLauncher.properties"); + .CreateBundle( "chrome://global/locale/helperAppLauncher.properties", null ); var windowTitle = bundle.GetStringFromName( "saveDialogTitle" ); diff --git a/mozilla/embedding/components/windowwatcher/src/nsPrompt.cpp b/mozilla/embedding/components/windowwatcher/src/nsPrompt.cpp index ca5a1736b49..0e4a2c150df 100644 --- a/mozilla/embedding/components/windowwatcher/src/nsPrompt.cpp +++ b/mozilla/embedding/components/windowwatcher/src/nsPrompt.cpp @@ -20,6 +20,7 @@ * Contributor(s): */ +#include "nsILocale.h" #include "nsIServiceManager.h" #include "nsIWalletService.h" #include "nsPrompt.h" diff --git a/mozilla/embedding/components/windowwatcher/src/nsPromptService.cpp b/mozilla/embedding/components/windowwatcher/src/nsPromptService.cpp index 60e3eafd75b..d522e6d30c4 100644 --- a/mozilla/embedding/components/windowwatcher/src/nsPromptService.cpp +++ b/mozilla/embedding/components/windowwatcher/src/nsPromptService.cpp @@ -592,8 +592,9 @@ nsPromptService::GetLocaleString(const char *aKey, PRUnichar **aResult) nsCOMPtr stringService = do_GetService(kStringBundleServiceCID); nsCOMPtr stringBundle; + nsILocale *locale = nsnull; - rv = stringService->CreateBundle(kCommonDialogsProperties, getter_AddRefs(stringBundle)); + rv = stringService->CreateBundle(kCommonDialogsProperties, locale, getter_AddRefs(stringBundle)); if (NS_FAILED(rv)) return NS_ERROR_FAILURE; rv = stringBundle->GetStringFromName(NS_ConvertASCIItoUCS2(aKey).GetUnicode(), aResult); diff --git a/mozilla/extensions/cookie/nsUtils.cpp b/mozilla/extensions/cookie/nsUtils.cpp index c38c2c9e371..c6cc137004e 100644 --- a/mozilla/extensions/cookie/nsUtils.cpp +++ b/mozilla/extensions/cookie/nsUtils.cpp @@ -268,8 +268,9 @@ CKutil_Localize(const PRUnichar *genericString) { PRUnichar *ptrv = nsnull; NS_WITH_SERVICE(nsIStringBundleService, pStringService, kStringBundleServiceCID, &ret); if (NS_SUCCEEDED(ret) && (nsnull != pStringService)) { + nsCOMPtr locale; nsCOMPtr bundle; - ret = pStringService->CreateBundle(LOCALIZATION, getter_AddRefs(bundle)); + ret = pStringService->CreateBundle(LOCALIZATION, locale, getter_AddRefs(bundle)); if (NS_SUCCEEDED(ret) && bundle) { ret = bundle->GetStringFromName(genericString, &ptrv); if ( NS_SUCCEEDED(ret) && (ptrv) ) { diff --git a/mozilla/extensions/cookie/tests/TestCookie.cpp b/mozilla/extensions/cookie/tests/TestCookie.cpp index cd5cd5f26ab..82a62f17513 100644 --- a/mozilla/extensions/cookie/tests/TestCookie.cpp +++ b/mozilla/extensions/cookie/tests/TestCookie.cpp @@ -90,7 +90,9 @@ int main(PRInt32 argc, char *argv[]) { nsCOMPtr stringBundle; char* propertyURL = "chrome://necko/locale/necko.properties"; - rv = bundleService->CreateBundle(propertyURL, getter_AddRefs(stringBundle)); + nsILocale *locale = nsnull; + rv = bundleService->CreateBundle(propertyURL, locale, + getter_AddRefs(stringBundle)); } NS_WITH_SERVICE(nsICookieService, cookieService, kCookieServiceCID, &rv); diff --git a/mozilla/extensions/p3p/src/nsP3PService.cpp b/mozilla/extensions/p3p/src/nsP3PService.cpp index 4cd39fc97b3..da2cdc74c5c 100644 --- a/mozilla/extensions/p3p/src/nsP3PService.cpp +++ b/mozilla/extensions/p3p/src/nsP3PService.cpp @@ -346,6 +346,7 @@ nsP3PService::Init( ) { ("P3PService: Creating string bundle.\n") ); rv = pStringBundleService->CreateBundle((const char *)xcsSpec, + nsnull, getter_AddRefs( mStringBundle ) ); } } diff --git a/mozilla/extensions/psm-glue/src/nsFSDR.cpp b/mozilla/extensions/psm-glue/src/nsFSDR.cpp index 3ad65b2d84d..abe816c4eb9 100644 --- a/mozilla/extensions/psm-glue/src/nsFSDR.cpp +++ b/mozilla/extensions/psm-glue/src/nsFSDR.cpp @@ -105,6 +105,7 @@ Wallet_Localize(char* genericString) { NS_RELEASE(url); return v.ToNewUnicode(); } + nsILocale* locale = nsnull; nsIStringBundle* bundle = nsnull; char* spec = nsnull; ret = url->GetSpec(&spec); @@ -115,7 +116,7 @@ Wallet_Localize(char* genericString) { nsCRT::free(spec); return v.ToNewUnicode(); } - ret = pStringService->CreateBundle(spec, &bundle); + ret = pStringService->CreateBundle(spec, locale, &bundle); nsCRT::free(spec); if (NS_FAILED(ret)) { printf("cannot create instance\n"); diff --git a/mozilla/extensions/psm-glue/src/nsSecureBrowserUIImpl.cpp b/mozilla/extensions/psm-glue/src/nsSecureBrowserUIImpl.cpp index bf865b7c8ca..f4d5f5be0c7 100644 --- a/mozilla/extensions/psm-glue/src/nsSecureBrowserUIImpl.cpp +++ b/mozilla/extensions/psm-glue/src/nsSecureBrowserUIImpl.cpp @@ -167,7 +167,8 @@ nsSecureBrowserUIImpl::Init(nsIDOMWindowInternal *window, nsIDOMElement *button) NS_WITH_SERVICE(nsIStringBundleService, service, kCStringBundleServiceCID, &rv); if (NS_FAILED(rv)) return rv; - rv = service->CreateBundle(SECURITY_STRING_BUNDLE_URL, getter_AddRefs(mStringBundle)); + nsILocale* locale = nsnull; + rv = service->CreateBundle(SECURITY_STRING_BUNDLE_URL, locale, getter_AddRefs(mStringBundle)); if (NS_FAILED(rv)) return rv; // hook up to the form post notifications: diff --git a/mozilla/extensions/wallet/src/wallet.cpp b/mozilla/extensions/wallet/src/wallet.cpp index 7b5a05ce9e1..e998ecb359d 100644 --- a/mozilla/extensions/wallet/src/wallet.cpp +++ b/mozilla/extensions/wallet/src/wallet.cpp @@ -49,6 +49,7 @@ #include "nsAppDirectoryServiceDefs.h" #include "nsIStringBundle.h" +#include "nsILocale.h" #include "nsIFileSpec.h" #include "prmem.h" #include "prprf.h" @@ -462,8 +463,9 @@ Wallet_Localize(char* genericString) { #endif return v.ToNewUnicode(); } + nsCOMPtr locale; nsCOMPtr bundle; - ret = pStringService->CreateBundle(PROPERTIES_URL, getter_AddRefs(bundle)); + ret = pStringService->CreateBundle(PROPERTIES_URL, locale, getter_AddRefs(bundle)); if (NS_FAILED(ret)) { #ifdef DEBUG printf("cannot create instance\n"); diff --git a/mozilla/intl/strres/public/nsIStringBundle.idl b/mozilla/intl/strres/public/nsIStringBundle.idl index 2c5eeadad89..bc063d9ba71 100644 --- a/mozilla/intl/strres/public/nsIStringBundle.idl +++ b/mozilla/intl/strres/public/nsIStringBundle.idl @@ -22,9 +22,12 @@ #include "nsISupports.idl" #include "nsIEnumerator.idl" +#include "nsILocale.idl" %{C++ +#include "nsILocale.h" + // Define Contractid and CID // {D85A17C1-AA7C-11d2-9B8C-00805F8A16D9} #define NS_STRINGBUNDLESERVICE_CID \ @@ -91,8 +94,10 @@ interface nsIStringBundle : nsISupports [scriptable, uuid(D85A17C0-AA7C-11d2-9B8C-00805F8A16D9)] interface nsIStringBundleService : nsISupports { - nsIStringBundle CreateBundle([const] in string aURLSpec); + nsIStringBundle CreateBundle([const] in string aURLSpec, + in nsILocale aLocale); nsIStringBundle CreateAsyncBundle([const] in string aURLSpec); + nsIStringBundle CreateExtensibleBundle([const] in string aRegistryKey); /** diff --git a/mozilla/intl/strres/src/nsAcceptLang.cpp b/mozilla/intl/strres/src/nsAcceptLang.cpp index 4b573c67c6c..7040c85b402 100644 --- a/mozilla/intl/strres/src/nsAcceptLang.cpp +++ b/mozilla/intl/strres/src/nsAcceptLang.cpp @@ -27,6 +27,7 @@ #include "nsIServiceManager.h" #include "nsID.h" #include "nsString.h" +#include "nsILocale.h" #include "nsIStringBundle.h" #include "nsAcceptLang.h" @@ -86,10 +87,10 @@ nsAcceptLang::GetAcceptLangFromLocale(const PRUnichar *aLocale, PRUnichar **_ret nsIStringBundle *bundle = nsnull; #if 1 res = sBundleService->CreateBundle("resource:/res/language.properties", - &bundle); + nsnull, &bundle); #else res = sBundleService->CreateBundle("chrome://global/locale/languageNames.properties", - &bundle); + nsnull, &bundle); #endif PRUnichar *ptrv = nsnull; nsString lc_tmp(aLocale); @@ -181,7 +182,7 @@ nsAcceptLang::GetLocaleFromAcceptLang(const PRUnichar *aName, PRUnichar **_retva nsIStringBundle *bundle = nsnull; /* shall we put the file in res/ instead ? */ res = sBundleService->CreateBundle("chrome://global/locale/accept2locale.properties", - &bundle); + nsnull, &bundle); PRUnichar *ptrv = nsnull; if (NS_OK == (res = bundle->GetStringFromName(acceptLang.GetUnicode(), &ptrv))) { diff --git a/mozilla/intl/strres/src/nsStringBundle.cpp b/mozilla/intl/strres/src/nsStringBundle.cpp index 49d7e9fb9d3..c59b3a9390f 100644 --- a/mozilla/intl/strres/src/nsStringBundle.cpp +++ b/mozilla/intl/strres/src/nsStringBundle.cpp @@ -606,7 +606,7 @@ nsExtensibleStringBundle::Init(const char * aRegistryKey) res = registry->GetStringUTF8(key, "name", getter_Copies(name)); if (NS_FAILED(res)) return res; - res = sbServ->CreateBundle(name, getter_AddRefs(bundle)); + res = sbServ->CreateBundle(name, nsnull, getter_AddRefs(bundle)); if (NS_FAILED(res)) { res = components->Next(); if (NS_FAILED(res)) return res; @@ -956,7 +956,8 @@ nsStringBundleService::recycleEntry(bundleCacheEntry_t *aEntry) } NS_IMETHODIMP -nsStringBundleService::CreateBundle(const char* aURLSpec, nsIStringBundle** aResult) +nsStringBundleService::CreateBundle(const char* aURLSpec, nsILocale* aLocale, + nsIStringBundle** aResult) { #ifdef DEBUG_tao_ printf("\n++ nsStringBundleService::CreateBundle ++\n"); diff --git a/mozilla/intl/strres/tests/StringBundleTest.cpp b/mozilla/intl/strres/tests/StringBundleTest.cpp index 05dc4757ed0..e5063754989 100644 --- a/mozilla/intl/strres/tests/StringBundleTest.cpp +++ b/mozilla/intl/strres/tests/StringBundleTest.cpp @@ -27,6 +27,7 @@ #include "nsIStringBundle.h" #include "nsIAcceptLang.h" #include "nsIEventQueueService.h" +#include "nsILocale.h" #include #include "nsIIOService.h" @@ -77,9 +78,54 @@ static NS_DEFINE_IID(kIAcceptLangIID, NS_IACCEPTLANG_IID); // //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// +#include "nsILocale.h" #include "nsILocaleService.h" #include "nsLocaleCID.h" +// +// +// +nsILocale* +get_applocale(void) +{ + nsresult result; + nsILocale* locale; + nsString* category; + nsString* value; + PRUnichar *lc_name_unichar; + + // get a locale service + nsCOMPtr localeService = do_GetService(NS_LOCALESERVICE_CONTRACTID, &result); + NS_ASSERTION(NS_SUCCEEDED(result),"nsLocaleTest: get locale service failed"); + + // + // test GetApplicationLocale + // + result = localeService->GetApplicationLocale(&locale); + NS_ASSERTION(NS_SUCCEEDED(result),"nsLocaleTest: factory_get_locale failed"); + NS_ASSERTION(locale!=NULL,"nsLocaleTest: factory_get_locale failed"); + + // + // test and make sure the locale is a valid Interface + // + locale->AddRef(); + + category = new nsString(); + category->AssignWithConversion("NSILOCALE_MESSAGES"); + value = new nsString(); + + result = locale->GetCategory(category->GetUnicode(),&lc_name_unichar); + value->Assign(lc_name_unichar); + NS_ASSERTION(NS_SUCCEEDED(result),"nsLocaleTest: factory_get_locale failed"); + NS_ASSERTION(value->Length()>0,"nsLocaleTest: factory_get_locale failed"); + + locale->Release(); + delete category; + delete value; + + return locale; +} + //////////////////////////////////////////////////////////////////////////////////////////////////// // @@ -143,9 +189,15 @@ main(int argc, char *argv[]) } printf("\n ** created AcceptLang service\n"); + nsILocale* locale = get_applocale(); + nsIStringBundle* bundle = nsnull; - ret = service->CreateBundle(TEST_URL, &bundle); + ret = service->CreateBundle(TEST_URL, locale, &bundle); + + /* free it + */ + locale->Release(); if (NS_FAILED(ret)) { printf("cannot create instance\n"); diff --git a/mozilla/layout/forms/nsFormControlHelper.cpp b/mozilla/layout/forms/nsFormControlHelper.cpp index 9fe80bec0c5..bdd7f724b26 100644 --- a/mozilla/layout/forms/nsFormControlHelper.cpp +++ b/mozilla/layout/forms/nsFormControlHelper.cpp @@ -895,7 +895,8 @@ nsFormControlHelper::GetLocalizedString(const char * aPropFileName, const char* nsXPIDLCString spec; rv = uri->GetSpec(getter_Copies(spec)); if (NS_SUCCEEDED(rv) && spec) { - rv = stringService->CreateBundle(spec, getter_AddRefs(bundle)); + nsCOMPtr locale = nsnull; + rv = stringService->CreateBundle(spec, locale, getter_AddRefs(bundle)); } } } diff --git a/mozilla/layout/html/forms/src/nsFormControlHelper.cpp b/mozilla/layout/html/forms/src/nsFormControlHelper.cpp index 9fe80bec0c5..bdd7f724b26 100644 --- a/mozilla/layout/html/forms/src/nsFormControlHelper.cpp +++ b/mozilla/layout/html/forms/src/nsFormControlHelper.cpp @@ -895,7 +895,8 @@ nsFormControlHelper::GetLocalizedString(const char * aPropFileName, const char* nsXPIDLCString spec; rv = uri->GetSpec(getter_Copies(spec)); if (NS_SUCCEEDED(rv) && spec) { - rv = stringService->CreateBundle(spec, getter_AddRefs(bundle)); + nsCOMPtr locale = nsnull; + rv = stringService->CreateBundle(spec, locale, getter_AddRefs(bundle)); } } } diff --git a/mozilla/layout/xul/base/src/nsMenuFrame.cpp b/mozilla/layout/xul/base/src/nsMenuFrame.cpp index 7435b88a556..983a9e0e16a 100644 --- a/mozilla/layout/xul/base/src/nsMenuFrame.cpp +++ b/mozilla/layout/xul/base/src/nsMenuFrame.cpp @@ -1280,6 +1280,7 @@ nsMenuFrame::BuildAcceleratorText(nsString& aAccelString) if (NS_SUCCEEDED(rv) && bundleService) { nsCOMPtr bundle; rv = bundleService->CreateBundle("chrome://global/locale/keys.properties", + nsnull, getter_AddRefs(bundle)); if (NS_SUCCEEDED(rv) && bundle) { diff --git a/mozilla/mailnews/absync/src/nsABSyncDriver.cpp b/mozilla/mailnews/absync/src/nsABSyncDriver.cpp index b4bfe5496d8..8c41a8d0c32 100644 --- a/mozilla/mailnews/absync/src/nsABSyncDriver.cpp +++ b/mozilla/mailnews/absync/src/nsABSyncDriver.cpp @@ -232,7 +232,8 @@ nsAbSyncDriver::GetString(const PRUnichar *aStringName) NS_WITH_SERVICE(nsIStringBundleService, sBundleService, kStringBundleServiceCID, &res); if (NS_SUCCEEDED(res) && (nsnull != sBundleService)) { - res = sBundleService->CreateBundle(propertyURL, getter_AddRefs(mStringBundle)); + nsILocale *locale = nsnull; + res = sBundleService->CreateBundle(propertyURL, locale, getter_AddRefs(mStringBundle)); } } diff --git a/mozilla/mailnews/absync/src/nsAbSync.cpp b/mozilla/mailnews/absync/src/nsAbSync.cpp index 2b1b6c09b14..da25136b492 100644 --- a/mozilla/mailnews/absync/src/nsAbSync.cpp +++ b/mozilla/mailnews/absync/src/nsAbSync.cpp @@ -2998,7 +2998,8 @@ nsAbSync::GetString(const PRUnichar *aStringName) NS_WITH_SERVICE(nsIStringBundleService, sBundleService, kStringBundleServiceCID, &res); if (NS_SUCCEEDED(res) && (nsnull != sBundleService)) { - res = sBundleService->CreateBundle(propertyURL, getter_AddRefs(mStringBundle)); + nsILocale *locale = nsnull; + res = sBundleService->CreateBundle(propertyURL, locale, getter_AddRefs(mStringBundle)); } } diff --git a/mozilla/mailnews/base/src/nsMessenger.cpp b/mozilla/mailnews/base/src/nsMessenger.cpp index 2bcdd81ffcd..702a6665b09 100644 --- a/mozilla/mailnews/base/src/nsMessenger.cpp +++ b/mozilla/mailnews/base/src/nsMessenger.cpp @@ -1737,7 +1737,8 @@ nsMessenger::InitStringBundle() kStringBundleServiceCID, &res); if (NS_SUCCEEDED(res) && (nsnull != sBundleService)) { - res = sBundleService->CreateBundle(propertyURL, + nsILocale *locale = nsnull; + res = sBundleService->CreateBundle(propertyURL, locale, getter_AddRefs(mStringBundle)); } } diff --git a/mozilla/mailnews/base/src/nsMessengerMigrator.cpp b/mozilla/mailnews/base/src/nsMessengerMigrator.cpp index d9dbb624c73..ca820f12935 100644 --- a/mozilla/mailnews/base/src/nsMessengerMigrator.cpp +++ b/mozilla/mailnews/base/src/nsMessengerMigrator.cpp @@ -409,6 +409,7 @@ nsMessengerMigrator::initializeStrings() nsCOMPtr bundle; rv = bundleService->CreateBundle("chrome://messenger/locale/messenger.properties", + nsnull, getter_AddRefs(bundle)); NS_ENSURE_SUCCESS(rv, rv); diff --git a/mozilla/mailnews/base/src/nsMsgAccountManagerDS.cpp b/mozilla/mailnews/base/src/nsMsgAccountManagerDS.cpp index a2c4ac3f35b..2e7c35df4f2 100644 --- a/mozilla/mailnews/base/src/nsMsgAccountManagerDS.cpp +++ b/mozilla/mailnews/base/src/nsMsgAccountManagerDS.cpp @@ -898,6 +898,7 @@ nsMsgAccountManagerDataSource::getStringBundle() if (NS_FAILED(rv)) return rv; rv = strBundleService->CreateBundle("chrome://messenger/locale/prefs.properties", + nsnull, // default locale getter_AddRefs(mStringBundle)); return rv; } diff --git a/mozilla/mailnews/base/src/nsMsgDBView.cpp b/mozilla/mailnews/base/src/nsMsgDBView.cpp index 63facbf973d..e78d736a9e7 100644 --- a/mozilla/mailnews/base/src/nsMsgDBView.cpp +++ b/mozilla/mailnews/base/src/nsMsgDBView.cpp @@ -182,7 +182,7 @@ PRUnichar * nsMsgDBView::GetString(const PRUnichar *aStringName) char *propertyURL = MESSENGER_STRING_URL; nsCOMPtr sBundleService = do_GetService(kStringBundleServiceCID, &res); if (NS_SUCCEEDED(res) && sBundleService) - res = sBundleService->CreateBundle(propertyURL, getter_AddRefs(mMessengerStringBundle)); + res = sBundleService->CreateBundle(propertyURL, nsnull, getter_AddRefs(mMessengerStringBundle)); } if (mMessengerStringBundle) diff --git a/mozilla/mailnews/base/src/nsMsgFolderCompactor.cpp b/mozilla/mailnews/base/src/nsMsgFolderCompactor.cpp index 32a5dde41b3..711112a4584 100644 --- a/mozilla/mailnews/base/src/nsMsgFolderCompactor.cpp +++ b/mozilla/mailnews/base/src/nsMsgFolderCompactor.cpp @@ -227,7 +227,8 @@ nsresult nsFolderCompactState::GetStatusFromMsgName(const char *statusMsgName, P kStringBundleServiceCID, &res); if (NS_SUCCEEDED(res) && (nsnull != sBundleService)) { - res = sBundleService->CreateBundle(propertyURL, getter_AddRefs(stringBundle)); + res = sBundleService->CreateBundle(propertyURL, nsnull, + getter_AddRefs(stringBundle)); } if (stringBundle) { diff --git a/mozilla/mailnews/base/src/nsMsgOfflineManager.cpp b/mozilla/mailnews/base/src/nsMsgOfflineManager.cpp index 36463ccdda5..d7ccf79c049 100644 --- a/mozilla/mailnews/base/src/nsMsgOfflineManager.cpp +++ b/mozilla/mailnews/base/src/nsMsgOfflineManager.cpp @@ -265,7 +265,8 @@ nsresult nsMsgOfflineManager::ShowStatus(const char *statusMsgName) kStringBundleServiceCID, &res); if (NS_SUCCEEDED(res) && (nsnull != sBundleService)) { - res = sBundleService->CreateBundle(propertyURL, getter_AddRefs(mStringBundle)); + res = sBundleService->CreateBundle(propertyURL, nsnull, + getter_AddRefs(mStringBundle)); } } if (mStringBundle) diff --git a/mozilla/mailnews/base/src/nsMsgPrintEngine.cpp b/mozilla/mailnews/base/src/nsMsgPrintEngine.cpp index f742cad7d91..01be4aae795 100644 --- a/mozilla/mailnews/base/src/nsMsgPrintEngine.cpp +++ b/mozilla/mailnews/base/src/nsMsgPrintEngine.cpp @@ -399,7 +399,8 @@ nsMsgPrintEngine::GetString(const PRUnichar *aStringName) NS_WITH_SERVICE(nsIStringBundleService, sBundleService, kStringBundleServiceCID, &res); if (NS_SUCCEEDED(res) && (nsnull != sBundleService)) { - res = sBundleService->CreateBundle(propertyURL, getter_AddRefs(mStringBundle)); + nsILocale *locale = nsnull; + res = sBundleService->CreateBundle(propertyURL, locale, getter_AddRefs(mStringBundle)); } } diff --git a/mozilla/mailnews/base/src/nsMsgStatusFeedback.cpp b/mozilla/mailnews/base/src/nsMsgStatusFeedback.cpp index 84674c7fb83..177609aed77 100644 --- a/mozilla/mailnews/base/src/nsMsgStatusFeedback.cpp +++ b/mozilla/mailnews/base/src/nsMsgStatusFeedback.cpp @@ -58,6 +58,7 @@ nsMsgStatusFeedback::nsMsgStatusFeedback() : if (NS_SUCCEEDED(rv)) bundleService->CreateBundle("chrome://messenger/locale/messenger.properties", + nsnull, getter_AddRefs(mBundle)); } } diff --git a/mozilla/mailnews/base/util/nsMsgFolder.cpp b/mozilla/mailnews/base/util/nsMsgFolder.cpp index 90c2038073c..edaafd30adb 100644 --- a/mozilla/mailnews/base/util/nsMsgFolder.cpp +++ b/mozilla/mailnews/base/util/nsMsgFolder.cpp @@ -188,6 +188,7 @@ nsMsgFolder::initializeStrings() nsCOMPtr bundle; rv = bundleService->CreateBundle("chrome://messenger/locale/messenger.properties", + nsnull, getter_AddRefs(bundle)); NS_ENSURE_SUCCESS(rv, rv); diff --git a/mozilla/mailnews/base/util/nsMsgIncomingServer.cpp b/mozilla/mailnews/base/util/nsMsgIncomingServer.cpp index e6846f65609..16f960267f1 100644 --- a/mozilla/mailnews/base/util/nsMsgIncomingServer.cpp +++ b/mozilla/mailnews/base/util/nsMsgIncomingServer.cpp @@ -1276,7 +1276,8 @@ NS_IMETHODIMP nsMsgIncomingServer::DisplayOfflineMsg(nsIMsgWindow *aMsgWindow) NS_ENSURE_SUCCESS(rv, rv); nsCOMPtr bundle; - rv = bundleService->CreateBundle(BASE_MSGS_URL, getter_AddRefs(bundle)); + rv = bundleService->CreateBundle(BASE_MSGS_URL, nsnull, + getter_AddRefs(bundle)); NS_ENSURE_SUCCESS(rv, rv); if (bundle) { diff --git a/mozilla/mailnews/compose/src/nsMsgComposeStringBundle.cpp b/mozilla/mailnews/compose/src/nsMsgComposeStringBundle.cpp index 20df684a932..3202757b6af 100644 --- a/mozilla/mailnews/compose/src/nsMsgComposeStringBundle.cpp +++ b/mozilla/mailnews/compose/src/nsMsgComposeStringBundle.cpp @@ -86,7 +86,7 @@ nsComposeStringService::InitializeStringBundle() nsCOMPtr stringService = do_GetService(kStringBundleServiceCID); NS_ENSURE_TRUE(stringService, NS_ERROR_FAILURE); - NS_ENSURE_SUCCESS(stringService->CreateBundle(COMPOSE_BE_URL, getter_AddRefs(mComposeStringBundle)), + NS_ENSURE_SUCCESS(stringService->CreateBundle(COMPOSE_BE_URL, nsnull, getter_AddRefs(mComposeStringBundle)), NS_ERROR_FAILURE); return NS_OK; } diff --git a/mozilla/mailnews/imap/src/nsImapIncomingServer.cpp b/mozilla/mailnews/imap/src/nsImapIncomingServer.cpp index f5893240e81..c2dde696e41 100644 --- a/mozilla/mailnews/imap/src/nsImapIncomingServer.cpp +++ b/mozilla/mailnews/imap/src/nsImapIncomingServer.cpp @@ -1793,7 +1793,9 @@ nsresult nsImapIncomingServer::GetStringBundle() NS_WITH_SERVICE(nsIStringBundleService, sBundleService, kStringBundleServiceCID, &res); if (NS_SUCCEEDED(res) && (nsnull != sBundleService)) { - res = sBundleService->CreateBundle(propertyURL, getter_AddRefs(m_stringBundle)); + nsILocale *locale = nsnull; + + res = sBundleService->CreateBundle(propertyURL, locale, getter_AddRefs(m_stringBundle)); } } return (m_stringBundle) ? NS_OK : res; diff --git a/mozilla/mailnews/imap/src/nsImapStringBundle.cpp b/mozilla/mailnews/imap/src/nsImapStringBundle.cpp index e044bfb0ede..3d8fb2158b4 100644 --- a/mozilla/mailnews/imap/src/nsImapStringBundle.cpp +++ b/mozilla/mailnews/imap/src/nsImapStringBundle.cpp @@ -46,8 +46,10 @@ IMAPGetStringByID(PRInt32 stringID) NS_WITH_SERVICE(nsIStringBundleService, sBundleService, kStringBundleServiceCID, &res); if (NS_SUCCEEDED(res) && (nsnull != sBundleService)) { + nsILocale *locale = nsnull; + nsIStringBundle* sBundle = nsnull; - res = sBundleService->CreateBundle(propertyURL, &sBundle); + res = sBundleService->CreateBundle(propertyURL, locale, &sBundle); if (NS_SUCCEEDED(res)) { diff --git a/mozilla/mailnews/import/eudora/src/nsEudoraStringBundle.cpp b/mozilla/mailnews/import/eudora/src/nsEudoraStringBundle.cpp index 23554e8609f..282f90f72f5 100644 --- a/mozilla/mailnews/import/eudora/src/nsEudoraStringBundle.cpp +++ b/mozilla/mailnews/import/eudora/src/nsEudoraStringBundle.cpp @@ -45,7 +45,8 @@ nsIStringBundle *nsEudoraStringBundle::GetStringBundle( void) NS_WITH_SERVICE(nsIStringBundleService, sBundleService, kStringBundleServiceCID, &rv); if (NS_SUCCEEDED(rv) && (nsnull != sBundleService)) { - rv = sBundleService->CreateBundle(propertyURL, &sBundle); + nsILocale * locale = nsnull; + rv = sBundleService->CreateBundle(propertyURL, locale, &sBundle); } m_pBundle = sBundle; diff --git a/mozilla/mailnews/import/oexpress/nsOEStringBundle.cpp b/mozilla/mailnews/import/oexpress/nsOEStringBundle.cpp index 4d52c6e5d8e..c878a4d8649 100644 --- a/mozilla/mailnews/import/oexpress/nsOEStringBundle.cpp +++ b/mozilla/mailnews/import/oexpress/nsOEStringBundle.cpp @@ -48,7 +48,8 @@ nsIStringBundle *nsOEStringBundle::GetStringBundle( void) NS_WITH_SERVICE(nsIStringBundleService, sBundleService, kStringBundleServiceCID, &rv); if (NS_SUCCEEDED(rv) && (nsnull != sBundleService)) { - rv = sBundleService->CreateBundle(propertyURL, &sBundle); + nsILocale * locale = nsnull; + rv = sBundleService->CreateBundle(propertyURL, locale, &sBundle); } m_pBundle = sBundle; diff --git a/mozilla/mailnews/import/outlook/src/nsOutlookStringBundle.cpp b/mozilla/mailnews/import/outlook/src/nsOutlookStringBundle.cpp index ef4439aca07..39cab858110 100644 --- a/mozilla/mailnews/import/outlook/src/nsOutlookStringBundle.cpp +++ b/mozilla/mailnews/import/outlook/src/nsOutlookStringBundle.cpp @@ -48,7 +48,8 @@ nsIStringBundle *nsOutlookStringBundle::GetStringBundle( void) NS_WITH_SERVICE(nsIStringBundleService, sBundleService, kStringBundleServiceCID, &rv); if (NS_SUCCEEDED(rv) && (nsnull != sBundleService)) { - rv = sBundleService->CreateBundle(propertyURL, &sBundle); + nsILocale * locale = nsnull; + rv = sBundleService->CreateBundle(propertyURL, locale, &sBundle); } m_pBundle = sBundle; diff --git a/mozilla/mailnews/import/src/nsImportStringBundle.cpp b/mozilla/mailnews/import/src/nsImportStringBundle.cpp index fda810a0ad0..9a7276283b2 100644 --- a/mozilla/mailnews/import/src/nsImportStringBundle.cpp +++ b/mozilla/mailnews/import/src/nsImportStringBundle.cpp @@ -48,7 +48,8 @@ nsIStringBundle *nsImportStringBundle::GetStringBundle( void) NS_WITH_SERVICE(nsIStringBundleService, sBundleService, kStringBundleServiceCID, &rv); if (NS_SUCCEEDED(rv) && (nsnull != sBundleService)) { - rv = sBundleService->CreateBundle(propertyURL, &sBundle); + nsILocale * locale = nsnull; + rv = sBundleService->CreateBundle(propertyURL, locale, &sBundle); } m_pBundle = sBundle; diff --git a/mozilla/mailnews/import/text/src/nsTextStringBundle.cpp b/mozilla/mailnews/import/text/src/nsTextStringBundle.cpp index e24f720872e..657c135fbba 100644 --- a/mozilla/mailnews/import/text/src/nsTextStringBundle.cpp +++ b/mozilla/mailnews/import/text/src/nsTextStringBundle.cpp @@ -45,7 +45,8 @@ nsIStringBundle *nsTextStringBundle::GetStringBundle( void) NS_WITH_SERVICE(nsIStringBundleService, sBundleService, kStringBundleServiceCID, &rv); if (NS_SUCCEEDED(rv) && (nsnull != sBundleService)) { - rv = sBundleService->CreateBundle(propertyURL, &sBundle); + nsILocale * locale = nsnull; + rv = sBundleService->CreateBundle(propertyURL, locale, &sBundle); } m_pBundle = sBundle; diff --git a/mozilla/mailnews/local/src/nsLocalStringBundle.cpp b/mozilla/mailnews/local/src/nsLocalStringBundle.cpp index 04085bfeb03..019ad8ac141 100644 --- a/mozilla/mailnews/local/src/nsLocalStringBundle.cpp +++ b/mozilla/mailnews/local/src/nsLocalStringBundle.cpp @@ -85,7 +85,7 @@ nsLocalStringService::InitializeStringBundle() NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_TRUE(stringService, NS_ERROR_FAILURE); - rv = stringService->CreateBundle(LOCAL_MSGS_URL, getter_AddRefs(mLocalStringBundle)); + rv = stringService->CreateBundle(LOCAL_MSGS_URL, nsnull, getter_AddRefs(mLocalStringBundle)); return rv; } diff --git a/mozilla/mailnews/local/src/nsPop3IncomingServer.cpp b/mozilla/mailnews/local/src/nsPop3IncomingServer.cpp index d0e3af056b0..29321887173 100644 --- a/mozilla/mailnews/local/src/nsPop3IncomingServer.cpp +++ b/mozilla/mailnews/local/src/nsPop3IncomingServer.cpp @@ -102,6 +102,7 @@ nsPop3IncomingServer::initializeStrings() nsCOMPtr bundle; rv = bundleService->CreateBundle("chrome://messenger/locale/messenger.properties", + nsnull, getter_AddRefs(bundle)); NS_ENSURE_SUCCESS(rv, rv); diff --git a/mozilla/modules/libpref/src/nsPrefBranch.cpp b/mozilla/modules/libpref/src/nsPrefBranch.cpp index 4d14775f348..965ffc66025 100644 --- a/mozilla/modules/libpref/src/nsPrefBranch.cpp +++ b/mozilla/modules/libpref/src/nsPrefBranch.cpp @@ -623,7 +623,7 @@ nsresult nsPrefBranch::GetDefaultFromPropertiesFile(const char *aPrefName, PRUni return rv; nsCOMPtr bundle; - rv = bundleService->CreateBundle(propertyFileURL, + rv = bundleService->CreateBundle(propertyFileURL, nsnull, getter_AddRefs(bundle)); if (NS_FAILED(rv)) return rv; diff --git a/mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp b/mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp index 8e864f33d5a..e25aa2bdda8 100644 --- a/mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp +++ b/mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp @@ -68,6 +68,7 @@ #include "nsIWindowWatcher.h" #include "nsHashtable.h" +#include "nsILocale.h" #include "nsIScriptGlobalObject.h" #include "nsIScriptGlobalObjectOwner.h" #include "nsIPrincipal.h" @@ -214,6 +215,7 @@ void DisplayNoDefaultPluginDialog(const char *mimeType) nsCOMPtr regionalBundle; nsCOMPtr uri; char *spec = nsnull; + nsILocale* locale = nsnull; PRBool displayDialogPrefValue = PR_FALSE, checkboxState = PR_FALSE; if (!prefs || !prompt || !io || !strings) { @@ -231,11 +233,11 @@ void DisplayNoDefaultPluginDialog(const char *mimeType) // Taken from mozilla\extensions\wallet\src\wallet.cpp // WalletLocalize(). - rv = strings->CreateBundle(PLUGIN_PROPERTIES_URL, getter_AddRefs(bundle)); + rv = strings->CreateBundle(PLUGIN_PROPERTIES_URL, locale, getter_AddRefs(bundle)); if (NS_FAILED(rv)) { return; } - rv = strings->CreateBundle(PLUGIN_REGIONAL_URL, + rv = strings->CreateBundle(PLUGIN_REGIONAL_URL, locale, getter_AddRefs(regionalBundle)); if (NS_FAILED(rv)) { return; @@ -3299,6 +3301,7 @@ NS_IMETHODIMP nsPluginHostImpl::GetPluginFactory(const char *aMimeType, nsIPlugi if (nsnull == pluginTag->mLibrary) // if we haven't done this yet { nsFileSpec file(pluginTag->mFileName); + nsPluginFile pluginFile(file); PRLibrary* pluginLibrary = NULL; @@ -4475,6 +4478,7 @@ NS_IMETHODIMP nsPluginHostImpl::HandleBadPlugin(PRLibrary* aLibrary) nsCOMPtr bundle; nsCOMPtr uri; char *spec = nsnull; + nsILocale* locale = nsnull; PRInt32 buttonPressed; PRBool checkboxState = PR_FALSE; @@ -4490,7 +4494,7 @@ NS_IMETHODIMP nsPluginHostImpl::HandleBadPlugin(PRLibrary* aLibrary) return rv; } - rv = strings->CreateBundle(spec, getter_AddRefs(bundle)); + rv = strings->CreateBundle(spec, locale, getter_AddRefs(bundle)); nsCRT::free(spec); if (NS_FAILED(rv)) return rv; diff --git a/mozilla/modules/plugin/nglsrc/nsPluginHostImpl.cpp b/mozilla/modules/plugin/nglsrc/nsPluginHostImpl.cpp index 8e864f33d5a..e25aa2bdda8 100644 --- a/mozilla/modules/plugin/nglsrc/nsPluginHostImpl.cpp +++ b/mozilla/modules/plugin/nglsrc/nsPluginHostImpl.cpp @@ -68,6 +68,7 @@ #include "nsIWindowWatcher.h" #include "nsHashtable.h" +#include "nsILocale.h" #include "nsIScriptGlobalObject.h" #include "nsIScriptGlobalObjectOwner.h" #include "nsIPrincipal.h" @@ -214,6 +215,7 @@ void DisplayNoDefaultPluginDialog(const char *mimeType) nsCOMPtr regionalBundle; nsCOMPtr uri; char *spec = nsnull; + nsILocale* locale = nsnull; PRBool displayDialogPrefValue = PR_FALSE, checkboxState = PR_FALSE; if (!prefs || !prompt || !io || !strings) { @@ -231,11 +233,11 @@ void DisplayNoDefaultPluginDialog(const char *mimeType) // Taken from mozilla\extensions\wallet\src\wallet.cpp // WalletLocalize(). - rv = strings->CreateBundle(PLUGIN_PROPERTIES_URL, getter_AddRefs(bundle)); + rv = strings->CreateBundle(PLUGIN_PROPERTIES_URL, locale, getter_AddRefs(bundle)); if (NS_FAILED(rv)) { return; } - rv = strings->CreateBundle(PLUGIN_REGIONAL_URL, + rv = strings->CreateBundle(PLUGIN_REGIONAL_URL, locale, getter_AddRefs(regionalBundle)); if (NS_FAILED(rv)) { return; @@ -3299,6 +3301,7 @@ NS_IMETHODIMP nsPluginHostImpl::GetPluginFactory(const char *aMimeType, nsIPlugi if (nsnull == pluginTag->mLibrary) // if we haven't done this yet { nsFileSpec file(pluginTag->mFileName); + nsPluginFile pluginFile(file); PRLibrary* pluginLibrary = NULL; @@ -4475,6 +4478,7 @@ NS_IMETHODIMP nsPluginHostImpl::HandleBadPlugin(PRLibrary* aLibrary) nsCOMPtr bundle; nsCOMPtr uri; char *spec = nsnull; + nsILocale* locale = nsnull; PRInt32 buttonPressed; PRBool checkboxState = PR_FALSE; @@ -4490,7 +4494,7 @@ NS_IMETHODIMP nsPluginHostImpl::HandleBadPlugin(PRLibrary* aLibrary) return rv; } - rv = strings->CreateBundle(spec, getter_AddRefs(bundle)); + rv = strings->CreateBundle(spec, locale, getter_AddRefs(bundle)); nsCRT::free(spec); if (NS_FAILED(rv)) return rv; diff --git a/mozilla/profile/pref-migrator/src/nsPrefMigration.cpp b/mozilla/profile/pref-migrator/src/nsPrefMigration.cpp index a6eac3bba0f..d7809dfc99c 100644 --- a/mozilla/profile/pref-migrator/src/nsPrefMigration.cpp +++ b/mozilla/profile/pref-migrator/src/nsPrefMigration.cpp @@ -2056,7 +2056,7 @@ nsPrefMigration::DetermineOldPath(nsIFileSpec *profilePath, const char *oldPathN if (NS_FAILED(rv)) return rv; nsCOMPtr bundle; - rv = bundleService->CreateBundle(MIGRATION_PROPERTIES_URL, getter_AddRefs(bundle)); + rv = bundleService->CreateBundle(MIGRATION_PROPERTIES_URL, nsnull, getter_AddRefs(bundle)); if (NS_FAILED(rv)) return rv; nsXPIDLString localizedDirName;