From 7275be15191c08009ac9c359163e3eeb1be25ca7 Mon Sep 17 00:00:00 2001
From: Stephan Bergmann <sbergman@redhat.com>
Date: Fri, 9 Sep 2011 17:06:45 +0200
Subject: sb140: #i117291# do not mis-use XTypeProvider.getImplementationId in
 XUnoTunnel.getSomething

---
 svtools/source/graphic/graphic.cxx | 19 +++----------------
 svtools/source/graphic/graphic.hxx |  1 -
 2 files changed, 3 insertions(+), 17 deletions(-)

(limited to 'svtools')

diff --git a/svtools/source/graphic/graphic.cxx b/svtools/source/graphic/graphic.cxx
index cf212d9d8fce..315f370a9287 100644
--- a/svtools/source/graphic/graphic.cxx
+++ b/svtools/source/graphic/graphic.cxx
@@ -114,19 +114,6 @@ void SAL_CALL Graphic::release() throw()
 
 // ------------------------------------------------------------------------------
 
-namespace
-{
-    class theGraphicUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theGraphicUnoTunnelId > {};
-}
-
-uno::Sequence< sal_Int8 > SAL_CALL Graphic::getImplementationId_Static()
-    throw(uno::RuntimeException)
-{
-    return theGraphicUnoTunnelId::get().getSeq();
-}
-
-// ------------------------------------------------------------------------------
-
 ::rtl::OUString Graphic::getImplementationName_Static()
     throw()
 {
@@ -210,7 +197,7 @@ uno::Sequence< uno::Type > SAL_CALL Graphic::getTypes()
 uno::Sequence< sal_Int8 > SAL_CALL Graphic::getImplementationId()
     throw(uno::RuntimeException)
 {
-    return getImplementationId_Static();
+    return uno::Sequence< sal_Int8 >();
 }
 
 // ------------------------------------------------------------------------------
@@ -282,14 +269,14 @@ const ::Graphic* Graphic::getImplementation( const uno::Reference< uno::XInterfa
     throw()
 {
     uno::Reference< lang::XUnoTunnel > xTunnel( rxIFace, uno::UNO_QUERY );
-    return( xTunnel.is() ? reinterpret_cast< ::Graphic* >( xTunnel->getSomething( getImplementationId_Static() ) ) : NULL );
+	return( xTunnel.is() ? reinterpret_cast< ::Graphic* >( xTunnel->getSomething( ::Graphic::getUnoTunnelId() ) ) : NULL );
 }
 
 //----------------------------------------------------------------------
 sal_Int64 SAL_CALL Graphic::getSomething( const uno::Sequence< sal_Int8 >& rId )
     throw( uno::RuntimeException )
 {
-    return( ( rId.getLength() == 16 && 0 == rtl_compareMemory( getImplementationId().getConstArray(), rId.getConstArray(), 16 ) ) ?
+	return( ( rId.getLength() == 16 && 0 == rtl_compareMemory( ::Graphic::getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 ) ) ?
             reinterpret_cast< sal_Int64 >( mpGraphic ) :
             0 );
 }
diff --git a/svtools/source/graphic/graphic.hxx b/svtools/source/graphic/graphic.hxx
index a82c9cca7ced..7b4f5e014742 100644
--- a/svtools/source/graphic/graphic.hxx
+++ b/svtools/source/graphic/graphic.hxx
@@ -62,7 +62,6 @@ public:
     void init( const ::Graphic& rGraphic ) throw();
 
     static const ::Graphic* getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxIFace ) throw();
-    static ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId_Static(  ) throw(::com::sun::star::uno::RuntimeException);
     static ::rtl::OUString getImplementationName_Static() throw();
     static ::com::sun::star::uno::Sequence< ::rtl::OUString >  getSupportedServiceNames_Static() throw();
 
-- 
cgit