зеркало из https://github.com/mozilla/pjs.git
fix bug 26237. Check in for erik. Add LanguageAtomService into Mac build. r=ftang
This commit is contained in:
Родитель
5e5703580e
Коммит
80a17179bc
Двоичные данные
intl/locale/macbuild/locale.mcp
Двоичные данные
intl/locale/macbuild/locale.mcp
Двоичный файл не отображается.
Двоичные данные
intl/locale/macbuild/nsLocaleIDL.mcp
Двоичные данные
intl/locale/macbuild/nsLocaleIDL.mcp
Двоичный файл не отображается.
|
@ -1,101 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Pierre Phaneuf <pp@ludusdesign.com>
|
||||
*/
|
||||
|
||||
#include "nscore.h"
|
||||
#include "nsISupports.h"
|
||||
#include "nsIFactory.h"
|
||||
#include "nsCollationMac.h"
|
||||
#include "nsIScriptableDateFormat.h"
|
||||
#include "nsDateTimeFormatCID.h"
|
||||
#include "nsDateTimeFormatMac.h"
|
||||
#include "nsLocaleFactoryMac.h"
|
||||
|
||||
|
||||
NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID);
|
||||
NS_DEFINE_IID(kICollationFactoryIID, NS_ICOLLATIONFACTORY_IID);
|
||||
NS_DEFINE_IID(kICollationIID, NS_ICOLLATION_IID);
|
||||
NS_DEFINE_IID(kIDateTimeFormatIID, NS_IDATETIMEFORMAT_IID);
|
||||
NS_DEFINE_CID(kScriptableDateFormatCID, NS_SCRIPTABLEDATEFORMAT_CID);
|
||||
|
||||
|
||||
nsLocaleMacFactory::nsLocaleMacFactory(const nsCID &aClass)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mClassID = aClass;
|
||||
}
|
||||
|
||||
nsLocaleMacFactory::~nsLocaleMacFactory()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_THREADSAFE_ISUPPORTS1(nsLocaleMacFactory, nsIFactory)
|
||||
|
||||
nsresult nsLocaleMacFactory::CreateInstance(nsISupports *aOuter,
|
||||
const nsIID &aIID,
|
||||
void **aResult)
|
||||
{
|
||||
if (aResult == NULL) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
*aResult = NULL;
|
||||
|
||||
nsISupports *inst = NULL;
|
||||
|
||||
if (aIID.Equals(kICollationFactoryIID)) {
|
||||
NS_NEWXPCOM(inst, nsCollationFactory);
|
||||
}
|
||||
else if (aIID.Equals(kICollationIID)) {
|
||||
NS_NEWXPCOM(inst, nsCollationMac);
|
||||
}
|
||||
else if (aIID.Equals(kIDateTimeFormatIID)) {
|
||||
NS_NEWXPCOM(inst, nsDateTimeFormatMac);
|
||||
}
|
||||
else if (aIID.Equals(NS_GET_IID(nsIScriptableDateFormat))) {
|
||||
inst = NEW_SCRIPTABLE_DATEFORMAT();
|
||||
}
|
||||
else if (mClassID.Equals(kScriptableDateFormatCID)) {
|
||||
inst = NEW_SCRIPTABLE_DATEFORMAT();
|
||||
}
|
||||
else
|
||||
{
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
if (NULL == inst) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
NS_ADDREF(inst);
|
||||
nsresult res = inst->QueryInterface(aIID, aResult);
|
||||
NS_RELEASE(inst);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
nsresult nsLocaleMacFactory::LockFactory(PRBool aLock)
|
||||
{
|
||||
// Not implemented in simplest case.
|
||||
return NS_OK;
|
||||
}
|
|
@ -37,6 +37,7 @@
|
|||
#include "nsCollationCID.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsMacLocaleFactory.h"
|
||||
#include "nsILanguageAtomService.h"
|
||||
|
||||
static NS_DEFINE_CID(kComponentManagerCID, NS_COMPONENTMANAGER_CID);
|
||||
|
||||
|
@ -48,6 +49,11 @@ NS_DEFINE_IID(kILocaleFactoryIID,NS_ILOCALEFACTORY_IID);
|
|||
NS_DEFINE_IID(kMacLocaleFactoryCID,NS_MACLOCALEFACTORY_CID);
|
||||
NS_DEFINE_CID(kLocaleServiceCID, NS_LOCALESERVICE_CID);
|
||||
|
||||
//
|
||||
// for the language atom service
|
||||
//
|
||||
NS_DEFINE_CID(kLanguageAtomServiceCID, NS_LANGUAGEATOMSERVICE_CID);
|
||||
|
||||
//
|
||||
// for the collation and formatting interfaces
|
||||
//
|
||||
|
@ -210,6 +216,13 @@ extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports* aServMgr, const char *
|
|||
NS_SCRIPTABLEDATEFORMAT_PROGID, path, PR_TRUE, PR_TRUE);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv),"nsLocaleTest: Register ScriptableDateFormat failed.");
|
||||
if (NS_FAILED(rv) && (NS_ERROR_FACTORY_EXISTS != rv)) goto done;
|
||||
|
||||
//
|
||||
// register the language atom service
|
||||
//
|
||||
rv = compMgr->RegisterComponent(kLanguageAtomServiceCID, NULL, NULL, path, PR_TRUE, PR_TRUE);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv),"nsLocaleTest: Register LanguageAtomService failed.");
|
||||
if (NS_FAILED(rv) && (NS_ERROR_FACTORY_EXISTS != rv)) goto done;
|
||||
|
||||
done:
|
||||
(void)servMgr->ReleaseService(kComponentManagerCID, compMgr);
|
||||
|
@ -243,6 +256,9 @@ extern "C" NS_EXPORT nsresult NSUnregisterSelf(nsISupports* aServMgr, const char
|
|||
|
||||
rv = compMgr->UnregisterComponent(kScriptableDateFormatCID, path);
|
||||
if (NS_FAILED(rv)) goto done;
|
||||
|
||||
rv = compMgr->UnregisterComponent(kLanguageAtomServiceCID, path);
|
||||
if (NS_FAILED(rv)) goto done;
|
||||
|
||||
done:
|
||||
(void)servMgr->ReleaseService(kComponentManagerCID, compMgr);
|
||||
|
|
Загрузка…
Ссылка в новой задаче