diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-01-13 15:09:47 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-01-14 10:51:22 +0000 |
commit | 8d97a90564abba49dcc072d33ddd12c93f4992fe (patch) | |
tree | 5a802ee1c9394a95ec739e0027bd5c3bb4d5534e /toolkit | |
parent | 6f812b7ac60c1c4fbc8ccba234c19ccf3871dee4 (diff) |
XUnoTunnel->dynamic_cast in VCLXMenu
Change-Id: Iee992e2e09647a7678fd05321e601a4c5bf0c430
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145469
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/source/awt/vclxmenu.cxx | 10 | ||||
-rw-r--r-- | toolkit/source/awt/vclxtopwindow.cxx | 2 |
2 files changed, 4 insertions, 8 deletions
diff --git a/toolkit/source/awt/vclxmenu.cxx b/toolkit/source/awt/vclxmenu.cxx index b17f32c2aebc..52edfb5caa49 100644 --- a/toolkit/source/awt/vclxmenu.cxx +++ b/toolkit/source/awt/vclxmenu.cxx @@ -214,22 +214,18 @@ css::uno::Any VCLXMenu::queryInterface( static_cast< css::awt::XMenu* >(static_cast<css::awt::XMenuBar*>(this)), static_cast< css::awt::XPopupMenu* >(this), static_cast< css::lang::XTypeProvider* >(this), - static_cast< css::lang::XServiceInfo* >(this), - static_cast< css::lang::XUnoTunnel* >(this) ); + static_cast< css::lang::XServiceInfo* >(this) ); else aRet = ::cppu::queryInterface( rType, static_cast< css::awt::XMenu* >(static_cast<css::awt::XMenuBar*>(this)), static_cast< css::awt::XMenuBar* >(this), static_cast< css::lang::XTypeProvider* >(this), - static_cast< css::lang::XServiceInfo* >(this), - static_cast< css::lang::XUnoTunnel* >(this) ); + static_cast< css::lang::XServiceInfo* >(this) ); return (aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType )); } -UNO3_GETIMPLEMENTATION_IMPL( VCLXMenu ); - css::uno::Sequence< css::uno::Type > VCLXMenu::getTypes() { std::unique_lock aGuard( maMutex ); @@ -385,7 +381,7 @@ void VCLXMenu::setPopupMenu( SolarMutexGuard aSolarGuard; std::unique_lock aGuard( maMutex ); - VCLXMenu* pVCLMenu = comphelper::getFromUnoTunnel<VCLXMenu>( rxPopupMenu ); + VCLXMenu* pVCLMenu = dynamic_cast<VCLXMenu*>( rxPopupMenu.get() ); DBG_ASSERT( pVCLMenu && pVCLMenu->GetMenu() && pVCLMenu->IsPopupMenu(), "setPopupMenu: Invalid Menu!" ); if ( mpMenu && pVCLMenu && pVCLMenu->GetMenu() && pVCLMenu->IsPopupMenu() ) diff --git a/toolkit/source/awt/vclxtopwindow.cxx b/toolkit/source/awt/vclxtopwindow.cxx index 7e392675b3f7..5a06c8e21506 100644 --- a/toolkit/source/awt/vclxtopwindow.cxx +++ b/toolkit/source/awt/vclxtopwindow.cxx @@ -128,7 +128,7 @@ void VCLXTopWindow::setMenuBar( const css::uno::Reference< css::awt::XMenuBar >& pSystemWindow->SetMenuBar( nullptr ); if ( rxMenu.is() ) { - VCLXMenu* pMenu = comphelper::getFromUnoTunnel<VCLXMenu>( rxMenu ); + VCLXMenu* pMenu = dynamic_cast<VCLXMenu*>( rxMenu.get() ); if ( pMenu && !pMenu->IsPopupMenu() ) pSystemWindow->SetMenuBar( static_cast<MenuBar*>( pMenu->GetMenu() )); } |