diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2022-12-01 15:26:11 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2022-12-16 20:17:51 +0000 |
commit | 068187a898cdd2e26e9b16c348ecc1ed2dee3f29 (patch) | |
tree | cc83d91484d9ca589b37f659186b0326c050d199 /toolkit | |
parent | 88b4f966202717cd4ad38a30a8eda22c3e69ed35 (diff) |
loplugin:unocast (VCLXWindow)
(See the upcoming commit introducing that loplugin:unocast on why such
dynamic_casts from UNO types are dangerous.)
Change-Id: Ic151fd657cb780291009ee4c9db51a35dfa7f357
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144335
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/source/helper/unowrapper.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/toolkit/source/helper/unowrapper.cxx b/toolkit/source/helper/unowrapper.cxx index 080847154cb2..2874087e14ef 100644 --- a/toolkit/source/helper/unowrapper.cxx +++ b/toolkit/source/helper/unowrapper.cxx @@ -26,6 +26,7 @@ #include <awt/vclxtopwindow.hxx> #include <awt/vclxwindows.hxx> +#include <comphelper/servicehelper.hxx> #include <toolkit/dllapi.h> #include <vcl/menu.hxx> @@ -179,7 +180,7 @@ void UnoWrapper::SetWindowInterface( vcl::Window* pWindow, const css::uno::Refer css::uno::Reference< css::awt::XWindowPeer> xPeer = pWindow->GetWindowPeer(); if( xPeer.is() ) { - bool bSameInstance( pVCLXWindow == dynamic_cast< VCLXWindow* >( xPeer.get() )); + bool bSameInstance( pVCLXWindow == comphelper::getFromUnoTunnel< VCLXWindow >( xPeer )); SAL_WARN_IF( !bSameInstance, "toolkit.helper", "UnoWrapper::SetWindowInterface: there is already a WindowPeer/ComponentInterface for this VCL window" ); if ( bSameInstance ) return; |