diff options
author | Vladimir Glazunov <vg@openoffice.org> | 2010-09-29 10:24:13 +0200 |
---|---|---|
committer | Vladimir Glazunov <vg@openoffice.org> | 2010-09-29 10:24:13 +0200 |
commit | 553c8d5ac9a35f9dabb0aeaf64f1cdf27f04497b (patch) | |
tree | acf328e5e86b5cbd8170d3521253c47731677f6d /comphelper | |
parent | 03aa7ab71b66b63704a3dd1a98e024fd97c5ff6b (diff) | |
parent | dd04f0f604c194773da70d212aa0c67b994ebb87 (diff) |
CWS-TOOLING: integrate CWS sb129
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/inc/comphelper/componentmodule.hxx | 29 | ||||
-rw-r--r-- | comphelper/inc/comphelper/servicedecl.hxx | 27 | ||||
-rw-r--r-- | comphelper/prj/d.lst | 1 | ||||
-rw-r--r-- | comphelper/source/misc/componentmodule.cxx | 58 | ||||
-rw-r--r-- | comphelper/source/misc/servicedecl.cxx | 31 | ||||
-rw-r--r-- | comphelper/util/comphelp4.component | 70 | ||||
-rw-r--r-- | comphelper/util/exports.dxp | 1 | ||||
-rw-r--r-- | comphelper/util/makefile.mk | 8 |
8 files changed, 79 insertions, 146 deletions
diff --git a/comphelper/inc/comphelper/componentmodule.hxx b/comphelper/inc/comphelper/componentmodule.hxx index 660a685d0fd3..61ddddebadbf 100644 --- a/comphelper/inc/comphelper/componentmodule.hxx +++ b/comphelper/inc/comphelper/componentmodule.hxx @@ -34,7 +34,6 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/lang/XSingleServiceFactory.hpp> #include <com/sun/star/uno/Sequence.hxx> -#include <com/sun/star/registry/XRegistryKey.hpp> /** === end UNO includes === **/ #include <cppuhelper/factory.hxx> @@ -140,28 +139,6 @@ namespace comphelper */ void registerImplementation( const ComponentDescription& _rComp ); - /** write the registration information of all known components - - Writes the registration information of all components which are currently registered into the - specified registry. - - Usually used from within component_writeInfo. - - @param_rxServiceManager - the service manager - @param _rRootKey - the registry key under which the information will be stored - @return - <TRUE/> if the registration of all implementations was successfull, <FALSE/> otherwise - */ - sal_Bool writeComponentInfos( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxServiceManager, - const ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey >& _rRootKey); - - /** version of writeComponentInfos which directly takes the arguments you got in your component_writeInfo call - */ - sal_Bool writeComponentInfos( void* pServiceManager, void* pRegistryKey ); - /** creates a Factory for the component with the given implementation name. <p>Usually used from within component_getFactory.<p/> @param _rxServiceManager @@ -420,12 +397,6 @@ namespace comphelper { \ *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; \ } \ - extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( \ - void* pServiceManager, void* pRegistryKey ) \ - { \ - initializer_function(); \ - return module_class::getInstance().writeComponentInfos( pServiceManager, pRegistryKey ); \ - } \ extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( \ const sal_Char* pImplementationName, void* pServiceManager, void* pRegistryKey ) \ { \ diff --git a/comphelper/inc/comphelper/servicedecl.hxx b/comphelper/inc/comphelper/servicedecl.hxx index 5d11d41831f5..adf120b3bae2 100644 --- a/comphelper/inc/comphelper/servicedecl.hxx +++ b/comphelper/inc/comphelper/servicedecl.hxx @@ -134,8 +134,6 @@ public: m_pServiceNames(pSupportedServiceNames), m_cDelim(cDelim) {} - /// @internal gets called by component_writeInfoHelper() - bool writeInfo( ::com::sun::star::registry::XRegistryKey * xKey ) const; /// @internal gets called by component_getFactoryHelper() void * getFactory( sal_Char const* pImplName ) const; @@ -323,9 +321,6 @@ struct class_ : public serviceimpl_base< detail::ServiceImpl<ImplT_>, WithArgsT // component_... helpers with arbitrary service declarations: // -#define COMPHELPER_SERVICEDECL_writeInfo(z_, n_, unused_) \ - bRet &= BOOST_PP_CAT(s, n_).writeInfo( xRegistryKey ); - #define COMPHELPER_SERVICEDECL_getFactory(z_, n_, unused_) \ if (pRet == 0) \ pRet = BOOST_PP_CAT(s, n_).getFactory(pImplName); @@ -333,11 +328,6 @@ struct class_ : public serviceimpl_base< detail::ServiceImpl<ImplT_>, WithArgsT /** The following preprocessor repetitions generate functions like <pre> - inline sal_Bool component_writeInfoHelper( - ::com::sun::star::lang::XMultiServiceFactory *, - ::com::sun::star::registry::XRegistryKey * xRegistryKey, - ServiceDecl const& s0, ServiceDecl const& s1, ... ); - inline void * component_getFactoryHelper( sal_Char const* pImplName, ::com::sun::star::lang::XMultiServiceFactory *, @@ -351,15 +341,6 @@ struct class_ : public serviceimpl_base< detail::ServiceImpl<ImplT_>, WithArgsT COMPHELPER_SERVICEDECL_COMPONENT_HELPER_MAX_ARGS; its default is 8. */ #define COMPHELPER_SERVICEDECL_make(z_, n_, unused_) \ -inline sal_Bool component_writeInfoHelper( \ - ::com::sun::star::lang::XMultiServiceFactory *, \ - ::com::sun::star::registry::XRegistryKey * xRegistryKey, \ - BOOST_PP_ENUM_PARAMS(n_, ServiceDecl const& s) ) \ -{ \ - bool bRet = true; \ - BOOST_PP_REPEAT(n_, COMPHELPER_SERVICEDECL_writeInfo, ~) \ - return bRet; \ -} \ inline void * component_getFactoryHelper( \ sal_Char const* pImplName, \ ::com::sun::star::lang::XMultiServiceFactory *, \ @@ -381,7 +362,6 @@ BOOST_PP_REPEAT_FROM_TO(1, COMPHELPER_SERVICEDECL_COMPONENT_HELPER_MAX_ARGS, #undef COMPHELPER_SERVICEDECL_COMPONENT_HELPER_MAX_ARGS #undef COMPHELPER_SERVICEDECL_make #undef COMPHELPER_SERVICEDECL_getFactory -#undef COMPHELPER_SERVICEDECL_writeInfo } // namespace service_decl } // namespace comphelper @@ -421,13 +401,6 @@ extern "C" \ *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; \ } \ \ - SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( ::com::sun::star::lang::XMultiServiceFactory* pServiceManager, \ - ::com::sun::star::registry::XRegistryKey* pRegistryKey ) \ - { \ - return component_writeInfoHelper( pServiceManager, pRegistryKey, \ - BOOST_PP_SEQ_ENUM(varargs_) ); \ - } \ - \ SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( sal_Char const* pImplName, \ ::com::sun::star::lang::XMultiServiceFactory* pServiceManager, \ ::com::sun::star::registry::XRegistryKey* pRegistryKey ) \ diff --git a/comphelper/prj/d.lst b/comphelper/prj/d.lst index f4d09c54ba70..f05fcf0926dd 100644 --- a/comphelper/prj/d.lst +++ b/comphelper/prj/d.lst @@ -12,3 +12,4 @@ mkdir: %_DEST%\inc%_EXT%\comphelper mkdir: %_DEST%\inc%_EXT%\cppuhelper ..\inc\comphelper\extract.hxx %_DEST%\inc%_EXT%\cppuhelper\extract.hxx ..\version.mk %_DEST%\inc%_EXT%\comphelper\version.mk +..\%__SRC%\misc\comphelp4.component %_DEST%\xml%_EXT%\comphelp4.component diff --git a/comphelper/source/misc/componentmodule.cxx b/comphelper/source/misc/componentmodule.cxx index 63893d0f6d0d..1dfd99bfa07e 100644 --- a/comphelper/source/misc/componentmodule.cxx +++ b/comphelper/source/misc/componentmodule.cxx @@ -135,64 +135,6 @@ namespace comphelper } //-------------------------------------------------------------------------- - sal_Bool OModule::writeComponentInfos( void* pServiceManager, void* pRegistryKey ) - { - Reference< XMultiServiceFactory > xFactory( static_cast< XMultiServiceFactory* >( pServiceManager ) ); - Reference< XRegistryKey > xRegistryKey( static_cast< XRegistryKey* >( pRegistryKey ) ); - return writeComponentInfos( xFactory, xRegistryKey ); - } - - //-------------------------------------------------------------------------- - sal_Bool OModule::writeComponentInfos( - const Reference< XMultiServiceFactory >& /*_rxServiceManager*/, - const Reference< XRegistryKey >& _rxRootKey ) - { - OSL_ENSURE( _rxRootKey.is(), "OModule::writeComponentInfos: invalid argument!" ); - - ::rtl::OUString sRootKey( "/", 1, RTL_TEXTENCODING_ASCII_US ); - - for ( ComponentDescriptions::const_iterator component = m_pImpl->m_aRegisteredComponents.begin(); - component != m_pImpl->m_aRegisteredComponents.end(); - ++component - ) - { - ::rtl::OUString sMainKeyName( sRootKey ); - sMainKeyName += component->sImplementationName; - sMainKeyName += ::rtl::OUString::createFromAscii( "/UNO/SERVICES" ); - - try - { - Reference< XRegistryKey > xNewKey( _rxRootKey->createKey( sMainKeyName ) ); - - const ::rtl::OUString* pService = component->aSupportedServices.getConstArray(); - const ::rtl::OUString* pServiceEnd = component->aSupportedServices.getConstArray() + component->aSupportedServices.getLength(); - for ( ; pService != pServiceEnd; ++pService ) - xNewKey->createKey( *pService ); - - if ( component->sSingletonName.getLength() ) - { - OSL_ENSURE( component->aSupportedServices.getLength() == 1, "OModule::writeComponentInfos: singletons should support exactly one service, shouldn't they?" ); - - ::rtl::OUString sSingletonKeyName( sRootKey ); - sSingletonKeyName += component->sImplementationName; - sSingletonKeyName += ::rtl::OUString::createFromAscii( "/UNO/SINGLETONS/" ); - sSingletonKeyName += component->sSingletonName; - - xNewKey = _rxRootKey->createKey( sSingletonKeyName ); - xNewKey->setStringValue( component->aSupportedServices[ 0 ] ); - } - } - catch( Exception& ) - { - OSL_ASSERT( "OModule::writeComponentInfos: something went wrong while creating the keys!" ); - return sal_False; - } - } - - return sal_True; - } - - //-------------------------------------------------------------------------- void* OModule::getComponentFactory( const sal_Char* _pImplementationName, void* _pServiceManager, void* /*_pRegistryKey*/ ) { Reference< XInterface > xFactory( getComponentFactory( diff --git a/comphelper/source/misc/servicedecl.cxx b/comphelper/source/misc/servicedecl.cxx index 7c3dd169485d..7986407b0bd5 100644 --- a/comphelper/source/misc/servicedecl.cxx +++ b/comphelper/source/misc/servicedecl.cxx @@ -116,37 +116,6 @@ ServiceDecl::Factory::createInstanceWithArgumentsAndContext( m_rServiceDecl, args, xContext ); } -bool ServiceDecl::writeInfo( registry::XRegistryKey * xKey ) const -{ - bool bRet = false; - if (xKey != 0) { - rtl::OUStringBuffer buf; - buf.append( static_cast<sal_Unicode>('/') ); - buf.appendAscii( m_pImplName ); - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("/UNO/SERVICES") ); - try { - uno::Reference<registry::XRegistryKey> const xNewKey( - xKey->createKey( buf.makeStringAndClear() ) ); - - rtl::OString const str(m_pServiceNames); - sal_Int32 nIndex = 0; - do { - rtl::OString const token( str.getToken( 0, m_cDelim, nIndex ) ); - xNewKey->createKey( - rtl::OUString( token.getStr(), token.getLength(), - RTL_TEXTENCODING_ASCII_US ) ); - } - while (nIndex >= 0); - - bRet = true; - } - catch (registry::InvalidRegistryException const&) { - OSL_ENSURE( false, "### InvalidRegistryException!" ); - } - } - return bRet; -} - void * ServiceDecl::getFactory( sal_Char const* pImplName ) const { if (rtl_str_compare(m_pImplName, pImplName) == 0) { diff --git a/comphelper/util/comphelp4.component b/comphelper/util/comphelp4.component new file mode 100644 index 000000000000..10d23d48bcea --- /dev/null +++ b/comphelper/util/comphelp4.component @@ -0,0 +1,70 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="AnyCompareFactory"> + <service name="com.sun.star.ucb.AnyCompareFactory"/> + </implementation> + <implementation name="IndexedPropertyValuesContainer"> + <service name="com.sun.star.document.IndexedPropertyValues"/> + </implementation> + <implementation name="NamedPropertyValuesContainer"> + <service name="com.sun.star.document.NamedPropertyValues"/> + </implementation> + <implementation name="com.sun.star.comp.MemoryStream"> + <service name="com.sun.star.comp.MemoryStream"/> + </implementation> + <implementation name="com.sun.star.comp.SequenceInputStreamService"> + <service name="com.sun.star.io.SequenceInputStream"/> + </implementation> + <implementation name="com.sun.star.comp.SequenceOutputStreamService"> + <service name="com.sun.star.io.SequenceOutputStream"/> + </implementation> + <implementation name="com.sun.star.comp.comphelper.OPropertyBag"> + <service name="com.sun.star.beans.PropertyBag"/> + </implementation> + <implementation name="com.sun.star.comp.embed.InstanceLocker"> + <service name="com.sun.star.embed.InstanceLocker"/> + </implementation> + <implementation name="com.sun.star.comp.logging.SimpleLogRing"> + <service name="com.sun.star.logging.SimpleLogRing"/> + <singleton name="com.sun.star.logging.DocumentIOLogRing"/> + </implementation> + <implementation name="com.sun.star.comp.task.OfficeRestartManager"> + <service name="com.sun.star.comp.task.OfficeRestartManager"/> + <singleton name="com.sun.star.task.OfficeRestartManager"/> + </implementation> + <implementation name="com.sun.star.comp.util.OfficeInstallationDirectories"> + <service name="com.sun.star.util.OfficeInstallationDirectories"/> + <singleton name="com.sun.star.util.theOfficeInstallationDirectories"/> + </implementation> + <implementation name="org.openoffice.comp.comphelper.EnumerableMap"> + <service name="com.sun.star.container.EnumerableMap"/> + </implementation> +</component> diff --git a/comphelper/util/exports.dxp b/comphelper/util/exports.dxp index 0c2e3e7cddd7..0cb5620a1603 100644 --- a/comphelper/util/exports.dxp +++ b/comphelper/util/exports.dxp @@ -1,3 +1,2 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory
\ No newline at end of file diff --git a/comphelper/util/makefile.mk b/comphelper/util/makefile.mk index ae391e92abf7..62e66672a1cb 100644 --- a/comphelper/util/makefile.mk +++ b/comphelper/util/makefile.mk @@ -68,3 +68,11 @@ DEFLIB1NAME=$(TARGET) # --- Targets ---------------------------------- .INCLUDE : target.mk + +ALLTAR : $(MISC)/comphelp4.component + +$(MISC)/comphelp4.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + comphelp4.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt comphelp4.component |