summaryrefslogtreecommitdiffstats
path: root/starmath
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-05-31 22:08:51 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-06-01 15:37:26 +0100
commit52388d29994a52f3dea83dbf214e81f9abfc11dc (patch)
treefca1d61cf56e6b1dd75bb8751913fa12164482b7 /starmath
parentmake this per-class instead of a local static (diff)
downloadcore-52388d29994a52f3dea83dbf214e81f9abfc11dc.tar.gz
core-52388d29994a52f3dea83dbf214e81f9abfc11dc.zip
use UnoTunnelIdInit pattern
Diffstat (limited to 'starmath')
-rw-r--r--starmath/source/unomodel.cxx17
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 )