From 236ddc87f83b754fd6a3e97b8f985a56c5d667a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BCdiger=20Timm?= Date: Wed, 30 Jan 2008 07:32:02 +0000 Subject: [PATCH] INTEGRATION: CWS dba24d (1.20.106); FILE MERGED 2007/11/22 13:10:39 fs 1.20.106.2: #i81658# moved the DBA services to use the helpers in unotools/componentresmodule resp. comphelper/componentmodule. Those helpers allow for old- and new-style singletons to co-exist, which wasn't the case for the old helpers previously found in dba_reghelper.hxx 2007/11/08 14:07:44 fs 1.20.106.1: during #i81658#: string cleanup --- .../core/dataaccess/commanddefinition.cxx | 40 +++++++------------ 1 file changed, 14 insertions(+), 26 deletions(-) diff --git a/dbaccess/source/core/dataaccess/commanddefinition.cxx b/dbaccess/source/core/dataaccess/commanddefinition.cxx index b56c32ca27f1..78c3c0c4fb9e 100644 --- a/dbaccess/source/core/dataaccess/commanddefinition.cxx +++ b/dbaccess/source/core/dataaccess/commanddefinition.cxx @@ -4,9 +4,9 @@ * * $RCSfile: commanddefinition.cxx,v $ * - * $Revision: 1.21 $ + * $Revision: 1.22 $ * - * last change: $Author: ihi $ $Date: 2007-11-21 15:37:10 $ + * last change: $Author: rt $ $Date: 2008-01-30 08:32:02 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -36,30 +36,17 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_dbaccess.hxx" -#ifndef _DBA_COREDATAACESS_COMMANDDEFINITION_HXX_ #include "commanddefinition.hxx" -#endif -#ifndef _DBASHARED_APITOOLS_HXX_ #include "apitools.hxx" -#endif -#ifndef DBACCESS_SHARED_DBASTRINGS_HRC #include "dbastrings.hrc" -#endif +#include "module_dba.hxx" -#ifndef _TOOLS_DEBUG_HXX -#include -#endif -#ifndef _COMPHELPER_SEQUENCE_HXX_ -#include -#endif - -#ifndef _COM_SUN_STAR_LANG_DISPOSEDEXCEPTION_HPP_ #include -#endif -#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_ #include -#endif +#include +#include +#include using namespace ::com::sun::star::uno; using namespace ::com::sun::star::sdbc; @@ -80,7 +67,7 @@ namespace dbaccess //========================================================================== extern "C" void SAL_CALL createRegistryInfo_OCommandDefinition() { - static OMultiInstanceAutoRegistration< OCommandDefinition > aAutoRegistration; + static ::dba::OAutoRegistration< OCommandDefinition > aAutoRegistration; } //-------------------------------------------------------------------------- @@ -139,7 +126,7 @@ IMPLEMENT_GETTYPES2(OCommandDefinition,OCommandDefinition_Base,OComponentDefinit IMPLEMENT_FORWARD_XINTERFACE2( OCommandDefinition,OComponentDefinition,OCommandDefinition_Base) IMPLEMENT_PROPERTYCONTAINER_DEFAULTS2(OCommandDefinition,OCommandDefinition_PROP) //-------------------------------------------------------------------------- -::rtl::OUString OCommandDefinition::getImplementationName_Static( ) throw(RuntimeException) +::rtl::OUString OCommandDefinition::getImplementationName_static( ) throw(RuntimeException) { return ::rtl::OUString::createFromAscii("com.sun.star.comp.dba.OCommandDefinition"); } @@ -147,11 +134,11 @@ IMPLEMENT_PROPERTYCONTAINER_DEFAULTS2(OCommandDefinition,OCommandDefinition_PROP //-------------------------------------------------------------------------- ::rtl::OUString SAL_CALL OCommandDefinition::getImplementationName( ) throw(RuntimeException) { - return getImplementationName_Static(); + return getImplementationName_static(); } //-------------------------------------------------------------------------- -Sequence< ::rtl::OUString > OCommandDefinition::getSupportedServiceNames_Static( ) throw(RuntimeException) +Sequence< ::rtl::OUString > OCommandDefinition::getSupportedServiceNames_static( ) throw(RuntimeException) { Sequence< ::rtl::OUString > aServices(3); aServices.getArray()[0] = SERVICE_SDB_QUERYDEFINITION; @@ -163,13 +150,14 @@ Sequence< ::rtl::OUString > OCommandDefinition::getSupportedServiceNames_Static( //-------------------------------------------------------------------------- Sequence< ::rtl::OUString > SAL_CALL OCommandDefinition::getSupportedServiceNames( ) throw(RuntimeException) { - return getSupportedServiceNames_Static(); + return getSupportedServiceNames_static(); } //------------------------------------------------------------------------------ -Reference< XInterface > OCommandDefinition::Create(const Reference< XMultiServiceFactory >& _rxFactory) +Reference< XInterface > OCommandDefinition::Create(const Reference< XComponentContext >& _rxContext) { - return *(new OCommandDefinition(_rxFactory,NULL,TContentPtr(new OCommandDefinition_Impl))); + ::comphelper::ComponentContext aContext( _rxContext ); + return *(new OCommandDefinition( aContext.getLegacyServiceFactory(), NULL, TContentPtr( new OCommandDefinition_Impl ) ) ); } // -----------------------------------------------------------------------------