summaryrefslogtreecommitdiff
path: root/unotools/source/accessibility
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-06-01 09:36:11 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-06-01 15:21:54 +0100
commitd3050b7e9ff741dec96f374a71f33774f32274b1 (patch)
tree291cfff711288475556a39d0eb5de708cee363ac /unotools/source/accessibility
parent386cc4f05131c81024779e040019b79330b4dcaf (diff)
use tunnel pattern here
Diffstat (limited to 'unotools/source/accessibility')
-rw-r--r--unotools/source/accessibility/accessiblerelationsethelper.cxx16
-rw-r--r--unotools/source/accessibility/accessiblestatesethelper.cxx16
2 files changed, 14 insertions, 18 deletions
diff --git a/unotools/source/accessibility/accessiblerelationsethelper.cxx b/unotools/source/accessibility/accessiblerelationsethelper.cxx
index 55cfa3e6ef42..69eb31d41c2d 100644
--- a/unotools/source/accessibility/accessiblerelationsethelper.cxx
+++ b/unotools/source/accessibility/accessiblerelationsethelper.cxx
@@ -31,9 +31,9 @@
#include "unotools/accessiblerelationsethelper.hxx"
-#include <rtl/uuid.h>
#include <vector>
#include <comphelper/sequence.hxx>
+#include <comphelper/servicehelper.hxx>
using namespace ::utl;
using namespace ::rtl;
@@ -258,18 +258,16 @@ uno::Sequence< ::com::sun::star::uno::Type>
return aTypeSequence;
}
+namespace
+{
+ class theAccessibleRelationSetHelperUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theAccessibleRelationSetHelperUnoTunnelId > {};
+}
+
uno::Sequence<sal_Int8> SAL_CALL
AccessibleRelationSetHelper::getImplementationId (void)
throw (::com::sun::star::uno::RuntimeException)
{
- osl::MutexGuard aGuard (maMutex);
- static uno::Sequence<sal_Int8> aId;
- if (aId.getLength() == 0)
- {
- aId.realloc (16);
- rtl_createUuid ((sal_uInt8 *)aId.getArray(), 0, sal_True);
- }
- return aId;
+ return theAccessibleRelationSetHelperUnoTunnelId::get().getSeq();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/accessibility/accessiblestatesethelper.cxx b/unotools/source/accessibility/accessiblestatesethelper.cxx
index f4705c5e25bc..9229e1c4045c 100644
--- a/unotools/source/accessibility/accessiblestatesethelper.cxx
+++ b/unotools/source/accessibility/accessiblestatesethelper.cxx
@@ -31,8 +31,8 @@
#include "unotools/accessiblestatesethelper.hxx"
-#include <rtl/uuid.h>
#include <tools/debug.hxx>
+#include <comphelper/servicehelper.hxx>
// defines how many states the bitfield can contain
// it has the size of 64 because I use a uInt64
@@ -310,18 +310,16 @@ uno::Sequence< ::com::sun::star::uno::Type>
return aTypeSequence;
}
+namespace
+{
+ class theAccessibleStateSetHelperUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theAccessibleStateSetHelperUnoTunnelId > {};
+}
+
uno::Sequence<sal_Int8> SAL_CALL
AccessibleStateSetHelper::getImplementationId (void)
throw (::com::sun::star::uno::RuntimeException)
{
- osl::MutexGuard aGuard (maMutex);
- static uno::Sequence<sal_Int8> aId;
- if (aId.getLength() == 0)
- {
- aId.realloc (16);
- rtl_createUuid ((sal_uInt8 *)aId.getArray(), 0, sal_True);
- }
- return aId;
+ return theAccessibleStateSetHelperUnoTunnelId::get().getSeq();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */