Tag: cws_src680_dba24d User: fs Date: 2007-11-22 13:09:41+0000 Added: dba/dbaccess/source/core/misc/module_dba.cxx
Modified: dba/dbaccess/source/core/misc/makefile.mk dba/dbaccess/source/core/misc/propertybag.cxx dba/dbaccess/source/core/misc/propertybag.hxx dba/dbaccess/source/core/misc/services.cxx 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/misc/ ========================================== File [changed]: makefile.mk Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/misc/makefile.mk?r1=1.15&r2=1.15.88.1 Delta lines: +4 -3 ------------------- --- makefile.mk 2007-05-10 10:13:59+0000 1.15 +++ makefile.mk 2007-11-22 13:09:38+0000 1.15.88.1 @@ -4,9 +4,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.15 $ +# $Revision: 1.15.88.1 $ # -# last change: $Author: kz $ $Date: 2007/05/10 10:13:59 $ +# last change: $Author: fs $ $Date: 2007/11/22 13:09:38 $ # # The Contents of this file are made available subject to # the terms of GNU Lesser General Public License Version 2.1. @@ -56,6 +56,7 @@ $(SLO)$/ContainerListener.obj \ $(SLO)$/objectnameapproval.obj \ $(SLO)$/warnings.obj \ + $(SLO)$/module_dba.obj \ $(SLO)$/veto.obj # --- Targets ---------------------------------- File [added]: module_dba.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/misc/module_dba.cxx?rev=1.1.2.1&content-type=text/vnd.viewcvs-markup Added lines: 0 -------------- File [changed]: propertybag.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/misc/propertybag.cxx?r1=1.7&r2=1.7.54.1 Delta lines: +14 -22 --------------------- --- propertybag.cxx 2007-07-24 12:05:29+0000 1.7 +++ propertybag.cxx 2007-11-22 13:09:38+0000 1.7.54.1 @@ -4,9 +4,9 @@ * * $RCSfile: propertybag.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.7.54.1 $ * - * last change: $Author: rt $ $Date: 2007/07/24 12:05:29 $ + * last change: $Author: fs $ $Date: 2007/11/22 13:09:38 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -36,19 +36,11 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_dbaccess.hxx" -#ifndef DBACCESS_SOURCE_CORE_MISC_PROPERTYBAG_HXX #include "propertybag.hxx" -#endif +#include "module_dba.hxx" -#ifndef _DBA_REGHELPER_HXX_ -#include "dba_reghelper.hxx" -#endif -#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_ #include <com/sun/star/beans/PropertyAttribute.hpp> -#endif -#ifndef _COM_SUN_STAR_BEANS_NAMEDVALUE_HPP_ #include <com/sun/star/beans/NamedValue.hpp> -#endif #include <tools/diagnose_ex.h> @@ -63,7 +55,7 @@ //-------------------------------------------------------------------------- extern "C" void SAL_CALL createRegistryInfo_OPropertyBag() { - static ::dbaccess::OMultiInstanceAutoRegistration< ::dba::OPropertyBag > aAutoRegistration; + static ::dba::OAutoRegistration< ::dba::OPropertyBag > aAutoRegistration; } //........................................................................ @@ -79,9 +71,9 @@ //= OPropertyBag //==================================================================== //-------------------------------------------------------------------- - OPropertyBag::OPropertyBag( const Reference< XMultiServiceFactory >& _rxORB ) + OPropertyBag::OPropertyBag( const Reference< XComponentContext >& _rxContext ) :OPropertyBag_PBase( GetBroadcastHelper() ) - ,m_xORB( _rxORB ) + ,m_aContext( _rxContext ) ,m_bAutoAddProperties( false ) { } @@ -96,7 +88,7 @@ IMPLEMENT_FORWARD_XTYPEPROVIDER2( OPropertyBag, OPropertyBag_Base, OPropertyBag_PBase ) //-------------------------------------------------------------------- - Sequence< ::rtl::OUString > OPropertyBag::getSupportedServiceNames_Static() throw( RuntimeException ) + Sequence< ::rtl::OUString > OPropertyBag::getSupportedServiceNames_static() throw( RuntimeException ) { Sequence< ::rtl::OUString > aServices(1); aServices[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.beans.PropertyBag" ) ); @@ -120,27 +112,27 @@ } //-------------------------------------------------------------------- - ::rtl::OUString OPropertyBag::getImplementationName_Static() throw( RuntimeException ) + ::rtl::OUString OPropertyBag::getImplementationName_static() throw( RuntimeException ) { return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.comphelper.OPropertyBag" ) ); } //-------------------------------------------------------------------- - Reference< XInterface > SAL_CALL OPropertyBag::Create( const Reference< XMultiServiceFactory >& _rxORB ) + Reference< XInterface > SAL_CALL OPropertyBag::Create( const Reference< XComponentContext >& _rxContext ) { - return *new OPropertyBag( _rxORB ); + return *new OPropertyBag( _rxContext ); } //-------------------------------------------------------------------- ::rtl::OUString SAL_CALL OPropertyBag::getImplementationName() throw (RuntimeException) { - return getImplementationName_Static(); + return getImplementationName_static(); } //-------------------------------------------------------------------- ::sal_Bool SAL_CALL OPropertyBag::supportsService( const ::rtl::OUString& rServiceName ) throw (RuntimeException) { - Sequence< ::rtl::OUString > aServices( getSupportedServiceNames_Static() ); + Sequence< ::rtl::OUString > aServices( getSupportedServiceNames_static() ); const ::rtl::OUString* pStart = aServices.getConstArray(); const ::rtl::OUString* pEnd = aServices.getConstArray() + aServices.getLength(); return ::std::find( pStart, pEnd, rServiceName ) != pEnd; @@ -149,7 +141,7 @@ //-------------------------------------------------------------------- Sequence< ::rtl::OUString > SAL_CALL OPropertyBag::getSupportedServiceNames( ) throw (RuntimeException) { - return getSupportedServiceNames_Static(); + return getSupportedServiceNames_static(); } //-------------------------------------------------------------------- File [changed]: propertybag.hxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/misc/propertybag.hxx?r1=1.5&r2=1.5.54.1 Delta lines: +11 -21 --------------------- --- propertybag.hxx 2007-07-24 12:05:43+0000 1.5 +++ propertybag.hxx 2007-11-22 13:09:38+0000 1.5.54.1 @@ -4,9 +4,9 @@ * * $RCSfile: propertybag.hxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.5.54.1 $ * - * last change: $Author: rt $ $Date: 2007/07/24 12:05:43 $ + * last change: $Author: fs $ $Date: 2007/11/22 13:09:38 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -37,30 +37,20 @@ #define DBACCESS_SOURCE_CORE_MISC_PROPERTYBAG_HXX /** === begin UNO includes === **/ -#ifndef _COM_SUN_STAR_LANG_XINITIALIZATION_HPP_ #include <com/sun/star/lang/XInitialization.hpp> -#endif -#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_ #include <com/sun/star/lang/XMultiServiceFactory.hpp> -#endif -#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_ #include <com/sun/star/lang/XServiceInfo.hpp> -#endif -#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_ #include <com/sun/star/beans/XPropertySet.hpp> -#endif -#ifndef _COM_SUN_STAR_BEANS_XPROPERTYCONTAINER_HPP_ #include <com/sun/star/beans/XPropertyContainer.hpp> -#endif -#ifndef _COM_SUN_STAR_BEANS_XPROPERTYACCESS_HPP_ #include <com/sun/star/beans/XPropertyAccess.hpp> -#endif +#include <com/sun/star/uno/XComponentContext.hpp> /** === end UNO includes === **/ #include <cppuhelper/implbase4.hxx> #include <comphelper/propstate.hxx> #include <comphelper/broadcasthelper.hxx> #include <comphelper/propertybag.hxx> +#include <comphelper/componentcontext.hxx> #include <comphelper/uno3.hxx> #include <map> @@ -104,8 +94,8 @@ ,public OPropertyBag_Base { private: - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > - m_xORB; + ::comphelper::ComponentContext + m_aContext; /// our IPropertyArrayHelper implementation ::std::auto_ptr< ::cppu::OPropertyArrayHelper > @@ -118,13 +108,13 @@ bool m_bAutoAddProperties; public: - OPropertyBag( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB ); + OPropertyBag( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext ); // XServiceInfo - static versions - 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 >&); protected: virtual ~OPropertyBag(); File [changed]: services.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/misc/services.cxx?r1=1.14.28.1&r2=1.14.28.2 Delta lines: +13 -19 --------------------- --- services.cxx 2007-11-08 14:11:32+0000 1.14.28.1 +++ services.cxx 2007-11-22 13:09:38+0000 1.14.28.2 @@ -4,9 +4,9 @@ * * $RCSfile: services.cxx,v $ * - * $Revision: 1.14.28.1 $ + * $Revision: 1.14.28.2 $ * - * last change: $Author: fs $ $Date: 2007/11/08 14:11:32 $ + * last change: $Author: fs $ $Date: 2007/11/22 13:09:38 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -36,15 +36,9 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_dbaccess.hxx" -#ifndef _CPPUHELPER_FACTORY_HXX_ -#include <cppuhelper/factory.hxx> -#endif -#ifndef _OSL_DIAGNOSE_H_ +#include "module_dba.hxx" + #include <osl/diagnose.h> -#endif -#ifndef _DBA_REGHELPER_HXX_ -#include "dba_reghelper.hxx" -#endif /********************************************************************************************/ @@ -62,7 +56,7 @@ extern "C" void SAL_CALL createRegistryInfo_ODatabaseDocument(); extern "C" void SAL_CALL createRegistryInfo_ODatabaseSource(); extern "C" void SAL_CALL createRegistryInfo_OPropertyBag(); -extern "C" void SAL_CALL createRegistryInfo_DataAccessDescriptor(); +extern "C" void SAL_CALL createRegistryInfo_DataAccessDescriptorFactory(); //*************************************************************************************** // @@ -81,7 +75,7 @@ createRegistryInfo_ODatabaseDocument(); createRegistryInfo_ODatabaseSource(); createRegistryInfo_OPropertyBag(); - createRegistryInfo_DataAccessDescriptor(); + createRegistryInfo_DataAccessDescriptorFactory(); bInit = sal_True; } } @@ -106,13 +100,13 @@ if (pRegistryKey) try { - return ::dbaccess::OModuleRegistration::writeComponentInfos( - static_cast<XMultiServiceFactory*>(pServiceManager), - static_cast<XRegistryKey*>(pRegistryKey)); + return ::dba::DbaModule::getInstance().writeComponentInfos( + static_cast< XMultiServiceFactory* >( pServiceManager ), + static_cast< XRegistryKey* >( pRegistryKey ) ); } catch (InvalidRegistryException& ) { - OSL_ENSURE(sal_False, "DBA::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !"); + OSL_ENSURE( false, "DBA::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !" ); } return sal_False; @@ -127,9 +121,9 @@ Reference< XInterface > xRet; if (pServiceManager && pImplementationName) { - xRet = ::dbaccess::OModuleRegistration::getComponentFactory( - ::rtl::OUString::createFromAscii(pImplementationName), - static_cast< XMultiServiceFactory* >(pServiceManager)); + xRet = ::dba::DbaModule::getInstance().getComponentFactory( + ::rtl::OUString::createFromAscii( pImplementationName ), + static_cast< XMultiServiceFactory* >( pServiceManager ) ); } if (xRet.is()) --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
