diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2019-06-04 02:29:43 +0300 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2019-06-04 09:06:43 +0200 |
commit | 32eeb405d7fd6788aaa34e1bf8a04388d7a3958f (patch) | |
tree | 4bcb859baf3d570846228eb522e055879c92e24e /toolkit | |
parent | bb847b448f8b04e40ba66e7feab42f2b697383b4 (diff) |
tdf#39593 remove IMPL_XUNOTUNNEL* macros
Replace with UNO3_GETIMPLEMENTATION* macros.
Replace single usage of IMPL_XUNOTUNNEL_MINIMAL with it's body.
Change-Id: I7d4ad76399b999ebb2178ecf57edcf6bd2aa6c3e
Reviewed-on: https://gerrit.libreoffice.org/73424
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/source/awt/vclxbitmap.cxx | 2 | ||||
-rw-r--r-- | toolkit/source/awt/vclxdevice.cxx | 2 | ||||
-rw-r--r-- | toolkit/source/awt/vclxfont.cxx | 2 | ||||
-rw-r--r-- | toolkit/source/awt/vclxgraphics.cxx | 4 | ||||
-rw-r--r-- | toolkit/source/awt/vclxmenu.cxx | 5 | ||||
-rw-r--r-- | toolkit/source/awt/vclxpointer.cxx | 3 | ||||
-rw-r--r-- | toolkit/source/awt/vclxregion.cxx | 2 | ||||
-rw-r--r-- | toolkit/source/awt/vclxtoolkit.cxx | 2 | ||||
-rw-r--r-- | toolkit/source/awt/vclxtopwindow.cxx | 2 | ||||
-rw-r--r-- | toolkit/source/awt/vclxwindow.cxx | 24 | ||||
-rw-r--r-- | toolkit/source/controls/stdtabcontroller.cxx | 2 | ||||
-rw-r--r-- | toolkit/source/controls/unocontrolmodel.cxx | 20 | ||||
-rw-r--r-- | toolkit/source/helper/unowrapper.cxx | 2 | ||||
-rw-r--r-- | toolkit/source/helper/vclunohelper.cxx | 16 |
14 files changed, 41 insertions, 47 deletions
diff --git a/toolkit/source/awt/vclxbitmap.cxx b/toolkit/source/awt/vclxbitmap.cxx index c5cd50b9ac1b..b04bc46aa8aa 100644 --- a/toolkit/source/awt/vclxbitmap.cxx +++ b/toolkit/source/awt/vclxbitmap.cxx @@ -42,7 +42,7 @@ css::uno::Any VCLXBitmap::queryInterface( const css::uno::Type & rType ) } // css::lang::XUnoTunnel -IMPL_XUNOTUNNEL( VCLXBitmap ) +UNO3_GETIMPLEMENTATION_IMPL( VCLXBitmap ); IMPL_IMPLEMENTATION_ID( VCLXBitmap ) diff --git a/toolkit/source/awt/vclxdevice.cxx b/toolkit/source/awt/vclxdevice.cxx index 8eb75223c9bb..afa2e3483717 100644 --- a/toolkit/source/awt/vclxdevice.cxx +++ b/toolkit/source/awt/vclxdevice.cxx @@ -66,7 +66,7 @@ css::uno::Any VCLXDevice::queryInterface( const css::uno::Type & rType ) } // css::lang::XUnoTunnel -IMPL_XUNOTUNNEL( VCLXDevice ) +UNO3_GETIMPLEMENTATION_IMPL( VCLXDevice ); IMPL_IMPLEMENTATION_ID( VCLXDevice ) diff --git a/toolkit/source/awt/vclxfont.cxx b/toolkit/source/awt/vclxfont.cxx index 5cddc38fd7e6..2ef43db70a15 100644 --- a/toolkit/source/awt/vclxfont.cxx +++ b/toolkit/source/awt/vclxfont.cxx @@ -82,7 +82,7 @@ css::uno::Any VCLXFont::queryInterface( const css::uno::Type & rType ) } // css::lang::XUnoTunnel -IMPL_XUNOTUNNEL( VCLXFont ) +UNO3_GETIMPLEMENTATION_IMPL( VCLXFont ); IMPL_IMPLEMENTATION_ID( VCLXFont ) diff --git a/toolkit/source/awt/vclxgraphics.cxx b/toolkit/source/awt/vclxgraphics.cxx index d1a53aa3300b..d4e158838923 100644 --- a/toolkit/source/awt/vclxgraphics.cxx +++ b/toolkit/source/awt/vclxgraphics.cxx @@ -52,7 +52,7 @@ uno::Any VCLXGraphics::queryInterface( const uno::Type & rType ) } // lang::XUnoTunnel -IMPL_XUNOTUNNEL( VCLXGraphics ) +UNO3_GETIMPLEMENTATION_IMPL( VCLXGraphics ); IMPL_IMPLEMENTATION_ID( VCLXGraphics ) @@ -286,7 +286,7 @@ void VCLXGraphics::copy( const uno::Reference< awt::XDevice >& rxSource, sal_Int if ( mpOutputDevice ) { - VCLXDevice* pFromDev = VCLXDevice::GetImplementation( rxSource ); + VCLXDevice* pFromDev = VCLXDevice::getImplementation( rxSource ); DBG_ASSERT( pFromDev, "VCLXGraphics::copy - invalid device" ); if ( pFromDev ) { diff --git a/toolkit/source/awt/vclxmenu.cxx b/toolkit/source/awt/vclxmenu.cxx index 716eec4a0105..a757b0a7647e 100644 --- a/toolkit/source/awt/vclxmenu.cxx +++ b/toolkit/source/awt/vclxmenu.cxx @@ -19,7 +19,6 @@ #include <toolkit/awt/vclxmenu.hxx> #include <toolkit/helper/convert.hxx> -#include <toolkit/helper/macros.hxx> #include <toolkit/helper/servicenames.hxx> #include <toolkit/helper/vclunohelper.hxx> @@ -231,7 +230,7 @@ css::uno::Any VCLXMenu::queryInterface( } -IMPL_XUNOTUNNEL( VCLXMenu ) +UNO3_GETIMPLEMENTATION_IMPL( VCLXMenu ); css::uno::Sequence< css::uno::Type > VCLXMenu::getTypes() { @@ -388,7 +387,7 @@ void VCLXMenu::setPopupMenu( SolarMutexGuard aSolarGuard; ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() ); - VCLXMenu* pVCLMenu = VCLXMenu::GetImplementation( rxPopupMenu ); + VCLXMenu* pVCLMenu = VCLXMenu::getImplementation( rxPopupMenu ); DBG_ASSERT( pVCLMenu && pVCLMenu->GetMenu() && pVCLMenu->IsPopupMenu(), "setPopupMenu: Invalid Menu!" ); if ( mpMenu && pVCLMenu && pVCLMenu->GetMenu() && pVCLMenu->IsPopupMenu() ) diff --git a/toolkit/source/awt/vclxpointer.cxx b/toolkit/source/awt/vclxpointer.cxx index d47380eeb434..7ddc4ac5796c 100644 --- a/toolkit/source/awt/vclxpointer.cxx +++ b/toolkit/source/awt/vclxpointer.cxx @@ -19,7 +19,6 @@ #include <com/sun/star/uno/XComponentContext.hpp> #include <toolkit/awt/vclxpointer.hxx> -#include <toolkit/helper/macros.hxx> #include <cppuhelper/supportsservice.hxx> VCLXPointer::VCLXPointer() : maPointer(PointerStyle::Arrow) @@ -31,7 +30,7 @@ VCLXPointer::~VCLXPointer() } // css::lang::XUnoTunnel -IMPL_XUNOTUNNEL( VCLXPointer ) +UNO3_GETIMPLEMENTATION_IMPL( VCLXPointer ); void VCLXPointer::setType( sal_Int32 nType ) { diff --git a/toolkit/source/awt/vclxregion.cxx b/toolkit/source/awt/vclxregion.cxx index 1acbcde82f6e..18ef02fb48de 100644 --- a/toolkit/source/awt/vclxregion.cxx +++ b/toolkit/source/awt/vclxregion.cxx @@ -48,7 +48,7 @@ css::uno::Any VCLXRegion::queryInterface( const css::uno::Type & rType ) } // css::lang::XUnoTunnel -IMPL_XUNOTUNNEL( VCLXRegion ) +UNO3_GETIMPLEMENTATION_IMPL( VCLXRegion ); IMPL_IMPLEMENTATION_ID( VCLXRegion ) diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx index 69567b33c17b..5b70b8eb56bb 100644 --- a/toolkit/source/awt/vclxtoolkit.cxx +++ b/toolkit/source/awt/vclxtoolkit.cxx @@ -1519,7 +1519,7 @@ css::uno::Reference< css::awt::XWindowPeer > VCLXToolkit::ImplCreateWindow( VclPtr<vcl::Window> pParent; if ( rDescriptor.Parent.is() ) { - VCLXWindow* pParentComponent = VCLXWindow::GetImplementation( rDescriptor.Parent ); + VCLXWindow* pParentComponent = VCLXWindow::getImplementation( rDescriptor.Parent ); // #103939# Don't throw assertion, may be it's a system dependent window, used in ImplCreateWindow. // DBG_ASSERT( pParentComponent, "ParentComponent not valid" ); diff --git a/toolkit/source/awt/vclxtopwindow.cxx b/toolkit/source/awt/vclxtopwindow.cxx index fd78b543768f..bd53b7238c92 100644 --- a/toolkit/source/awt/vclxtopwindow.cxx +++ b/toolkit/source/awt/vclxtopwindow.cxx @@ -154,7 +154,7 @@ void VCLXTopWindow_Base::setMenuBar( const css::uno::Reference< css::awt::XMenuB pSystemWindow->SetMenuBar( nullptr ); if ( rxMenu.is() ) { - VCLXMenu* pMenu = VCLXMenu::GetImplementation( rxMenu ); + VCLXMenu* pMenu = VCLXMenu::getImplementation( rxMenu ); if ( pMenu && !pMenu->IsPopupMenu() ) pSystemWindow->SetMenuBar( static_cast<MenuBar*>( pMenu->GetMenu() )); } diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx index 27d06f564c34..b1e2fc5cf536 100644 --- a/toolkit/source/awt/vclxwindow.cxx +++ b/toolkit/source/awt/vclxwindow.cxx @@ -924,27 +924,7 @@ Size VCLXWindow::ImplCalcWindowSize( const Size& rOutSz ) const // css::lang::XUnoTunnel -sal_Int64 VCLXWindow::getSomething( const css::uno::Sequence< sal_Int8 >& rIdentifier ) -{ - if( ( rIdentifier.getLength() == 16 ) && ( 0 == memcmp( VCLXWindow::GetUnoTunnelId().getConstArray(), rIdentifier.getConstArray(), 16 ) ) ) - { - return sal::static_int_cast< sal_Int64 >(reinterpret_cast< sal_IntPtr >(this)); - } - return VCLXDevice::getSomething( rIdentifier ); -} -namespace -{ - class theVCLXWindowUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theVCLXWindowUnoTunnelId> {}; -} -const css::uno::Sequence< sal_Int8 >& VCLXWindow::GetUnoTunnelId() throw() -{ - return theVCLXWindowUnoTunnelId::get().getSeq(); -} -VCLXWindow* VCLXWindow::GetImplementation( const css::uno::Reference< css::uno::XInterface >& rxIFace ) -{ - css::uno::Reference< css::lang::XUnoTunnel > xUT( rxIFace, css::uno::UNO_QUERY ); - return xUT.is() ? reinterpret_cast<VCLXWindow*>(sal::static_int_cast<sal_IntPtr>(xUT->getSomething( VCLXWindow::GetUnoTunnelId() ))) : nullptr; -} +UNO3_GETIMPLEMENTATION2_IMPL(VCLXWindow, VCLXDevice); // css::lang::Component @@ -1163,7 +1143,7 @@ void VCLXWindow::setPointer( const css::uno::Reference< css::awt::XPointer >& rx { SolarMutexGuard aGuard; - VCLXPointer* pPointer = VCLXPointer::GetImplementation( rxPointer ); + VCLXPointer* pPointer = VCLXPointer::getImplementation( rxPointer ); if ( pPointer && GetWindow() ) GetWindow()->SetPointer( pPointer->GetPointer() ); } diff --git a/toolkit/source/controls/stdtabcontroller.cxx b/toolkit/source/controls/stdtabcontroller.cxx index d94ffd006c81..bdcee66c9ede 100644 --- a/toolkit/source/controls/stdtabcontroller.cxx +++ b/toolkit/source/controls/stdtabcontroller.cxx @@ -150,7 +150,7 @@ void StdTabController::ImplActivateControl( bool bFirst ) const Reference< XWindowPeer > xCP = pControls[nCtrl]->getPeer(); if ( xCP.is() ) { - VCLXWindow* pC = VCLXWindow::GetImplementation( xCP ); + VCLXWindow* pC = VCLXWindow::getImplementation( xCP ); if ( pC && pC->GetWindow() && ( pC->GetWindow()->GetStyle() & WB_TABSTOP ) ) { pC->GetWindow()->GrabFocus(); diff --git a/toolkit/source/controls/unocontrolmodel.cxx b/toolkit/source/controls/unocontrolmodel.cxx index b2ac375acba8..fa27371cc914 100644 --- a/toolkit/source/controls/unocontrolmodel.cxx +++ b/toolkit/source/controls/unocontrolmodel.cxx @@ -30,7 +30,6 @@ #include <com/sun/star/io/XMarkableStream.hpp> #include <com/sun/star/i18n/Currency2.hpp> #include <toolkit/controls/unocontrolmodel.hxx> -#include <toolkit/helper/macros.hxx> #include <cppuhelper/supportsservice.hxx> #include <cppuhelper/typeprovider.hxx> #include <rtl/uuid.h> @@ -46,6 +45,7 @@ #include <unotools/configmgr.hxx> #include <comphelper/sequence.hxx> #include <comphelper/extract.hxx> +#include <comphelper/servicehelper.hxx> #include <vcl/svapp.hxx> #include <vcl/unohelp.hxx> #include <uno/data.h> @@ -426,7 +426,23 @@ css::uno::Any UnoControlModel::queryAggregation( const css::uno::Type & rType ) } // css::lang::XUnoTunnel -IMPL_XUNOTUNNEL_MINIMAL( UnoControlModel ) +namespace +{ + class theUnoControlModelUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theUnoControlModelUnoTunnelId> {}; +} + +const css::uno::Sequence< sal_Int8 >& UnoControlModel::GetUnoTunnelId() throw() +{ + return theUnoControlModelUnoTunnelId::get().getSeq(); +} + +sal_Int64 UnoControlModel::getSomething( const css::uno::Sequence< sal_Int8 >& rIdentifier ) +{ + if( ( rIdentifier.getLength() == 16 ) && ( memcmp( UnoControlModel::GetUnoTunnelId().getConstArray(), rIdentifier.getConstArray(), 16 ) == 0 ) ) + return sal::static_int_cast< sal_Int64 >(reinterpret_cast< sal_IntPtr >(this)); + + return 0; +} // XInterface IMPLEMENT_FORWARD_REFCOUNT( UnoControlModel, UnoControlModel_Base ) diff --git a/toolkit/source/helper/unowrapper.cxx b/toolkit/source/helper/unowrapper.cxx index 46bd22300cd8..1d7ace5837ee 100644 --- a/toolkit/source/helper/unowrapper.cxx +++ b/toolkit/source/helper/unowrapper.cxx @@ -170,7 +170,7 @@ VclPtr<vcl::Window> UnoWrapper::GetWindow(const css::uno::Reference<css::awt::XW void UnoWrapper::SetWindowInterface( vcl::Window* pWindow, css::uno::Reference< css::awt::XWindowPeer> xIFace ) { - VCLXWindow* pVCLXWindow = VCLXWindow::GetImplementation( xIFace ); + VCLXWindow* pVCLXWindow = VCLXWindow::getImplementation( xIFace ); DBG_ASSERT( pVCLXWindow, "SetComponentInterface - unsupported type" ); if ( pVCLXWindow ) diff --git a/toolkit/source/helper/vclunohelper.cxx b/toolkit/source/helper/vclunohelper.cxx index 8d25f51e3832..c3e05cb2e6ac 100644 --- a/toolkit/source/helper/vclunohelper.cxx +++ b/toolkit/source/helper/vclunohelper.cxx @@ -79,7 +79,7 @@ BitmapEx VCLUnoHelper::GetBitmap( const css::uno::Reference< css::awt::XBitmap>& } else if ( rxBitmap.is() ) { - VCLXBitmap* pVCLBitmap = VCLXBitmap::GetImplementation( rxBitmap ); + VCLXBitmap* pVCLBitmap = VCLXBitmap::getImplementation( rxBitmap ); if ( pVCLBitmap ) aBmp = pVCLBitmap->GetBitmap(); else @@ -110,26 +110,26 @@ css::uno::Reference< css::awt::XBitmap> VCLUnoHelper::CreateBitmap( const Bitmap VclPtr< vcl::Window > VCLUnoHelper::GetWindow( const css::uno::Reference< css::awt::XWindow>& rxWindow ) { - VCLXWindow* pVCLXWindow = VCLXWindow::GetImplementation( rxWindow ); + VCLXWindow* pVCLXWindow = VCLXWindow::getImplementation( rxWindow ); return pVCLXWindow ? pVCLXWindow->GetWindow() : VclPtr< vcl::Window >(); } VclPtr< vcl::Window > VCLUnoHelper::GetWindow( const css::uno::Reference< css::awt::XWindow2>& rxWindow ) { - VCLXWindow* pVCLXWindow = VCLXWindow::GetImplementation( rxWindow ); + VCLXWindow* pVCLXWindow = VCLXWindow::getImplementation( rxWindow ); return pVCLXWindow ? pVCLXWindow->GetWindow() : VclPtr< vcl::Window >(); } VclPtr< vcl::Window > VCLUnoHelper::GetWindow( const css::uno::Reference< css::awt::XWindowPeer>& rxWindow ) { - VCLXWindow* pVCLXWindow = VCLXWindow::GetImplementation( rxWindow ); + VCLXWindow* pVCLXWindow = VCLXWindow::getImplementation( rxWindow ); return pVCLXWindow ? pVCLXWindow->GetWindow() : VclPtr< vcl::Window >(); } vcl::Region VCLUnoHelper::GetRegion( const css::uno::Reference< css::awt::XRegion >& rxRegion ) { vcl::Region aRegion; - VCLXRegion* pVCLRegion = VCLXRegion::GetImplementation( rxRegion ); + VCLXRegion* pVCLRegion = VCLXRegion::getImplementation( rxRegion ); if ( pVCLRegion ) aRegion = pVCLRegion->GetRegion(); else @@ -156,7 +156,7 @@ css::uno::Reference< css::awt::XWindow> VCLUnoHelper::GetInterface( vcl::Window* OutputDevice* VCLUnoHelper::GetOutputDevice( const css::uno::Reference< css::awt::XDevice>& rxDevice ) { VclPtr<OutputDevice> pOutDev; - VCLXDevice* pDev = VCLXDevice::GetImplementation( rxDevice ); + VCLXDevice* pDev = VCLXDevice::getImplementation( rxDevice ); if ( pDev ) pOutDev = pDev->GetOutputDevice(); return pOutDev; @@ -165,7 +165,7 @@ OutputDevice* VCLUnoHelper::GetOutputDevice( const css::uno::Reference< css::awt OutputDevice* VCLUnoHelper::GetOutputDevice( const css::uno::Reference< css::awt::XGraphics>& rxGraphics ) { OutputDevice* pOutDev = nullptr; - VCLXGraphics* pGrf = VCLXGraphics::GetImplementation( rxGraphics ); + VCLXGraphics* pGrf = VCLXGraphics::getImplementation( rxGraphics ); if ( pGrf ) pOutDev = pGrf->GetOutputDevice(); return pOutDev; @@ -258,7 +258,7 @@ vcl::Font VCLUnoHelper::CreateFont( const css::awt::FontDescriptor& rDescr, cons vcl::Font VCLUnoHelper::CreateFont( const css::uno::Reference< css::awt::XFont >& rxFont ) { vcl::Font aFont; - VCLXFont* pVCLXFont = VCLXFont::GetImplementation( rxFont ); + VCLXFont* pVCLXFont = VCLXFont::getImplementation( rxFont ); if ( pVCLXFont ) aFont = pVCLXFont->GetFont(); return aFont; |