summaryrefslogtreecommitdiff
path: root/toolkit
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-01-12 13:48:24 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-01-13 12:53:27 +0000
commit172aedbc51e4bd972bef3f94d562e09ee7bc8355 (patch)
treeeecdf8098e03d20fa02504c36d400c1cf492eb71 /toolkit
parentce4193e3398e30c25ec28310a8034b4ca5513d7a (diff)
XUnoTunnel->dynamic_cast in VCLXDevice
Change-Id: I9fa06600d3b9a2172a1818f89a3b9c06d65c8c54 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145467 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'toolkit')
-rw-r--r--toolkit/source/awt/vclxdevice.cxx3
-rw-r--r--toolkit/source/awt/vclxgraphics.cxx2
-rw-r--r--toolkit/source/awt/vclxtoolkit.cxx2
-rw-r--r--toolkit/source/awt/vclxwindow.cxx4
-rw-r--r--toolkit/source/controls/stdtabcontroller.cxx2
-rw-r--r--toolkit/source/hatchwindow/hatchwindow.cxx2
-rw-r--r--toolkit/source/helper/unowrapper.cxx2
-rw-r--r--toolkit/source/helper/vclunohelper.cxx10
8 files changed, 10 insertions, 17 deletions
diff --git a/toolkit/source/awt/vclxdevice.cxx b/toolkit/source/awt/vclxdevice.cxx
index 5b83b9e62047..c4ed98146713 100644
--- a/toolkit/source/awt/vclxdevice.cxx
+++ b/toolkit/source/awt/vclxdevice.cxx
@@ -45,9 +45,6 @@ VCLXDevice::~VCLXDevice()
mpOutputDevice.reset();
}
-// css::lang::XUnoTunnel
-UNO3_GETIMPLEMENTATION_IMPL( VCLXDevice );
-
// css::awt::XDevice,
css::uno::Reference< css::awt::XGraphics > VCLXDevice::createGraphics( )
{
diff --git a/toolkit/source/awt/vclxgraphics.cxx b/toolkit/source/awt/vclxgraphics.cxx
index 3707f573b064..bbbb75e0545d 100644
--- a/toolkit/source/awt/vclxgraphics.cxx
+++ b/toolkit/source/awt/vclxgraphics.cxx
@@ -258,7 +258,7 @@ void VCLXGraphics::copy( const uno::Reference< awt::XDevice >& rxSource, sal_Int
if ( mpOutputDevice )
{
- VCLXDevice* pFromDev = comphelper::getFromUnoTunnel<VCLXDevice>( rxSource );
+ VCLXDevice* pFromDev = dynamic_cast<VCLXDevice*>( rxSource.get() );
DBG_ASSERT( pFromDev, "VCLXGraphics::copy - invalid device" );
if ( pFromDev )
{
diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx
index b361a20e3d3d..e890e24a6bdc 100644
--- a/toolkit/source/awt/vclxtoolkit.cxx
+++ b/toolkit/source/awt/vclxtoolkit.cxx
@@ -1848,7 +1848,7 @@ css::uno::Reference< css::awt::XWindowPeer > VCLXToolkit::ImplCreateWindow(
VclPtr<vcl::Window> pParent;
if ( rDescriptor.Parent.is() )
{
- VCLXWindow* pParentComponent = comphelper::getFromUnoTunnel<VCLXWindow>( rDescriptor.Parent );
+ VCLXWindow* pParentComponent = dynamic_cast<VCLXWindow*>( rDescriptor.Parent.get() );
// #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/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx
index d00bcf7f7cec..284ffb75326b 100644
--- a/toolkit/source/awt/vclxwindow.cxx
+++ b/toolkit/source/awt/vclxwindow.cxx
@@ -903,10 +903,6 @@ Size VCLXWindow::ImplCalcWindowSize( const Size& rOutSz ) const
}
-// css::lang::XUnoTunnel
-UNO3_GETIMPLEMENTATION2_IMPL(VCLXWindow, VCLXDevice);
-
-
// css::lang::Component
void VCLXWindow::dispose( )
{
diff --git a/toolkit/source/controls/stdtabcontroller.cxx b/toolkit/source/controls/stdtabcontroller.cxx
index c900d6d155a4..554fcfb3c76b 100644
--- a/toolkit/source/controls/stdtabcontroller.cxx
+++ b/toolkit/source/controls/stdtabcontroller.cxx
@@ -142,7 +142,7 @@ void StdTabController::ImplActivateControl( bool bFirst ) const
Reference< XWindowPeer > xCP = pControls[nCtrl]->getPeer();
if ( xCP.is() )
{
- VCLXWindow* pC = comphelper::getFromUnoTunnel<VCLXWindow>( xCP );
+ VCLXWindow* pC = dynamic_cast<VCLXWindow*>( xCP.get() );
if ( pC && pC->GetWindow() && ( pC->GetWindow()->GetStyle() & WB_TABSTOP ) )
{
pC->GetWindow()->GrabFocus();
diff --git a/toolkit/source/hatchwindow/hatchwindow.cxx b/toolkit/source/hatchwindow/hatchwindow.cxx
index b421e13091f2..4685126b203d 100644
--- a/toolkit/source/hatchwindow/hatchwindow.cxx
+++ b/toolkit/source/hatchwindow/hatchwindow.cxx
@@ -47,7 +47,7 @@ void VCLXHatchWindow::initializeWindow( const uno::Reference< awt::XWindowPeer >
SolarMutexGuard aGuard;
VclPtr<vcl::Window> pParent;
- VCLXWindow* pParentComponent = comphelper::getFromUnoTunnel<VCLXWindow>( xParent );
+ VCLXWindow* pParentComponent = dynamic_cast<VCLXWindow*>( xParent.get() );
if ( pParentComponent )
pParent = pParentComponent->GetWindow();
diff --git a/toolkit/source/helper/unowrapper.cxx b/toolkit/source/helper/unowrapper.cxx
index 080847154cb2..0fa36e82cab4 100644
--- a/toolkit/source/helper/unowrapper.cxx
+++ b/toolkit/source/helper/unowrapper.cxx
@@ -163,7 +163,7 @@ VclPtr<vcl::Window> UnoWrapper::GetWindow(const css::uno::Reference<css::awt::XW
void UnoWrapper::SetWindowInterface( vcl::Window* pWindow, const css::uno::Reference< css::awt::XWindowPeer> & xIFace )
{
- VCLXWindow* pVCLXWindow = comphelper::getFromUnoTunnel<VCLXWindow>( xIFace );
+ VCLXWindow* pVCLXWindow = dynamic_cast<VCLXWindow*>( xIFace.get() );
assert( pVCLXWindow && "must be a VCLXWindow subclass" );
if ( !pVCLXWindow )
diff --git a/toolkit/source/helper/vclunohelper.cxx b/toolkit/source/helper/vclunohelper.cxx
index bd2e55007350..bac88c66268a 100644
--- a/toolkit/source/helper/vclunohelper.cxx
+++ b/toolkit/source/helper/vclunohelper.cxx
@@ -104,19 +104,19 @@ css::uno::Reference< css::awt::XBitmap> VCLUnoHelper::CreateBitmap( const Bitmap
vcl::Window* VCLUnoHelper::GetWindow( const css::uno::Reference< css::awt::XWindow>& rxWindow )
{
- VCLXWindow* pVCLXWindow = comphelper::getFromUnoTunnel<VCLXWindow>( rxWindow );
+ VCLXWindow* pVCLXWindow = dynamic_cast<VCLXWindow*>( rxWindow.get() );
return pVCLXWindow ? pVCLXWindow->GetWindow() : nullptr;
}
vcl::Window* VCLUnoHelper::GetWindow( const css::uno::Reference< css::awt::XWindow2>& rxWindow )
{
- VCLXWindow* pVCLXWindow = comphelper::getFromUnoTunnel<VCLXWindow>( rxWindow );
+ VCLXWindow* pVCLXWindow = dynamic_cast<VCLXWindow*>( rxWindow.get() );
return pVCLXWindow ? pVCLXWindow->GetWindow() : nullptr;
}
vcl::Window* VCLUnoHelper::GetWindow( const css::uno::Reference< css::awt::XWindowPeer>& rxWindow )
{
- VCLXWindow* pVCLXWindow = comphelper::getFromUnoTunnel<VCLXWindow>( rxWindow );
+ VCLXWindow* pVCLXWindow = dynamic_cast<VCLXWindow*>( rxWindow.get() );
return pVCLXWindow ? pVCLXWindow->GetWindow() : nullptr;
}
@@ -149,7 +149,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 = comphelper::getFromUnoTunnel<VCLXDevice>( rxDevice );
+ VCLXDevice* pDev = dynamic_cast<VCLXDevice*>( rxDevice.get() );
if ( pDev )
pOutDev = pDev->GetOutputDevice();
return pOutDev;
@@ -158,7 +158,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 = comphelper::getFromUnoTunnel<VCLXGraphics>( rxGraphics );
+ VCLXGraphics* pGrf = dynamic_cast<VCLXGraphics*>( rxGraphics.get() );
if ( pGrf )
pOutDev = pGrf->GetOutputDevice();
return pOutDev;