diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-05-31 22:22:58 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-06-01 15:21:54 +0100 |
commit | 8e2ee35376825cbafd52d8736b28d1dd9c86d569 (patch) | |
tree | 0256d4efa87faf55c733dd336d46b62ce66ba2e1 /toolkit | |
parent | c58129312b80961b5a8fb10a977a198f8894fab2 (diff) |
use comphelper pattern here
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/inc/toolkit/helper/macros.hxx | 36 |
1 files changed, 11 insertions, 25 deletions
diff --git a/toolkit/inc/toolkit/helper/macros.hxx b/toolkit/inc/toolkit/helper/macros.hxx index 76e60a86f70b..255530a32628 100644 --- a/toolkit/inc/toolkit/helper/macros.hxx +++ b/toolkit/inc/toolkit/helper/macros.hxx @@ -29,7 +29,7 @@ #ifndef _TOOLKIT_HELPER_MACROS_HXX_ #define _TOOLKIT_HELPER_MACROS_HXX_ -// ------------------------------------------------------------------------------------- +#include <comphelper/servicehelper.hxx> #define IMPL_XUNOTUNNEL( ClassName ) \ sal_Int64 ClassName::getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier ) throw(::com::sun::star::uno::RuntimeException) \ @@ -40,20 +40,13 @@ sal_Int64 ClassName::getSomething( const ::com::sun::star::uno::Sequence< sal_In } \ return 0; \ } \ +namespace \ +{ \ + class the##ClassName##UnoTunnelId : public rtl::Static< UnoTunnelIdInit, the##ClassName##UnoTunnelId> {}; \ +} \ const ::com::sun::star::uno::Sequence< sal_Int8 >& ClassName::GetUnoTunnelId() throw() \ { \ - static ::com::sun::star::uno::Sequence< sal_Int8 > * pSeq = NULL; \ - if( !pSeq ) \ - { \ - ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() ); \ - if( !pSeq ) \ - { \ - static ::com::sun::star::uno::Sequence< sal_Int8 > aSeq( 16 ); \ - rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True ); \ - pSeq = &aSeq; \ - } \ - } \ - return *pSeq; \ + return the##ClassName##UnoTunnelId::get().getSeq(); \ } \ ClassName* ClassName::GetImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxIFace ) throw() \ { \ @@ -70,20 +63,13 @@ sal_Int64 ClassName::getSomething( const ::com::sun::star::uno::Sequence< sal_In } \ return BaseClass::getSomething( rIdentifier ); \ } \ +namespace \ +{ \ + class the##ClassName##UnoTunnelId : public rtl::Static< UnoTunnelIdInit, the##ClassName##UnoTunnelId> {}; \ +} \ const ::com::sun::star::uno::Sequence< sal_Int8 >& ClassName::GetUnoTunnelId() throw() \ { \ - static ::com::sun::star::uno::Sequence< sal_Int8 > * pSeq = NULL; \ - if( !pSeq ) \ - { \ - ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() ); \ - if( !pSeq ) \ - { \ - static ::com::sun::star::uno::Sequence< sal_Int8 > aSeq( 16 ); \ - rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True ); \ - pSeq = &aSeq; \ - } \ - } \ - return *pSeq; \ + return the##ClassName##UnoTunnelId::get().getSeq(); \ } \ ClassName* ClassName::GetImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxIFace ) throw() \ { \ |