Landing nsLocale scriptability changes

This commit is contained in:
tague%netscape.com 1999-08-02 02:59:56 +00:00
parent ceb99ae959
commit 9e5ff428bc
4 changed files with 24 additions and 8 deletions

View File

@ -334,7 +334,7 @@ sub BuildClientDist()
#LOCALE
_InstallFromManifest(":mozilla:intl:locale:public:MANIFEST", "$distdirectory:locale:");
_InstallFromManifest(":mozilla:intl:locale:public:MANIFEST_IDL", "$distdirectory:idl:");
_InstallFromManifest(":mozilla:intl:locale:idl:MANIFEST_IDL", "$distdirectory:idl:");
#LWBRK
_InstallFromManifest(":mozilla:intl:lwbrk:public:MANIFEST", "$distdirectory:lwbrk:");

Binary file not shown.

Binary file not shown.

View File

@ -23,6 +23,7 @@
#include "nsILocaleFactory.h"
#include "nsLocaleFactory.h"
#include "nsILocaleService.h"
#include "nsLocaleCID.h"
#include "nsCollationMac.h"
#include "nsDateTimeFormatMac.h"
@ -40,7 +41,7 @@ static NS_DEFINE_CID(kComponentManagerCID, NS_COMPONENTMANAGER_CID);
NS_DEFINE_IID(kLocaleFactoryCID, NS_LOCALEFACTORY_CID);
NS_DEFINE_IID(kILocaleFactoryIID,NS_ILOCALEFACTORY_IID);
NS_DEFINE_IID(kMacLocaleFactoryCID,NS_MACLOCALEFACTORY_CID);
NS_DEFINE_CID(kLocaleServiceCID, NS_LOCALESERVICE_CID);
//
// for the collation and formatting interfaces
@ -92,6 +93,13 @@ extern "C" NS_EXPORT nsresult NSGetFactory(nsISupports* serviceMgr,
printf("returning nsLocaleFactory\n");
return res;
}
if (aClass.Equals(kLocaleServiceCID)) {
factoryInstance = new nsLocaleServiceFactory();
res = factoryInstance->QueryInterface(kIFactoryIID,(void**)aFactory);
if (NS_FAILED(res)) { *aFactory=NULL; delete factoryInstance; }
return res;
}
if (aClass.Equals(kMacLocaleFactoryCID))
{
@ -146,12 +154,20 @@ extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports* aServMgr, const char *
(nsISupports**)&compMgr);
if (NS_FAILED(rv)) return rv;
//
// register the generic factory
//
rv = compMgr->RegisterComponent(kLocaleFactoryCID,NULL,NULL,path,PR_TRUE,PR_TRUE);
NS_ASSERTION(rv==NS_OK,"nsLocaleTest: RegisterFactory failed.");
if (NS_FAILED(rv) && (NS_ERROR_FACTORY_EXISTS != rv)) goto done;
//
// register the generic factory
//
rv = compMgr->RegisterComponent(kLocaleFactoryCID,"nsLocale component",
NS_LOCALE_PROGID,path,PR_TRUE,PR_TRUE);
NS_ASSERTION(rv==NS_OK,"nsLocaleTest: RegisterFactory failed.");
if (NS_FAILED(rv) && (NS_ERROR_FACTORY_EXISTS != rv)) goto done;
//
// register the service
//
rv = compMgr->RegisterComponent(kLocaleServiceCID,"nsLocaleService component",
NS_LOCALESERVICE_PROGID,path,PR_TRUE,PR_TRUE);
if (NS_FAILED(rv) && (NS_ERROR_FACTORY_EXISTS != rv)) goto done;
//
// register the generic factory