[Libreoffice-commits] .: dbaccess/source

Caolán McNamara caolan at kemper.freedesktop.org
Thu Jun 2 03:43:11 PDT 2011


 dbaccess/source/ui/browser/sbagrid.cxx |   22 +++++++---------------
 1 file changed, 7 insertions(+), 15 deletions(-)

New commits:
commit 5fcbcda7908f6609172ccf14295eb0be2b089fce
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Jun 2 00:06:10 2011 +0100

    use standard template here

diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx
index 90b784e..dc1582a 100644
--- a/dbaccess/source/ui/browser/sbagrid.cxx
+++ b/dbaccess/source/ui/browser/sbagrid.cxx
@@ -91,9 +91,9 @@
 #include <connectivity/dbtools.hxx>
 #include <connectivity/dbconversion.hxx>
 #include <cppuhelper/typeprovider.hxx>
-#include <rtl/uuid.h>
 #include <rtl/memory.h>
 #include <comphelper/extract.hxx>
+#include <comphelper/servicehelper.hxx>
 #include <com/sun/star/sdbcx/XTablesSupplier.hpp>
 #include <com/sun/star/sdbc/DataType.hpp>
 #include <vcl/msgbox.hxx>
@@ -589,24 +589,16 @@ void SAL_CALL SbaXGridPeer::removeStatusListener(const Reference< ::com::sun::st
         pCont->removeInterface(xControl);
 }
 
-//---------------------------------------------------------------------------------------
+namespace
+{
+    class theSbaXGridPeerUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSbaXGridPeerUnoTunnelId > {};
+}
+
 const Sequence< sal_Int8 > & SbaXGridPeer::getUnoTunnelId()
 {
-    static Sequence< sal_Int8 > * pSeq = 0;        
-    if( !pSeq )        
-    {
-        ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() );
-        if( !pSeq )                
-        {
-            static Sequence< sal_Int8 > aSeq( 16 );
-                rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0,sal_True );				
-                pSeq = &aSeq;                
-        }        
-    }        
-    return *pSeq;
+    return theSbaXGridPeerUnoTunnelId::get().getSeq();
 }
 
-//---------------------------------------------------------------------------------------
 Sequence< Type > SAL_CALL SbaXGridPeer::getTypes() throw (RuntimeException)
 {
     Sequence< Type > aTypes = FmXGridPeer::getTypes();


More information about the Libreoffice-commits mailing list