Tag: cws_src680_dba24d User: fs Date: 2007-11-22 13:10:43+0000 Modified: dba/dbaccess/source/core/dataaccess/ComponentDefinition.cxx dba/dbaccess/source/core/dataaccess/ComponentDefinition.hxx dba/dbaccess/source/core/dataaccess/ModelImpl.hxx dba/dbaccess/source/core/dataaccess/commanddefinition.cxx dba/dbaccess/source/core/dataaccess/commanddefinition.hxx dba/dbaccess/source/core/dataaccess/databasecontext.cxx dba/dbaccess/source/core/dataaccess/databasecontext.hxx dba/dbaccess/source/core/dataaccess/databasedocument.cxx dba/dbaccess/source/core/dataaccess/databasedocument.hxx dba/dbaccess/source/core/dataaccess/datasource.cxx dba/dbaccess/source/core/dataaccess/datasource.hxx dba/dbaccess/source/core/dataaccess/documentdefinition.hxx
Log: #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 File Changes: Directory: /dba/dbaccess/source/core/dataaccess/ ================================================ File [changed]: ComponentDefinition.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/ComponentDefinition.cxx?r1=1.13&r2=1.13.28.1 Delta lines: +13 -10 --------------------- --- ComponentDefinition.cxx 2007-09-26 14:39:27+0000 1.13 +++ ComponentDefinition.cxx 2007-11-22 13:10:39+0000 1.13.28.1 @@ -4,9 +4,9 @@ * * $RCSfile: ComponentDefinition.cxx,v $ * - * $Revision: 1.13 $ + * $Revision: 1.13.28.1 $ * - * last change: $Author: hr $ $Date: 2007/09/26 14:39:27 $ + * last change: $Author: fs $ $Date: 2007/11/22 13:10:39 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -45,6 +45,7 @@ #ifndef DBACCESS_SHARED_DBASTRINGS_HRC #include "dbastrings.hrc" #endif +#include "module_dba.hxx" #ifndef _TOOLS_DEBUG_HXX #include <tools/debug.hxx> @@ -65,6 +66,7 @@ #include "definitioncolumn.hxx" #endif #include <cppuhelper/implbase1.hxx> +#include <comphelper/componentcontext.hxx> using namespace ::com::sun::star::uno; using namespace ::com::sun::star::sdbc; @@ -78,7 +80,7 @@ extern "C" void SAL_CALL createRegistryInfo_OComponentDefinition() { - static ::dbaccess::OMultiInstanceAutoRegistration< ::dbaccess::OComponentDefinition > aAutoRegistration; + static ::dba::OAutoRegistration< ::dbaccess::OComponentDefinition > aAutoRegistration; } //........................................................................ @@ -182,7 +184,7 @@ IMPLEMENT_GETTYPES3(OComponentDefinition,ODataSettings,OContentHelper,OComponentDefinition_BASE); IMPLEMENT_FORWARD_XINTERFACE3( OComponentDefinition,OContentHelper,ODataSettings,OComponentDefinition_BASE) //-------------------------------------------------------------------------- -::rtl::OUString OComponentDefinition::getImplementationName_Static( ) throw(RuntimeException) +::rtl::OUString OComponentDefinition::getImplementationName_static( ) throw(RuntimeException) { return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.dba.OComponentDefinition")); } @@ -190,11 +192,11 @@ //-------------------------------------------------------------------------- ::rtl::OUString SAL_CALL OComponentDefinition::getImplementationName( ) throw(RuntimeException) { - return getImplementationName_Static(); + return getImplementationName_static(); } //-------------------------------------------------------------------------- -Sequence< ::rtl::OUString > OComponentDefinition::getSupportedServiceNames_Static( ) throw(RuntimeException) +Sequence< ::rtl::OUString > OComponentDefinition::getSupportedServiceNames_static( ) throw(RuntimeException) { Sequence< ::rtl::OUString > aServices(2); aServices.getArray()[0] = SERVICE_SDB_TABLEDEFINITION; @@ -206,12 +208,13 @@ //-------------------------------------------------------------------------- Sequence< ::rtl::OUString > SAL_CALL OComponentDefinition::getSupportedServiceNames( ) throw(RuntimeException) { - return getSupportedServiceNames_Static(); + return getSupportedServiceNames_static(); } //------------------------------------------------------------------------------ -Reference< XInterface > OComponentDefinition::Create(const Reference< XMultiServiceFactory >& _rxFactory) +Reference< XInterface > OComponentDefinition::Create( const Reference< XComponentContext >& _rxContext ) { - return *(new OComponentDefinition(_rxFactory,NULL,TContentPtr(new OComponentDefinition_Impl))); + ::comphelper::ComponentContext aContext( _rxContext ); + return *(new OComponentDefinition( aContext.getLegacyServiceFactory(), NULL, TContentPtr( new OComponentDefinition_Impl ) ) ); } // ----------------------------------------------------------------------------- void SAL_CALL OComponentDefinition::disposing() File [changed]: ComponentDefinition.hxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/ComponentDefinition.hxx?r1=1.9&r2=1.9.28.1 Delta lines: +11 -9 -------------------- --- ComponentDefinition.hxx 2007-09-26 14:39:40+0000 1.9 +++ ComponentDefinition.hxx 2007-11-22 13:10:39+0000 1.9.28.1 @@ -4,9 +4,9 @@ * * $RCSfile: ComponentDefinition.hxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.9.28.1 $ * - * last change: $Author: hr $ $Date: 2007/09/26 14:39:40 $ + * last change: $Author: fs $ $Date: 2007/11/22 13:10:39 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -42,9 +42,6 @@ #ifndef _COMPHELPER_PROPERTYCONTAINER_HXX_ #include <comphelper/propertycontainer.hxx> #endif -#ifndef _DBA_REGHELPER_HXX_ -#include "dba_reghelper.hxx" -#endif #ifndef _COM_SUN_STAR_SDBCX_XRENAME_HPP_ #include <com/sun/star/sdbcx/XRename.hpp> #endif @@ -63,7 +60,12 @@ #ifndef _COM_SUN_STAR_SDBCX_XCOLUMNSSUPPLIER_HPP_ #include <com/sun/star/sdbcx/XColumnsSupplier.hpp> #endif +#ifndef _COM_SUN_STAR_BEANS_XPROPERTYCHANGELISTENER_HPP_ #include <com/sun/star/beans/XPropertyChangeListener.hpp> +#endif +#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_ +#include <com/sun/star/uno/XComponentContext.hpp> +#endif #ifndef DBA_CONTENTHELPER_HXX #include "ContentHelper.hxx" #endif @@ -169,10 +171,10 @@ virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException); - static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException ); - static ::rtl::OUString getImplementationName_Static(void) throw( ::com::sun::star::uno::RuntimeException ); + static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_static(void) throw( ::com::sun::star::uno::RuntimeException ); + static ::rtl::OUString getImplementationName_static(void) throw( ::com::sun::star::uno::RuntimeException ); static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL - Create(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&); + Create(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >&); // ::com::sun::star::beans::XPropertySet virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); File [changed]: ModelImpl.hxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/ModelImpl.hxx?r1=1.15&r2=1.15.54.1 Delta lines: +3 -6 ------------------- --- ModelImpl.hxx 2007-07-24 12:04:18+0000 1.15 +++ ModelImpl.hxx 2007-11-22 13:10:39+0000 1.15.54.1 @@ -4,9 +4,9 @@ * * $RCSfile: ModelImpl.hxx,v $ * - * $Revision: 1.15 $ + * $Revision: 1.15.54.1 $ * - * last change: $Author: rt $ $Date: 2007/07/24 12:04:18 $ + * last change: $Author: fs $ $Date: 2007/11/22 13:10:39 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -87,9 +87,6 @@ #ifndef _DBASHARED_APITOOLS_HXX_ #include "apitools.hxx" #endif -#ifndef _DBA_REGHELPER_HXX_ -#include "dba_reghelper.hxx" -#endif #ifndef _DBA_CORE_BOOKMARKCONTAINER_HXX_ #include "bookmarkcontainer.hxx" #endif File [changed]: commanddefinition.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/commanddefinition.cxx?r1=1.20.106.1&r2=1.20.106.2 Delta lines: +14 -26 --------------------- --- commanddefinition.cxx 2007-11-08 14:07:44+0000 1.20.106.1 +++ commanddefinition.cxx 2007-11-22 13:10:39+0000 1.20.106.2 @@ -4,9 +4,9 @@ * * $RCSfile: commanddefinition.cxx,v $ * - * $Revision: 1.20.106.1 $ + * $Revision: 1.20.106.2 $ * - * last change: $Author: fs $ $Date: 2007/11/08 14:07:44 $ + * last change: $Author: fs $ $Date: 2007/11/22 13:10:39 $ * * 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 <tools/debug.hxx> -#endif -#ifndef _COMPHELPER_SEQUENCE_HXX_ -#include <comphelper/sequence.hxx> -#endif - -#ifndef _COM_SUN_STAR_LANG_DISPOSEDEXCEPTION_HPP_ #include <com/sun/star/lang/DisposedException.hpp> -#endif -#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_ #include <com/sun/star/beans/PropertyAttribute.hpp> -#endif +#include <tools/debug.hxx> +#include <comphelper/sequence.hxx> +#include <comphelper/componentcontext.hxx> using namespace ::com::sun::star::uno; using namespace ::com::sun::star::sdbc; @@ -80,7 +67,7 @@ //========================================================================== extern "C" void SAL_CALL createRegistryInfo_OCommandDefinition() { - static OMultiInstanceAutoRegistration< OCommandDefinition > aAutoRegistration; + static ::dba::OAutoRegistration< OCommandDefinition > aAutoRegistration; } //-------------------------------------------------------------------------- @@ -139,7 +126,7 @@ 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 @@ //-------------------------------------------------------------------------- ::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 > 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 ) ) ); } // ----------------------------------------------------------------------------- File [changed]: commanddefinition.hxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/commanddefinition.hxx?r1=1.16&r2=1.16.212.1 Delta lines: +6 -9 ------------------- --- commanddefinition.hxx 2006-07-10 15:09:31+0000 1.16 +++ commanddefinition.hxx 2007-11-22 13:10:39+0000 1.16.212.1 @@ -4,9 +4,9 @@ * * $RCSfile: commanddefinition.hxx,v $ * - * $Revision: 1.16 $ + * $Revision: 1.16.212.1 $ * - * last change: $Author: obo $ $Date: 2006/07/10 15:09:31 $ + * last change: $Author: fs $ $Date: 2007/11/22 13:10:39 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -42,9 +42,6 @@ #ifndef _COMPHELPER_PROPERTYCONTAINER_HXX_ #include <comphelper/propertycontainer.hxx> #endif -#ifndef _DBA_REGHELPER_HXX_ -#include "dba_reghelper.hxx" -#endif #ifndef _DBASHARED_APITOOLS_HXX_ #include "apitools.hxx" #endif @@ -130,10 +127,10 @@ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException); // ::com::sun::star::lang::XServiceInfo - static methods - static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException ); - static ::rtl::OUString getImplementationName_Static(void) throw( ::com::sun::star::uno::RuntimeException ); + static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_static(void) throw( ::com::sun::star::uno::RuntimeException ); + static ::rtl::OUString getImplementationName_static(void) throw( ::com::sun::star::uno::RuntimeException ); static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL - Create(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&); + Create(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >&); // XRename virtual void SAL_CALL rename( const ::rtl::OUString& newName ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::container::ElementExistException, ::com::sun::star::uno::RuntimeException); File [changed]: databasecontext.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/databasecontext.cxx?r1=1.36&r2=1.36.74.1 Delta lines: +21 -39 --------------------- --- databasecontext.cxx 2007-06-05 14:39:22+0000 1.36 +++ databasecontext.cxx 2007-11-22 13:10:40+0000 1.36.74.1 @@ -4,9 +4,9 @@ * * $RCSfile: databasecontext.cxx,v $ * - * $Revision: 1.36 $ + * $Revision: 1.36.74.1 $ * - * last change: $Author: ihi $ $Date: 2007/06/05 14:39:22 $ + * last change: $Author: fs $ $Date: 2007/11/22 13:10:40 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -36,24 +36,13 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_dbaccess.hxx" -#ifndef _DBA_COREDATAACCESS_DATABASECONTEXT_HXX_ #include "databasecontext.hxx" -#endif -#ifndef _DBA_COREDATAACCESS_DATASOURCE_HXX_ #include "datasource.hxx" -#endif -#ifndef _DBA_CORE_RESOURCE_HRC_ #include "core_resource.hrc" -#endif -#ifndef _DBA_CORE_RESOURCE_HXX_ #include "core_resource.hxx" -#endif -#ifndef DBACCESS_SHARED_DBASTRINGS_HRC #include "dbastrings.hrc" -#endif -#ifndef _DBASHARED_APITOOLS_HXX_ #include "apitools.hxx" -#endif +#include "module_dba.hxx" #ifndef _COM_SUN_STAR_REGISTRY_INVALIDREGISTRYEXCEPTION_HPP_ #include <com/sun/star/registry/InvalidRegistryException.hpp> @@ -159,7 +148,7 @@ extern "C" void SAL_CALL createRegistryInfo_ODatabaseContext() { - static ::dbaccess::OOneInstanceAutoRegistration< ::dbaccess::ODatabaseContext > aODatabaseContext_AutoRegistration; + static ::dba::OLegacySingletonRegistration< ::dbaccess::ODatabaseContext > aODatabaseContext_AutoRegistration; } //........................................................................ @@ -194,16 +183,9 @@ //= ODatabaseContext //========================================================================== //-------------------------------------------------------------------------- -Reference< XInterface > -ODatabaseContext_CreateInstance(const Reference< XMultiServiceFactory > & xServiceManager) -{ - return (*new ODatabaseContext(xServiceManager)); -} - -//-------------------------------------------------------------------------- -ODatabaseContext::ODatabaseContext(const Reference< XMultiServiceFactory > & xServiceManager) +ODatabaseContext::ODatabaseContext( const Reference< XComponentContext >& _rxContext ) :DatabaseAccessContext_Base(m_aMutex) - ,m_xServiceManager(xServiceManager) + ,m_aContext( _rxContext ) ,m_aContainerListeners(m_aMutex) { } @@ -215,20 +197,20 @@ // Helper //------------------------------------------------------------------------------ -rtl::OUString ODatabaseContext::getImplementationName_Static() throw( RuntimeException ) +rtl::OUString ODatabaseContext::getImplementationName_static() throw( RuntimeException ) { return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.dba.ODatabaseContext")); } //------------------------------------------------------------------------------ -Reference< XInterface > ODatabaseContext::Create(const Reference< XMultiServiceFactory >& _rxFactory) +Reference< XInterface > ODatabaseContext::Create(const Reference< XComponentContext >& _rxContext) { - return ODatabaseContext_CreateInstance(_rxFactory); + return *( new ODatabaseContext( _rxContext ) ); } //------------------------------------------------------------------------------ -Sequence< rtl::OUString > ODatabaseContext::getSupportedServiceNames_Static(void) throw( RuntimeException ) +Sequence< rtl::OUString > ODatabaseContext::getSupportedServiceNames_static(void) throw( RuntimeException ) { Sequence< ::rtl::OUString > aSNS( 1 ); aSNS[0] = SERVICE_SDB_DATABASECONTEXT; @@ -239,7 +221,7 @@ //------------------------------------------------------------------------------ rtl::OUString ODatabaseContext::getImplementationName( ) throw(RuntimeException) { - return getImplementationName_Static(); + return getImplementationName_static(); } //------------------------------------------------------------------------------ @@ -251,13 +233,13 @@ //------------------------------------------------------------------------------ Sequence< ::rtl::OUString > ODatabaseContext::getSupportedServiceNames( ) throw (RuntimeException) { - return getSupportedServiceNames_Static(); + return getSupportedServiceNames_static(); } //-------------------------------------------------------------------------- Reference< XInterface > SAL_CALL ODatabaseContext::createInstance( ) throw (Exception, RuntimeException) { - ::rtl::Reference<ODatabaseModelImpl> pImpl(new ODatabaseModelImpl(m_xServiceManager)); + ::rtl::Reference<ODatabaseModelImpl> pImpl( new ODatabaseModelImpl( m_aContext.getLegacyServiceFactory() ) ); pImpl->m_pDBContext = this; Reference< XDataSource > xDataSource( pImpl->getDataSource() ); return xDataSource.get(); @@ -313,7 +295,7 @@ // the config node where all pooling relevant info are stored under OConfigurationTreeRoot aDbRegisteredNamesRoot = OConfigurationTreeRoot::createWithServiceFactory( - m_xServiceManager, getDbRegisteredNamesNodeName(), -1, OConfigurationTreeRoot::CM_READONLY); + m_aContext.getLegacyServiceFactory(), getDbRegisteredNamesNodeName(), -1, OConfigurationTreeRoot::CM_READONLY); if ( aDbRegisteredNamesRoot.isValid() && aDbRegisteredNamesRoot.hasByName( _rRegisteredName ) ) { OConfigurationNode aRegisterObj = aDbRegisteredNamesRoot.openNode( _rRegisteredName ); @@ -395,7 +377,7 @@ } if ( !xExistent.is() ) { - ::rtl::Reference<ODatabaseModelImpl> pImpl(new ODatabaseModelImpl(_rName,m_xServiceManager,this)); + ::rtl::Reference<ODatabaseModelImpl> pImpl( new ODatabaseModelImpl( _rName, m_aContext.getLegacyServiceFactory(), this ) ); xExistent = pImpl->getDataSource().get(); Sequence< PropertyValue > aArgs(1); @@ -551,7 +533,7 @@ Reference< XInterface > xExistent; OConfigurationTreeRoot aDbRegisteredNamesRoot = OConfigurationTreeRoot::createWithServiceFactory( - m_xServiceManager, getDbRegisteredNamesNodeName(), -1, OConfigurationTreeRoot::CM_UPDATABLE); + m_aContext.getLegacyServiceFactory(), getDbRegisteredNamesNodeName(), -1, OConfigurationTreeRoot::CM_UPDATABLE); if ( aDbRegisteredNamesRoot.isValid() && aDbRegisteredNamesRoot.hasByName(_rName) ) { OConfigurationNode aThisDriverSettings = aDbRegisteredNamesRoot.openNode(_rName); @@ -662,7 +644,7 @@ TNameMap aRet; OConfigurationTreeRoot aDbRegisteredNamesRoot = OConfigurationTreeRoot::createWithServiceFactory( - m_xServiceManager, getDbRegisteredNamesNodeName(), -1, OConfigurationTreeRoot::CM_READONLY); + m_aContext.getLegacyServiceFactory(), getDbRegisteredNamesNodeName(), -1, OConfigurationTreeRoot::CM_READONLY); Sequence< ::rtl::OUString> aSeq; if ( aDbRegisteredNamesRoot.isValid() ) @@ -680,7 +662,7 @@ ::connectivity::checkDisposed(DatabaseAccessContext_Base::rBHelper.bDisposed); OConfigurationTreeRoot aDbRegisteredNamesRoot = OConfigurationTreeRoot::createWithServiceFactory( - m_xServiceManager, getDbRegisteredNamesNodeName(), -1, OConfigurationTreeRoot::CM_READONLY); + m_aContext.getLegacyServiceFactory(), getDbRegisteredNamesNodeName(), -1, OConfigurationTreeRoot::CM_READONLY); return aDbRegisteredNamesRoot.isValid() && aDbRegisteredNamesRoot.hasByName(_rName); } File [changed]: databasecontext.hxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/databasecontext.hxx?r1=1.14&r2=1.14.208.1 Delta lines: +12 -12 --------------------- --- databasecontext.hxx 2006-07-13 15:21:18+0000 1.14 +++ databasecontext.hxx 2007-11-22 13:10:40+0000 1.14.208.1 @@ -4,9 +4,9 @@ * * $RCSfile: databasecontext.hxx,v $ * - * $Revision: 1.14 $ + * $Revision: 1.14.208.1 $ * - * last change: $Author: obo $ $Date: 2006/07/13 15:21:18 $ + * last change: $Author: fs $ $Date: 2007/11/22 13:10:40 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -66,6 +66,9 @@ #ifndef _COMPHELPER_STLTYPES_HXX_ #include <comphelper/stl_types.hxx> #endif +#ifndef COMPHELPER_COMPONENTCONTEXT_HXX +#include <comphelper/componentcontext.hxx> +#endif #ifndef _CPPUHELPER_INTERFACECONTAINER_HXX_ #include <cppuhelper/interfacecontainer.hxx> #endif @@ -75,9 +78,6 @@ #ifndef _COM_SUN_STAR_LANG_XEVENTLISTENER_HPP_ #include <com/sun/star/lang/XEventListener.hpp> #endif -#ifndef _DBA_REGHELPER_HXX_ -#include "dba_reghelper.hxx" -#endif #ifndef _COM_SUN_STAR_LANG_XSINGLESERVICEFACTORY_HPP_ #include <com/sun/star/lang/XSingleServiceFactory.hpp> #endif @@ -140,7 +140,7 @@ protected: ::osl::Mutex m_aMutex; - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager; + ::comphelper::ComponentContext m_aContext; DECLARE_STL_USTRINGACCESS_MAP( ODatabaseModelImpl*, ObjectCache ); ObjectCache m_aDatabaseObjects; @@ -156,7 +156,7 @@ ::cppu::OInterfaceContainerHelper m_aContainerListeners; public: - ODatabaseContext(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&); + ODatabaseContext( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& ); virtual ~ODatabaseContext(); @@ -173,10 +173,10 @@ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException); // ::com::sun::star::lang::XServiceInfo - static methods - static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException ); - static ::rtl::OUString getImplementationName_Static(void) throw( ::com::sun::star::uno::RuntimeException ); + static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_static(void) throw( ::com::sun::star::uno::RuntimeException ); + static ::rtl::OUString getImplementationName_static(void) throw( ::com::sun::star::uno::RuntimeException ); static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > - SAL_CALL Create(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&); + SAL_CALL Create(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >&); // ::com::sun::star::container::XElementAccess virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); File [changed]: databasedocument.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/databasedocument.cxx?r1=1.35&r2=1.35.2.1 Delta lines: +20 -35 --------------------- --- databasedocument.cxx 2007-11-09 08:11:44+0000 1.35 +++ databasedocument.cxx 2007-11-22 13:10:40+0000 1.35.2.1 @@ -4,9 +4,9 @@ * * $RCSfile: databasedocument.cxx,v $ * - * $Revision: 1.35 $ + * $Revision: 1.35.2.1 $ * - * last change: $Author: rt $ $Date: 2007/11/09 08:11:44 $ + * last change: $Author: fs $ $Date: 2007/11/22 13:10:40 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -35,15 +35,12 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_dbaccess.hxx" -#ifndef _DBA_COREDATAACCESS_DATASOURCE_HXX_ + #include "datasource.hxx" -#endif -#ifndef _DBA_COREDATAACCESS_DATABASEDOCUMENT_HXX_ #include "databasedocument.hxx" -#endif -#ifndef DBACCESS_SHARED_DBASTRINGS_HRC #include "dbastrings.hrc" -#endif +#include "module_dba.hxx" + #include <comphelper/documentconstants.hxx> #include <comphelper/enumhelper.hxx> #ifndef _COM_SUN_STAR_EMBED_XTRANSACTEDOBJECT_HPP_ @@ -150,29 +147,10 @@ //-------------------------------------------------------------------------- extern "C" void SAL_CALL createRegistryInfo_ODatabaseDocument() { - static OMultiInstanceAutoRegistration< ODatabaseDocument > aAutoRegistration; + static ::dba::OAutoRegistration< ODatabaseDocument > aAutoRegistration; } //-------------------------------------------------------------------------- -Reference< XInterface > ODatabaseDocument_CreateInstance(const Reference< XMultiServiceFactory >& _rxFactory) -{ - ODatabaseContext* pContext = NULL; - try - { - Reference<XUnoTunnel> xUnoTunnel(_rxFactory->createInstance(SERVICE_SDB_DATABASECONTEXT),UNO_QUERY); - if ( xUnoTunnel.is() ) - pContext = reinterpret_cast<ODatabaseContext*>(xUnoTunnel->getSomething(ODatabaseContext::getUnoTunnelImplementationId())); - } - catch(Exception) - { - } - - ::rtl::Reference<ODatabaseModelImpl> pImpl(new ODatabaseModelImpl(_rxFactory)); - pImpl->m_pDBContext = pContext; - Reference< XModel > xModel( pImpl->createNewModel_deliverOwnership() ); - return xModel.get(); -} -//-------------------------------------------------------------------------- ODatabaseDocument::ODatabaseDocument(const ::rtl::Reference<ODatabaseModelImpl>& _pImpl ) :ModelDependentComponent( _pImpl ) ,ODatabaseDocument_OfficeDocument( getMutex() ) @@ -1164,11 +1142,11 @@ //------------------------------------------------------------------------------ rtl::OUString ODatabaseDocument::getImplementationName( ) throw(RuntimeException) { - return getImplementationName_Static(); + return getImplementationName_static(); } //------------------------------------------------------------------------------ -rtl::OUString ODatabaseDocument::getImplementationName_Static( ) throw(RuntimeException) +rtl::OUString ODatabaseDocument::getImplementationName_static( ) throw(RuntimeException) { return rtl::OUString::createFromAscii("com.sun.star.comp.dba.ODatabaseDocument"); } @@ -1176,17 +1154,24 @@ //------------------------------------------------------------------------------ Sequence< ::rtl::OUString > ODatabaseDocument::getSupportedServiceNames( ) throw (RuntimeException) { - return getSupportedServiceNames_Static(); + return getSupportedServiceNames_static(); } //------------------------------------------------------------------------------ -Reference< XInterface > ODatabaseDocument::Create(const Reference< XMultiServiceFactory >& _rxFactory) +Reference< XInterface > ODatabaseDocument::Create( const Reference< XComponentContext >& _rxContext ) { - return ODatabaseDocument_CreateInstance(_rxFactory); + ::comphelper::ComponentContext aContext( _rxContext ); + Reference< XUnoTunnel > xDBContextTunnel( aContext.createComponent( (::rtl::OUString)SERVICE_SDB_DATABASECONTEXT ), UNO_QUERY_THROW ); + ODatabaseContext* pContext = reinterpret_cast< ODatabaseContext* >( xDBContextTunnel->getSomething( ODatabaseContext::getUnoTunnelImplementationId() ) ); + + ::rtl::Reference<ODatabaseModelImpl> pImpl( new ODatabaseModelImpl( aContext.getLegacyServiceFactory() ) ); + pImpl->m_pDBContext = pContext; + Reference< XModel > xModel( pImpl->createNewModel_deliverOwnership() ); + return xModel.get(); } //------------------------------------------------------------------------------ -Sequence< ::rtl::OUString > ODatabaseDocument::getSupportedServiceNames_Static( ) throw (RuntimeException) +Sequence< ::rtl::OUString > ODatabaseDocument::getSupportedServiceNames_static( ) throw (RuntimeException) { Sequence< ::rtl::OUString > aSNS( 2 ); aSNS[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.OfficeDatabaseDocument")); File [changed]: databasedocument.hxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/databasedocument.hxx?r1=1.14&r2=1.14.28.1 Delta lines: +6 -9 ------------------- --- databasedocument.hxx 2007-09-26 14:40:04+0000 1.14 +++ databasedocument.hxx 2007-11-22 13:10:40+0000 1.14.28.1 @@ -4,9 +4,9 @@ * * $RCSfile: databasedocument.hxx,v $ * - * $Revision: 1.14 $ + * $Revision: 1.14.28.1 $ * - * last change: $Author: hr $ $Date: 2007/09/26 14:40:04 $ + * last change: $Author: fs $ $Date: 2007/11/22 13:10:40 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -98,9 +98,6 @@ //============================================================ //= ODatabaseDocument //============================================================ -::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > - ODatabaseDocument_CreateInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&); - typedef ::cppu::WeakComponentImplHelper10< ::com::sun::star::frame::XModel2 , ::com::sun::star::util::XModifiable , ::com::sun::star::frame::XStorable @@ -237,10 +234,10 @@ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException); // ::com::sun::star::lang::XServiceInfo - static methods - static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException ); - static ::rtl::OUString getImplementationName_Static(void) throw( ::com::sun::star::uno::RuntimeException ); + static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_static(void) throw( ::com::sun::star::uno::RuntimeException ); + static ::rtl::OUString getImplementationName_static(void) throw( ::com::sun::star::uno::RuntimeException ); static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > - SAL_CALL Create(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&); + SAL_CALL Create(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >&); // XEventListener virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException); File [changed]: datasource.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/datasource.cxx?r1=1.73&r2=1.73.54.1 Delta lines: +19 -38 --------------------- --- datasource.cxx 2007-07-24 12:05:01+0000 1.73 +++ datasource.cxx 2007-11-22 13:10:40+0000 1.73.54.1 @@ -4,9 +4,9 @@ * * $RCSfile: datasource.cxx,v $ * - * $Revision: 1.73 $ + * $Revision: 1.73.54.1 $ * - * last change: $Author: rt $ $Date: 2007/07/24 12:05:01 $ + * last change: $Author: fs $ $Date: 2007/11/22 13:10:40 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -36,16 +36,17 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_dbaccess.hxx" -#ifndef _DBA_COREDATAACCESS_DATASOURCE_HXX_ #include "datasource.hxx" -#endif -#ifndef _DBA_CORE_USERINFORMATION_HXX_ +#include "module_dba.hxx" #include "userinformation.hxx" -#endif -#ifndef _DBA_COREDATAACCESS_COMMANDCONTAINER_HXX_ #include "commandcontainer.hxx" -#endif +#include "dbastrings.hrc" +#include "core_resource.hxx" +#include "core_resource.hrc" +#include "connection.hxx" +#include "SharedConnection.hxx" #include "databasedocument.hxx" + #ifndef _TOOLS_DEBUG_HXX #include <tools/debug.hxx> #endif @@ -58,15 +59,6 @@ #ifndef _COMPHELPER_SEQSTREAM_HXX #include <comphelper/seqstream.hxx> #endif -#ifndef DBACCESS_SHARED_DBASTRINGS_HRC -#include "dbastrings.hrc" -#endif -#ifndef _DBA_CORE_RESOURCE_HXX_ -#include "core_resource.hxx" -#endif -#ifndef _DBA_CORE_RESOURCE_HRC_ -#include "core_resource.hrc" -#endif #ifndef _COMPHELPER_SEQUENCE_HXX_ #include <comphelper/sequence.hxx> #endif @@ -118,18 +110,12 @@ #ifndef _COMPHELPER_INTERACTION_HXX_ #include <comphelper/interaction.hxx> #endif -#ifndef _DBA_CORE_CONNECTION_HXX_ -#include "connection.hxx" -#endif #ifndef _COMPHELPER_GUARDING_HXX_ #include <comphelper/guarding.hxx> #endif #ifndef UNOTOOLS_INC_SHAREDUNOCOMPONENT_HXX #include <unotools/sharedunocomponent.hxx> #endif -#ifndef DBA_CORE_SHARED_CONNECTION_HXX -#include "SharedConnection.hxx" -#endif #ifndef _RTL_DIGEST_H_ #include <rtl/digest.h> #endif @@ -623,13 +609,7 @@ //-------------------------------------------------------------------------- extern "C" void SAL_CALL createRegistryInfo_ODatabaseSource() { - static OMultiInstanceAutoRegistration< ODatabaseSource > aAutoRegistration; -} -//-------------------------------------------------------------------------- -Reference< XInterface > ODatabaseSource_CreateInstance(const Reference< XMultiServiceFactory >& _rxFactory) -{ - Reference< XSingleServiceFactory > xDb(_rxFactory->createInstance(SERVICE_SDB_DATABASECONTEXT),UNO_QUERY); - return xDb->createInstance( ); + static ::dba::OAutoRegistration< ODatabaseSource > aAutoRegistration; } //-------------------------------------------------------------------------- @@ -734,11 +714,11 @@ //------------------------------------------------------------------------------ rtl::OUString ODatabaseSource::getImplementationName( ) throw(RuntimeException) { - return getImplementationName_Static(); + return getImplementationName_static(); } //------------------------------------------------------------------------------ -rtl::OUString ODatabaseSource::getImplementationName_Static( ) throw(RuntimeException) +rtl::OUString ODatabaseSource::getImplementationName_static( ) throw(RuntimeException) { return rtl::OUString::createFromAscii("com.sun.star.comp.dba.ODatabaseSource"); } @@ -746,17 +726,18 @@ //------------------------------------------------------------------------------ Sequence< ::rtl::OUString > ODatabaseSource::getSupportedServiceNames( ) throw (RuntimeException) { - return getSupportedServiceNames_Static(); + return getSupportedServiceNames_static(); } //------------------------------------------------------------------------------ -Reference< XInterface > ODatabaseSource::Create(const Reference< XMultiServiceFactory >& _rxFactory) +Reference< XInterface > ODatabaseSource::Create( const Reference< XComponentContext >& _rxContext ) { - return ODatabaseSource_CreateInstance(_rxFactory); + ::comphelper::ComponentContext aContext( _rxContext ); + Reference< XSingleServiceFactory > xDBContext( aContext.createComponent( (::rtl::OUString)SERVICE_SDB_DATABASECONTEXT ), UNO_QUERY_THROW ); + return xDBContext->createInstance(); } - //------------------------------------------------------------------------------ -Sequence< ::rtl::OUString > ODatabaseSource::getSupportedServiceNames_Static( ) throw (RuntimeException) +Sequence< ::rtl::OUString > ODatabaseSource::getSupportedServiceNames_static( ) throw (RuntimeException) { Sequence< ::rtl::OUString > aSNS( 2 ); aSNS[0] = SERVICE_SDB_DATASOURCE; File [changed]: datasource.hxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/datasource.hxx?r1=1.37&r2=1.37.180.1 Delta lines: +7 -18 -------------------- --- datasource.hxx 2006-08-15 10:45:03+0000 1.37 +++ datasource.hxx 2007-11-22 13:10:40+0000 1.37.180.1 @@ -4,9 +4,9 @@ * * $RCSfile: datasource.hxx,v $ * - * $Revision: 1.37 $ + * $Revision: 1.37.180.1 $ * - * last change: $Author: hr $ $Date: 2006/08/15 10:45:03 $ + * last change: $Author: fs $ $Date: 2007/11/22 13:10:40 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -45,9 +45,6 @@ #ifndef _COM_SUN_STAR_SDBC_XDATASOURCE_HPP_ #include <com/sun/star/sdbc/XDataSource.hpp> #endif -#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_ -#include <com/sun/star/lang/XMultiServiceFactory.hpp> -#endif #ifndef _COM_SUN_STAR_CONTAINER_XCONTAINERLISTENER_HPP_ #include <com/sun/star/container/XContainerListener.hpp> #endif @@ -93,9 +90,6 @@ #ifndef _DBASHARED_APITOOLS_HXX_ #include "apitools.hxx" #endif -#ifndef _DBA_REGHELPER_HXX_ -#include "dba_reghelper.hxx" -#endif #ifndef _DBA_CORE_BOOKMARKCONTAINER_HXX_ #include "bookmarkcontainer.hxx" #endif @@ -156,9 +150,6 @@ //============================================================ //= ODatabaseSource //============================================================ -::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > - ODatabaseSource_CreateInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&); - typedef ::cppu::ImplHelper11 < ::com::sun::star::lang::XServiceInfo , ::com::sun::star::sdbc::XDataSource , ::com::sun::star::sdb::XBookmarksSupplier @@ -182,8 +173,6 @@ friend class ODatabaseContext; friend class OConnection; friend class OSharedConnectionManager; - friend ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > - ODatabaseSource_CreateInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&); private: @@ -196,7 +185,7 @@ virtual ~ODatabaseSource(); public: - ODatabaseSource(const ::rtl::Reference<ODatabaseModelImpl>& _pImpl); + ODatabaseSource( const ::rtl::Reference< ODatabaseModelImpl >& _pImpl ); // XContainerListener virtual void SAL_CALL elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException); @@ -220,10 +209,10 @@ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException); // ::com::sun::star::lang::XServiceInfo - static methods - static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException ); - static ::rtl::OUString getImplementationName_Static(void) throw( ::com::sun::star::uno::RuntimeException ); + static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_static(void) throw( ::com::sun::star::uno::RuntimeException ); + static ::rtl::OUString getImplementationName_static(void) throw( ::com::sun::star::uno::RuntimeException ); static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > - SAL_CALL Create(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&); + SAL_CALL Create(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >&); // OComponentHelper virtual void SAL_CALL disposing(void); File [changed]: documentdefinition.hxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/documentdefinition.hxx?r1=1.23&r2=1.23.28.1 Delta lines: +3 -6 ------------------- --- documentdefinition.hxx 2007-09-26 14:40:32+0000 1.23 +++ documentdefinition.hxx 2007-11-22 13:10:40+0000 1.23.28.1 @@ -4,9 +4,9 @@ * * $RCSfile: documentdefinition.hxx,v $ * - * $Revision: 1.23 $ + * $Revision: 1.23.28.1 $ * - * last change: $Author: hr $ $Date: 2007/09/26 14:40:32 $ + * last change: $Author: fs $ $Date: 2007/11/22 13:10:40 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -42,9 +42,6 @@ #ifndef _CPPUHELPER_IMPLBASE1_HXX_ #include <cppuhelper/implbase1.hxx> #endif -#ifndef _DBA_REGHELPER_HXX_ -#include "dba_reghelper.hxx" -#endif #ifndef DBA_CONTENTHELPER_HXX #include "ContentHelper.hxx" #endif --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
