From 9d74d1f7c1e0588540e2b6c8408aacdc5ca59d7b Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Thu, 7 Feb 2013 12:45:20 +0100 Subject: mysqlc: remove component_writeInfo with passive registration Change-Id: I8ffa5ba2bbbd15533ea5097e0b018be3766ecc8b --- mysqlc/Extension_mysql-connector-ooo.mk | 2 ++ mysqlc/Library_mysqlc.mk | 2 ++ mysqlc/Module_mysqlc.mk | 1 + mysqlc/Rdb_mysqlc.mk | 16 +++++++++++ mysqlc/source/META-INF/manifest.xml | 4 +-- mysqlc/source/mysqlc.component | 15 +++++++++++ mysqlc/source/mysqlc_services.cxx | 48 --------------------------------- 7 files changed, 38 insertions(+), 50 deletions(-) create mode 100644 mysqlc/Rdb_mysqlc.mk create mode 100644 mysqlc/source/mysqlc.component (limited to 'mysqlc') diff --git a/mysqlc/Extension_mysql-connector-ooo.mk b/mysqlc/Extension_mysql-connector-ooo.mk index 23e769f97f64..ad94a2f33def 100644 --- a/mysqlc/Extension_mysql-connector-ooo.mk +++ b/mysqlc/Extension_mysql-connector-ooo.mk @@ -11,6 +11,8 @@ $(eval $(call gb_Extension_Extension,mysql-connector-ooo,mysqlc/source)) $(eval $(call gb_Extension_add_library,mysql-connector-ooo,mysqlc)) +$(eval $(call gb_Extension_add_file,mysql-connector-ooo,components.rdb,$(call gb_Rdb_get_target,mysqlc))) + $(eval $(call gb_Extension_add_file,mysql-connector-ooo,registry/data/org/openoffice/Office/DataAccess/Drivers.xcu,$(call gb_XcuFile_for_extension,mysqlc/source/registry/data/org/openoffice/Office/DataAccess/Drivers.xcu))) $(eval $(call gb_Extension_add_files,mysql-connector-ooo,images,\ diff --git a/mysqlc/Library_mysqlc.mk b/mysqlc/Library_mysqlc.mk index edcc36639350..246e4ec87b1c 100644 --- a/mysqlc/Library_mysqlc.mk +++ b/mysqlc/Library_mysqlc.mk @@ -61,4 +61,6 @@ $(eval $(call gb_Library_add_exception_objects,mysqlc,\ mysqlc/source/mysqlc_propertyids \ )) +$(eval $(call gb_Library_set_componentfile,mysqlc,mysqlc/source/mysqlc)) + # vim: set noet sw=4 ts=4: diff --git a/mysqlc/Module_mysqlc.mk b/mysqlc/Module_mysqlc.mk index f4fa114642b7..6a605beaea60 100644 --- a/mysqlc/Module_mysqlc.mk +++ b/mysqlc/Module_mysqlc.mk @@ -14,6 +14,7 @@ ifeq ($(ENABLE_MYSQLC),YES) $(eval $(call gb_Module_add_targets,mysqlc,\ Configuration_mysql \ Library_mysqlc \ + Rdb_mysqlc \ Extension_mysql-connector-ooo \ )) diff --git a/mysqlc/Rdb_mysqlc.mk b/mysqlc/Rdb_mysqlc.mk new file mode 100644 index 000000000000..bbcde68a3870 --- /dev/null +++ b/mysqlc/Rdb_mysqlc.mk @@ -0,0 +1,16 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_Rdb_Rdb,mysqlc)) + +$(eval $(call gb_Rdb_add_components,mysqlc,\ + mysqlc/source/mysqlc \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/mysqlc/source/META-INF/manifest.xml b/mysqlc/source/META-INF/manifest.xml index 2a54d8410b66..b3a94aca14c1 100644 --- a/mysqlc/source/META-INF/manifest.xml +++ b/mysqlc/source/META-INF/manifest.xml @@ -18,8 +18,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . --> - + diff --git a/mysqlc/source/mysqlc.component b/mysqlc/source/mysqlc.component new file mode 100644 index 000000000000..e4295110f84b --- /dev/null +++ b/mysqlc/source/mysqlc.component @@ -0,0 +1,15 @@ + + + + + + + diff --git a/mysqlc/source/mysqlc_services.cxx b/mysqlc/source/mysqlc_services.cxx index 47a5ffdbb801..8f3add7213de 100644 --- a/mysqlc/source/mysqlc_services.cxx +++ b/mysqlc/source/mysqlc_services.cxx @@ -40,33 +40,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc) rtl_ModuleCount* _pTemp ); -//*************************************************************************************** -// -// Die vorgeschriebene C-API muss erfuellt werden! -// Sie besteht aus drei Funktionen, die von dem Modul exportiert werden muessen. -// - -//--------------------------------------------------------------------------------------- -void REGISTER_PROVIDER( - const OUString& aServiceImplName, - const Sequence< OUString>& Services, - const Reference< XRegistryKey > & xKey) -{ - ::rtl::OUStringBuffer aMainKeyName; - aMainKeyName.append( sal_Unicode( '/' ) ); - aMainKeyName.append( aServiceImplName ); - aMainKeyName.appendAscii( "/UNO/SERVICES" ); - - Reference< XRegistryKey > xNewKey( xKey->createKey( aMainKeyName.makeStringAndClear() ) ); - OSL_ENSURE(xNewKey.is(), "SKELETON::component_writeInfo : could not create a registry key !"); - - for (sal_Int32 i = 0; i < Services.getLength(); ++i) { - xNewKey->createKey(Services[i]); - } -} - - -//--------------------------------------------------------------------------------------- struct ProviderRequest { Reference< XSingleServiceFactory > xRet; @@ -103,27 +76,6 @@ struct ProviderRequest /* }}} */ -/* {{{ component_writeInfo -I- */ -extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(void * /* pServiceManager */, void * pRegistryKey) -{ - if (pRegistryKey) { - try { - Reference< XRegistryKey > xKey(reinterpret_cast< XRegistryKey*>(pRegistryKey)); - - REGISTER_PROVIDER( - MysqlCDriver::getImplementationName_Static(), - MysqlCDriver::getSupportedServiceNames_Static(), xKey); - - return sal_True; - } catch (::com::sun::star::registry::InvalidRegistryException& ) { - OSL_FAIL("SKELETON::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !"); - } - } - return sal_False; -} -/* }}} */ - - /* {{{ component_getFactory -I- */ extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char * pImplementationName, -- cgit