summaryrefslogtreecommitdiff
path: root/svtools/source/control
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-06-01 10:02:08 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-06-01 15:21:54 +0100
commitd248451ca3e7599145103be6c79c2b78699f12c9 (patch)
treedf3ee19a784c41344297c569d56dd851d1652de0 /svtools/source/control
parentd3050b7e9ff741dec96f374a71f33774f32274b1 (diff)
use tunnel pattern here
Diffstat (limited to 'svtools/source/control')
-rw-r--r--svtools/source/control/valueacc.cxx37
-rw-r--r--svtools/source/control/valueimp.hxx1
2 files changed, 11 insertions, 27 deletions
diff --git a/svtools/source/control/valueacc.cxx b/svtools/source/control/valueacc.cxx
index e558a72ae33a..69e90935dbad 100644
--- a/svtools/source/control/valueacc.cxx
+++ b/svtools/source/control/valueacc.cxx
@@ -35,6 +35,7 @@
#include <vcl/svapp.hxx>
#include <svtools/valueset.hxx>
#include "valueimp.hxx"
+#include <comphelper/servicehelper.hxx>
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
#include <com/sun/star/accessibility/AccessibleRole.hpp>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
@@ -133,22 +134,14 @@ void ValueSetAcc::FireAccessibleEvent( short nEventId, const uno::Any& rOldValue
}
}
-// -----------------------------------------------------------------------------
+namespace
+{
+ class theValueSetAccUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theValueSetAccUnoTunnelId > {};
+}
const uno::Sequence< sal_Int8 >& ValueSetAcc::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq;
-
- if( !aSeq.getLength() )
- {
- static osl::Mutex aCreateMutex;
- osl::Guard< osl::Mutex > aGuard( aCreateMutex );
-
- aSeq.realloc( 16 );
- rtl_createUuid( reinterpret_cast< sal_uInt8* >( aSeq.getArray() ), 0, sal_True );
- }
-
- return aSeq;
+ return theValueSetAccUnoTunnelId::get().getSeq();
}
// -----------------------------------------------------------------------------
@@ -851,22 +844,14 @@ void ValueItemAcc::ParentDestroyed()
mpParent = NULL;
}
-// -----------------------------------------------------------------------------
+namespace
+{
+ class theValueItemAccUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theValueItemAccUnoTunnelId > {};
+}
const uno::Sequence< sal_Int8 >& ValueItemAcc::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq;
-
- if( !aSeq.getLength() )
- {
- static osl::Mutex aCreateMutex;
- osl::Guard< osl::Mutex > aGuard( aCreateMutex );
-
- aSeq.realloc( 16 );
- rtl_createUuid( reinterpret_cast< sal_uInt8* >( aSeq.getArray() ), 0, sal_True );
- }
-
- return aSeq;
+ return theValueItemAccUnoTunnelId::get().getSeq();
}
// -----------------------------------------------------------------------------
diff --git a/svtools/source/control/valueimp.hxx b/svtools/source/control/valueimp.hxx
index a077e42f2905..57bb5fae0650 100644
--- a/svtools/source/control/valueimp.hxx
+++ b/svtools/source/control/valueimp.hxx
@@ -30,7 +30,6 @@
#include <tools/color.hxx>
#include <tools/string.hxx>
#include <vcl/image.hxx>
-#include <rtl/uuid.h>
#include <cppuhelper/implbase5.hxx>
#include <cppuhelper/compbase6.hxx>
#include <comphelper/broadcasthelper.hxx>