From 7b9449986d841e2649e24a3045e6b821e4016438 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 1 Jun 2011 11:35:21 +0100 Subject: use tunnel pattern here --- configmgr/source/childaccess.cxx | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'configmgr') diff --git a/configmgr/source/childaccess.cxx b/configmgr/source/childaccess.cxx index fc8e1ca4395c..08f22d937148 100644 --- a/configmgr/source/childaccess.cxx +++ b/configmgr/source/childaccess.cxx @@ -43,6 +43,7 @@ #include "cppu/unotype.hxx" #include "cppuhelper/queryinterface.hxx" #include "cppuhelper/weak.hxx" +#include "comphelper/servicehelper.hxx" #include "osl/diagnose.h" #include "osl/mutex.hxx" #include "rtl/ref.hxx" @@ -50,7 +51,6 @@ #include "rtl/ustrbuf.hxx" #include "rtl/ustring.h" #include "rtl/ustring.hxx" -#include "rtl/uuid.h" #include "sal/types.h" #include "access.hxx" @@ -77,15 +77,14 @@ namespace css = com::sun::star; } -css::uno::Sequence< sal_Int8 > ChildAccess::getTunnelId() { - static css::uno::Sequence< sal_Int8 > id; - if (id.getLength() == 0) { - css::uno::Sequence< sal_Int8 > uuid(16); - rtl_createUuid( - reinterpret_cast< sal_uInt8 * >(uuid.getArray()), 0, false); - id = uuid; - } - return id; +namespace +{ + class theChildAccessUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theChildAccessUnoTunnelId > {}; +} + +css::uno::Sequence< sal_Int8 > ChildAccess::getTunnelId() +{ + return theChildAccessUnoTunnelId::get().getSeq(); } ChildAccess::ChildAccess( -- cgit