diff options
author | Matúš Kukan <matus.kukan@gmail.com> | 2011-07-21 13:28:01 +0200 |
---|---|---|
committer | Matúš Kukan <matus.kukan@gmail.com> | 2011-07-21 13:28:54 +0200 |
commit | cfbcec3375a958cd0ff4a03c4eb6afded9b803d2 (patch) | |
tree | fc3048c4ab39dd1bf68741b5c2de8b7c69065188 /extensions | |
parent | 5747dfabbf8f0b0ee70c9b1361a30054b1b46394 (diff) |
Do not use macros from comphelper's componentmodule.hxx
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/source/logging/log_module.cxx | 19 | ||||
-rw-r--r-- | extensions/source/logging/log_module.hxx | 50 | ||||
-rw-r--r-- | extensions/source/logging/log_services.cxx | 7 | ||||
-rw-r--r-- | extensions/source/oooimprovecore/core.cxx | 1 | ||||
-rw-r--r-- | extensions/source/oooimprovecore/oooimprovecore_module.cxx | 19 | ||||
-rw-r--r-- | extensions/source/oooimprovecore/oooimprovecore_module.hxx | 51 | ||||
-rw-r--r-- | extensions/source/oooimprovecore/oooimprovecore_services.cxx | 7 |
7 files changed, 147 insertions, 7 deletions
diff --git a/extensions/source/logging/log_module.cxx b/extensions/source/logging/log_module.cxx index c6b2eb677c0d..8d28f1f95c9b 100644 --- a/extensions/source/logging/log_module.cxx +++ b/extensions/source/logging/log_module.cxx @@ -36,7 +36,24 @@ namespace logging { //........................................................................ - IMPLEMENT_COMPONENT_MODULE( LogModule ); + struct LogModuleCreator + { + LogModule m_aLogModule; + }; + namespace + { + class theLogModuleInstance : public rtl::Static<LogModuleCreator, theLogModuleInstance> {}; + } + + LogModule::LogModule() + :BaseClass() + { + } + + LogModule& LogModule::getInstance() + { + return theLogModuleInstance::get().m_aLogModule; + } //........................................................................ } // namespace logging diff --git a/extensions/source/logging/log_module.hxx b/extensions/source/logging/log_module.hxx index dfee11365350..9728b49db85c 100644 --- a/extensions/source/logging/log_module.hxx +++ b/extensions/source/logging/log_module.hxx @@ -36,7 +36,55 @@ namespace logging { //........................................................................ - DECLARE_COMPONENT_MODULE( LogModule, LogModuleClient ) + class LogModule : public ::comphelper::OModule + { + friend struct LogModuleCreator; + typedef ::comphelper::OModule BaseClass; + + public: + static LogModule& getInstance(); + + private: + LogModule(); + }; + + /* -------------------------------------------------------------------- */ + class LogModuleClient : public ::comphelper::OModuleClient + { + private: + typedef ::comphelper::OModuleClient BaseClass; + + public: + LogModuleClient() : BaseClass( LogModule::getInstance() ) + { + } + }; + + /* -------------------------------------------------------------------- */ + template < class TYPE > + class OAutoRegistration : public ::comphelper::OAutoRegistration< TYPE > + { + private: + typedef ::comphelper::OAutoRegistration< TYPE > BaseClass; + + public: + OAutoRegistration() : BaseClass( LogModule::getInstance() ) + { + } + }; + + /* -------------------------------------------------------------------- */ + template < class TYPE > + class OSingletonRegistration : public ::comphelper::OSingletonRegistration< TYPE > + { + private: + typedef ::comphelper::OSingletonRegistration< TYPE > BaseClass; + + public: + OSingletonRegistration() : BaseClass( LogModule::getInstance() ) + { + } + }; //........................................................................ } // namespace logging diff --git a/extensions/source/logging/log_services.cxx b/extensions/source/logging/log_services.cxx index 1b3e0e842706..1f1996dc0760 100644 --- a/extensions/source/logging/log_services.cxx +++ b/extensions/source/logging/log_services.cxx @@ -59,6 +59,11 @@ namespace logging } // namespace logging //........................................................................ -IMPLEMENT_COMPONENT_LIBRARY_API( ::logging::LogModule, ::logging::initializeModule ) +extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( + const sal_Char* pImplementationName, void* pServiceManager, void* pRegistryKey ) +{ + ::logging::initializeModule(); + return ::logging::LogModule::getInstance().getComponentFactory( pImplementationName, pServiceManager, pRegistryKey ); +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/extensions/source/oooimprovecore/core.cxx b/extensions/source/oooimprovecore/core.cxx index 00b6978a1e1d..bffab742eaee 100644 --- a/extensions/source/oooimprovecore/core.cxx +++ b/extensions/source/oooimprovecore/core.cxx @@ -36,7 +36,6 @@ #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/oooimprovement/XCoreController.hpp> #include <com/sun/star/uno/XComponentContext.hpp> -#include <comphelper/componentmodule.hxx> #include <comphelper/configurationhelper.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/uieventslogger.hxx> diff --git a/extensions/source/oooimprovecore/oooimprovecore_module.cxx b/extensions/source/oooimprovecore/oooimprovecore_module.cxx index f77d45f2393a..f76b54e6bb25 100644 --- a/extensions/source/oooimprovecore/oooimprovecore_module.cxx +++ b/extensions/source/oooimprovecore/oooimprovecore_module.cxx @@ -33,7 +33,24 @@ namespace oooimprovecore { - IMPLEMENT_COMPONENT_MODULE( OooimprovecoreModule ); + struct OooimprovecoreModuleCreator + { + OooimprovecoreModule m_aOooimprovecoreModule; + }; + namespace + { + class theOooimprovecoreModuleInstance : public rtl::Static<OooimprovecoreModuleCreator, theOooimprovecoreModuleInstance> {}; + } + + OooimprovecoreModule::OooimprovecoreModule() + :BaseClass() + { + } + + OooimprovecoreModule& OooimprovecoreModule::getInstance() + { + return theOooimprovecoreModuleInstance::get().m_aOooimprovecoreModule; + } } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/extensions/source/oooimprovecore/oooimprovecore_module.hxx b/extensions/source/oooimprovecore/oooimprovecore_module.hxx index 432dcc71997d..3dda474cc7ce 100644 --- a/extensions/source/oooimprovecore/oooimprovecore_module.hxx +++ b/extensions/source/oooimprovecore/oooimprovecore_module.hxx @@ -33,7 +33,56 @@ namespace oooimprovecore { - DECLARE_COMPONENT_MODULE( OooimprovecoreModule, OooimprovecoreModuleClient ) + /* -------------------------------------------------------------------- */ + class OooimprovecoreModule : public ::comphelper::OModule + { + friend struct OooimprovecoreModuleCreator; + typedef ::comphelper::OModule BaseClass; + + public: + static OooimprovecoreModule& getInstance(); + + private: + OooimprovecoreModule(); + }; + + /* -------------------------------------------------------------------- */ + class OooimprovecoreModuleClient : public ::comphelper::OModuleClient + { + private: + typedef ::comphelper::OModuleClient BaseClass; + + public: + OooimprovecoreModuleClient() : BaseClass( OooimprovecoreModule::getInstance() ) + { + } + }; + + /* -------------------------------------------------------------------- */ + template < class TYPE > + class OAutoRegistration : public ::comphelper::OAutoRegistration< TYPE > + { + private: + typedef ::comphelper::OAutoRegistration< TYPE > BaseClass; + + public: + OAutoRegistration() : BaseClass( OooimprovecoreModule::getInstance() ) + { + } + }; + + /* -------------------------------------------------------------------- */ + template < class TYPE > + class OSingletonRegistration : public ::comphelper::OSingletonRegistration< TYPE > + { + private: + typedef ::comphelper::OSingletonRegistration< TYPE > BaseClass; + + public: + OSingletonRegistration() : BaseClass( OooimprovecoreModule::getInstance() ) + { + } + }; } #endif diff --git a/extensions/source/oooimprovecore/oooimprovecore_services.cxx b/extensions/source/oooimprovecore/oooimprovecore_services.cxx index 0682cdef2947..e444405c69c0 100644 --- a/extensions/source/oooimprovecore/oooimprovecore_services.cxx +++ b/extensions/source/oooimprovecore/oooimprovecore_services.cxx @@ -43,6 +43,11 @@ namespace oooimprovecore } -IMPLEMENT_COMPONENT_LIBRARY_API( ::oooimprovecore::OooimprovecoreModule, ::oooimprovecore::initializeModule) +extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( + const sal_Char* pImplementationName, void* pServiceManager, void* pRegistryKey ) +{ + ::oooimprovecore::initializeModule(); + return ::oooimprovecore::OooimprovecoreModule::getInstance().getComponentFactory( pImplementationName, pServiceManager, pRegistryKey ); +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |