diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-05-31 22:08:51 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-06-01 15:37:26 +0100 |
commit | 52388d29994a52f3dea83dbf214e81f9abfc11dc (patch) | |
tree | fca1d61cf56e6b1dd75bb8751913fa12164482b7 /starmath | |
parent | 652c7ca06db65bfc7138659ee4f89122548aee07 (diff) |
use UnoTunnelIdInit pattern
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/source/unomodel.cxx | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx index 210212b5ae7e..8ee267e65cb1 100644 --- a/starmath/source/unomodel.cxx +++ b/starmath/source/unomodel.cxx @@ -49,6 +49,7 @@ #include <xmloff/xmluconv.hxx> #include <rtl/ustrbuf.hxx> #include <comphelper/propertysetinfo.hxx> +#include <comphelper/servicehelper.hxx> #include <unotools/moduleoptions.hxx> #include <unomodel.hxx> @@ -369,18 +370,14 @@ uno::Sequence< uno::Type > SAL_CALL SmModel::getTypes( ) throw(uno::RuntimeExce return aTypes; } -const uno::Sequence< sal_Int8 > & SmModel::getUnoTunnelId() +namespace { - static osl::Mutex aCreateMutex; - osl::Guard<osl::Mutex> aGuard( aCreateMutex ); + class theSmModelUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSmModelUnoTunnelId> {}; +} - static uno::Sequence< sal_Int8 > aSeq; - if(!aSeq.getLength()) - { - aSeq.realloc( 16 ); - rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True ); - } - return aSeq; +const uno::Sequence< sal_Int8 > & SmModel::getUnoTunnelId() +{ + return theSmModelUnoTunnelId::get().getSeq(); } sal_Int64 SAL_CALL SmModel::getSomething( const uno::Sequence< sal_Int8 >& rId ) |