diff options
-rw-r--r-- | sw/source/uibase/docvw/SidebarWinAcc.cxx | 3 | ||||
-rw-r--r-- | toolkit/source/helper/unowrapper.cxx | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/sw/source/uibase/docvw/SidebarWinAcc.cxx b/sw/source/uibase/docvw/SidebarWinAcc.cxx index f489bc140b6b..740c3f175ec3 100644 --- a/sw/source/uibase/docvw/SidebarWinAcc.cxx +++ b/sw/source/uibase/docvw/SidebarWinAcc.cxx @@ -22,6 +22,7 @@ #include <viewsh.hxx> #include <accmap.hxx> +#include <comphelper/servicehelper.hxx> #include <toolkit/awt/vclxaccessiblecomponent.hxx> #include <com/sun/star/accessibility/AccessibleRole.hpp> @@ -38,7 +39,7 @@ class SidebarWinAccessibleContext : public VCLXAccessibleComponent explicit SidebarWinAccessibleContext( sw::annotation::SwAnnotationWin& rSidebarWin, SwViewShell& rViewShell, const SwFrame* pAnchorFrame ) - : VCLXAccessibleComponent( dynamic_cast<VCLXWindow*>(rSidebarWin.CreateAccessible().get()) ) + : VCLXAccessibleComponent( comphelper::getFromUnoTunnel<VCLXWindow>(rSidebarWin.CreateAccessible()) ) , mrViewShell( rViewShell ) , mpAnchorFrame( pAnchorFrame ) { 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; |