diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-09-14 08:19:47 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-09-15 06:07:36 +0200 |
commit | 05bc93db2de56000f65764d7e394d03747cac23d (patch) | |
tree | 975de9ae83572aac8a5c3ea8db281e1017ee5be0 /framework | |
parent | 8cbb414ed737f9ffc76e1258e6671769bf63fc6c (diff) |
Use <comphelper/servicehelper.hxx> implementing XUnoTunnel part 1
The header got some changes:
1. Move UnoTunnelIdInit and isUnoTunnelId into 'comphelper' namespace
2. Rename UnoTunnelIdInit to UnoIdInit, as a precondition to replace
of uses of OImplementationId with it, including in XTypeProvider
3. Introduce convenience functions 'getSomething_cast' to cast between
sal_Int64 and object pointers uniformly.
4. Rename getUnoTunnelImplementation to getFromUnoTunnel, both to make
it a bit shorter, and to reflect its function better. Templatize it
to take also css::uno::Any for convenience.
5. Introduce getSomethingImpl, inspired by sw::UnoTunnelImpl; allow it
handle cases both with and without fallback to parent.
6. Adjust UNO3_GETIMPLEMENTATION_* macros
TODO (in separate commits):
- Drop sw::UnoTunnelImpl and sw::UnoTunnelGetImplementation
- Replace all uses of OImplementationId in core with UnoIdInit
- Deprecate OImplementationId in <cppuhelper/typeprovider.hxx>
- Change implementations of getSomething to use getSomethingImpl
- Revise uses of getSomething to use getFromUnoTunnel
Change-Id: If4a3cb024130f1f552f988f0479589da1cd066e7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122022
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'framework')
19 files changed, 41 insertions, 41 deletions
diff --git a/framework/source/fwi/uielement/constitemcontainer.cxx b/framework/source/fwi/uielement/constitemcontainer.cxx index a137a5f8c6b1..8c39d7ee763d 100644 --- a/framework/source/fwi/uielement/constitemcontainer.cxx +++ b/framework/source/fwi/uielement/constitemcontainer.cxx @@ -147,7 +147,7 @@ Reference< XIndexAccess > ConstItemContainer::deepCopyContainer( const Reference Reference< XIndexAccess > xReturn; if ( rSubContainer.is() ) { - ItemContainer* pSource = comphelper::getUnoTunnelImplementation<ItemContainer>( rSubContainer ); + ItemContainer* pSource = comphelper::getFromUnoTunnel<ItemContainer>( rSubContainer ); rtl::Reference<ConstItemContainer> pSubContainer; if ( pSource ) pSubContainer = new ConstItemContainer( *pSource ); @@ -162,7 +162,7 @@ Reference< XIndexAccess > ConstItemContainer::deepCopyContainer( const Reference // XUnoTunnel sal_Int64 ConstItemContainer::getSomething( const css::uno::Sequence< sal_Int8 >& rIdentifier ) { - if( isUnoTunnelId<ConstItemContainer>(rIdentifier) ) + if( comphelper::isUnoTunnelId<ConstItemContainer>(rIdentifier) ) { return reinterpret_cast< sal_Int64 >( this ); } @@ -171,7 +171,7 @@ sal_Int64 ConstItemContainer::getSomething( const css::uno::Sequence< sal_Int8 > const Sequence< sal_Int8 >& ConstItemContainer::getUnoTunnelId() noexcept { - static const UnoTunnelIdInit theConstItemContainerUnoTunnelId; + static const comphelper::UnoIdInit theConstItemContainerUnoTunnelId; return theConstItemContainerUnoTunnelId.getSeq(); } diff --git a/framework/source/fwi/uielement/itemcontainer.cxx b/framework/source/fwi/uielement/itemcontainer.cxx index b30791b3067f..1f690452aee2 100644 --- a/framework/source/fwi/uielement/itemcontainer.cxx +++ b/framework/source/fwi/uielement/itemcontainer.cxx @@ -122,7 +122,7 @@ Reference< XIndexAccess > ItemContainer::deepCopyContainer( const Reference< XIn Reference< XIndexAccess > xReturn; if ( rSubContainer.is() ) { - ConstItemContainer* pSource = comphelper::getUnoTunnelImplementation<ConstItemContainer>( rSubContainer ); + ConstItemContainer* pSource = comphelper::getFromUnoTunnel<ConstItemContainer>( rSubContainer ); rtl::Reference<ItemContainer> pSubContainer; if ( pSource ) pSubContainer = new ItemContainer( *pSource, rMutex ); @@ -136,7 +136,7 @@ Reference< XIndexAccess > ItemContainer::deepCopyContainer( const Reference< XIn const Sequence< sal_Int8 >& ItemContainer::getUnoTunnelId() noexcept { - static const UnoTunnelIdInit theItemContainerUnoTunnelId; + static const comphelper::UnoIdInit theItemContainerUnoTunnelId; return theItemContainerUnoTunnelId.getSeq(); } diff --git a/framework/source/fwi/uielement/rootitemcontainer.cxx b/framework/source/fwi/uielement/rootitemcontainer.cxx index af754788de8a..2dacda65fe3b 100644 --- a/framework/source/fwi/uielement/rootitemcontainer.cxx +++ b/framework/source/fwi/uielement/rootitemcontainer.cxx @@ -126,7 +126,7 @@ Reference< XIndexAccess > RootItemContainer::deepCopyContainer( const Reference< Reference< XIndexAccess > xReturn; if ( rSubContainer.is() ) { - ConstItemContainer* pSource = comphelper::getUnoTunnelImplementation<ConstItemContainer>( rSubContainer ); + ConstItemContainer* pSource = comphelper::getFromUnoTunnel<ConstItemContainer>( rSubContainer ); rtl::Reference<ItemContainer> pSubContainer; if ( pSource ) pSubContainer = new ItemContainer( *pSource, m_aShareMutex ); @@ -141,14 +141,14 @@ Reference< XIndexAccess > RootItemContainer::deepCopyContainer( const Reference< // XUnoTunnel sal_Int64 RootItemContainer::getSomething( const css::uno::Sequence< sal_Int8 >& rIdentifier ) { - if( isUnoTunnelId<RootItemContainer>(rIdentifier) ) + if( comphelper::isUnoTunnelId<RootItemContainer>(rIdentifier) ) return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >( this )); return 0; } const Sequence< sal_Int8 >& RootItemContainer::getUnoTunnelId() noexcept { - static const UnoTunnelIdInit theRootItemContainerUnoTunnelId; + static const comphelper::UnoIdInit theRootItemContainerUnoTunnelId; return theRootItemContainerUnoTunnelId.getSeq(); } diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx index 3b0de8bdca71..788e0796c8df 100644 --- a/framework/source/layoutmanager/layoutmanager.cxx +++ b/framework/source/layoutmanager/layoutmanager.cxx @@ -179,7 +179,7 @@ void LayoutManager::implts_createMenuBar(const OUString& rMenuBarName) if ( !xMenuBar.is() ) return; - VCLXMenu* pAwtMenuBar = comphelper::getUnoTunnelImplementation<VCLXMenu>( xMenuBar ); + VCLXMenu* pAwtMenuBar = comphelper::getFromUnoTunnel<VCLXMenu>( xMenuBar ); if ( pAwtMenuBar ) { MenuBar* pMenuBar = static_cast<MenuBar*>(pAwtMenuBar->GetMenu()); @@ -227,7 +227,7 @@ void LayoutManager::impl_clearUpMenuBar() } } - VCLXMenu* pAwtMenuBar = comphelper::getUnoTunnelImplementation<VCLXMenu>( xMenuBar ); + VCLXMenu* pAwtMenuBar = comphelper::getFromUnoTunnel<VCLXMenu>( xMenuBar ); if ( pAwtMenuBar ) pSetMenuBar = static_cast<MenuBar*>(pAwtMenuBar->GetMenu()); } diff --git a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx index 889b90cae936..ef141701cb6c 100644 --- a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx +++ b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx @@ -424,7 +424,7 @@ void ModuleUIConfigurationManager::impl_requestUIElementData( sal_Int16 nElement { MenuConfiguration aMenuCfg( m_xContext ); Reference< XIndexAccess > xContainer( aMenuCfg.CreateMenuBarConfigurationFromXML( xInputStream )); - auto pRootItemContainer = comphelper::getUnoTunnelImplementation<RootItemContainer>( xContainer ); + auto pRootItemContainer = comphelper::getFromUnoTunnel<RootItemContainer>( xContainer ); if ( pRootItemContainer ) aUIElementData.xSettings = new ConstItemContainer( pRootItemContainer, true ); else @@ -443,7 +443,7 @@ void ModuleUIConfigurationManager::impl_requestUIElementData( sal_Int16 nElement { Reference< XIndexContainer > xIndexContainer( new RootItemContainer() ); ToolBoxConfiguration::LoadToolBox( m_xContext, xInputStream, xIndexContainer ); - auto pRootItemContainer = comphelper::getUnoTunnelImplementation<RootItemContainer>( xIndexContainer ); + auto pRootItemContainer = comphelper::getFromUnoTunnel<RootItemContainer>( xIndexContainer ); aUIElementData.xSettings = new ConstItemContainer( pRootItemContainer, true ); return; } @@ -460,7 +460,7 @@ void ModuleUIConfigurationManager::impl_requestUIElementData( sal_Int16 nElement { Reference< XIndexContainer > xIndexContainer( new RootItemContainer() ); StatusBarConfiguration::LoadStatusBar( m_xContext, xInputStream, xIndexContainer ); - auto pRootItemContainer = comphelper::getUnoTunnelImplementation<RootItemContainer>( xIndexContainer ); + auto pRootItemContainer = comphelper::getFromUnoTunnel<RootItemContainer>( xIndexContainer ); aUIElementData.xSettings = new ConstItemContainer( pRootItemContainer, true ); return; } diff --git a/framework/source/uiconfiguration/uiconfigurationmanager.cxx b/framework/source/uiconfiguration/uiconfigurationmanager.cxx index b1dd9b24f37b..eebfad2fb5a7 100644 --- a/framework/source/uiconfiguration/uiconfigurationmanager.cxx +++ b/framework/source/uiconfiguration/uiconfigurationmanager.cxx @@ -347,7 +347,7 @@ void UIConfigurationManager::impl_requestUIElementData( sal_Int16 nElementType, { MenuConfiguration aMenuCfg( m_xContext ); Reference< XIndexAccess > xContainer( aMenuCfg.CreateMenuBarConfigurationFromXML( xInputStream )); - auto pRootItemContainer = comphelper::getUnoTunnelImplementation<RootItemContainer>( xContainer ); + auto pRootItemContainer = comphelper::getFromUnoTunnel<RootItemContainer>( xContainer ); if ( pRootItemContainer ) aUIElementData.xSettings = new ConstItemContainer( pRootItemContainer, true ); else @@ -366,7 +366,7 @@ void UIConfigurationManager::impl_requestUIElementData( sal_Int16 nElementType, { Reference< XIndexContainer > xIndexContainer( new RootItemContainer() ); ToolBoxConfiguration::LoadToolBox( m_xContext, xInputStream, xIndexContainer ); - auto pRootItemContainer = comphelper::getUnoTunnelImplementation<RootItemContainer>( xIndexContainer ); + auto pRootItemContainer = comphelper::getFromUnoTunnel<RootItemContainer>( xIndexContainer ); aUIElementData.xSettings = new ConstItemContainer( pRootItemContainer, true ); return; } @@ -383,7 +383,7 @@ void UIConfigurationManager::impl_requestUIElementData( sal_Int16 nElementType, { Reference< XIndexContainer > xIndexContainer( new RootItemContainer() ); StatusBarConfiguration::LoadStatusBar( m_xContext, xInputStream, xIndexContainer ); - auto pRootItemContainer = comphelper::getUnoTunnelImplementation<RootItemContainer>( xIndexContainer ); + auto pRootItemContainer = comphelper::getFromUnoTunnel<RootItemContainer>( xIndexContainer ); aUIElementData.xSettings = new ConstItemContainer( pRootItemContainer, true ); return; } diff --git a/framework/source/uielement/fontmenucontroller.cxx b/framework/source/uielement/fontmenucontroller.cxx index 0e3466992ab7..0ddfb458f7e0 100644 --- a/framework/source/uielement/fontmenucontroller.cxx +++ b/framework/source/uielement/fontmenucontroller.cxx @@ -85,7 +85,7 @@ FontMenuController::~FontMenuController() // private function void FontMenuController::fillPopupMenu( const Sequence< OUString >& rFontNameSeq, Reference< css::awt::XPopupMenu > const & rPopupMenu ) { - VCLXPopupMenu* pPopupMenu = static_cast<VCLXPopupMenu *>(comphelper::getUnoTunnelImplementation<VCLXMenu>( rPopupMenu )); + VCLXPopupMenu* pPopupMenu = static_cast<VCLXPopupMenu *>(comphelper::getFromUnoTunnel<VCLXMenu>( rPopupMenu )); PopupMenu* pVCLPopupMenu = nullptr; SolarMutexGuard aSolarMutexGuard; diff --git a/framework/source/uielement/fontsizemenucontroller.cxx b/framework/source/uielement/fontsizemenucontroller.cxx index 684128d8008f..4a70e0ab2e5f 100644 --- a/framework/source/uielement/fontsizemenucontroller.cxx +++ b/framework/source/uielement/fontsizemenucontroller.cxx @@ -129,7 +129,7 @@ void FontSizeMenuController::setCurHeight( tools::Long nHeight, Reference< css:: // private function void FontSizeMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu > const & rPopupMenu ) { - VCLXPopupMenu* pPopupMenu = static_cast<VCLXPopupMenu *>(comphelper::getUnoTunnelImplementation<VCLXMenu>( rPopupMenu )); + VCLXPopupMenu* pPopupMenu = static_cast<VCLXPopupMenu *>(comphelper::getFromUnoTunnel<VCLXMenu>( rPopupMenu )); PopupMenu* pVCLPopupMenu = nullptr; resetPopupMenu( rPopupMenu ); diff --git a/framework/source/uielement/headermenucontroller.cxx b/framework/source/uielement/headermenucontroller.cxx index f0c443b299c2..2851295c7c0a 100644 --- a/framework/source/uielement/headermenucontroller.cxx +++ b/framework/source/uielement/headermenucontroller.cxx @@ -80,7 +80,7 @@ HeaderMenuController::~HeaderMenuController() // private function void HeaderMenuController::fillPopupMenu( const Reference< css::frame::XModel >& rModel, Reference< css::awt::XPopupMenu > const & rPopupMenu ) { - VCLXPopupMenu* pPopupMenu = static_cast<VCLXPopupMenu *>(comphelper::getUnoTunnelImplementation<VCLXMenu>( rPopupMenu )); + VCLXPopupMenu* pPopupMenu = static_cast<VCLXPopupMenu *>(comphelper::getFromUnoTunnel<VCLXMenu>( rPopupMenu )); PopupMenu* pVCLPopupMenu = nullptr; SolarMutexGuard aSolarMutexGuard; diff --git a/framework/source/uielement/langselectionmenucontroller.cxx b/framework/source/uielement/langselectionmenucontroller.cxx index d9458a895788..09ce859f43db 100644 --- a/framework/source/uielement/langselectionmenucontroller.cxx +++ b/framework/source/uielement/langselectionmenucontroller.cxx @@ -159,7 +159,7 @@ void LanguageSelectionMenuController::impl_setPopupMenu() void LanguageSelectionMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu > const & rPopupMenu , const Mode eMode ) { - VCLXPopupMenu* pVCLPopupMenu = static_cast<VCLXPopupMenu *>(comphelper::getUnoTunnelImplementation<VCLXMenu>( rPopupMenu )); + VCLXPopupMenu* pVCLPopupMenu = static_cast<VCLXPopupMenu *>(comphelper::getFromUnoTunnel<VCLXMenu>( rPopupMenu )); PopupMenu* pPopupMenu = nullptr; SolarMutexGuard aSolarMutexGuard; diff --git a/framework/source/uielement/macrosmenucontroller.cxx b/framework/source/uielement/macrosmenucontroller.cxx index 89f3b32a86ac..a4c5123f50c7 100644 --- a/framework/source/uielement/macrosmenucontroller.cxx +++ b/framework/source/uielement/macrosmenucontroller.cxx @@ -74,7 +74,7 @@ void MacrosMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu > cons if (bMacrosDisabled) return; - VCLXPopupMenu* pVCLPopupMenu = static_cast<VCLXPopupMenu *>(comphelper::getUnoTunnelImplementation<VCLXMenu>( rPopupMenu )); + VCLXPopupMenu* pVCLPopupMenu = static_cast<VCLXPopupMenu *>(comphelper::getFromUnoTunnel<VCLXMenu>( rPopupMenu )); PopupMenu* pPopupMenu = nullptr; SolarMutexGuard aSolarMutexGuard; diff --git a/framework/source/uielement/newmenucontroller.cxx b/framework/source/uielement/newmenucontroller.cxx index b6636330899b..1e6d88e9c286 100644 --- a/framework/source/uielement/newmenucontroller.cxx +++ b/framework/source/uielement/newmenucontroller.cxx @@ -305,7 +305,7 @@ NewMenuController::~NewMenuController() // private function void NewMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu > const & rPopupMenu ) { - VCLXPopupMenu* pPopupMenu = static_cast<VCLXPopupMenu *>(comphelper::getUnoTunnelImplementation<VCLXMenu>( rPopupMenu )); + VCLXPopupMenu* pPopupMenu = static_cast<VCLXPopupMenu *>(comphelper::getFromUnoTunnel<VCLXMenu>( rPopupMenu )); PopupMenu* pVCLPopupMenu = nullptr; SolarMutexGuard aSolarMutexGuard; @@ -388,7 +388,7 @@ void SAL_CALL NewMenuController::itemSelected( const css::awt::MenuEvent& rEvent if ( !xPopupMenu.is() ) return; - VCLXPopupMenu* pPopupMenu = static_cast<VCLXPopupMenu *>(comphelper::getUnoTunnelImplementation<VCLXMenu>( xPopupMenu )); + VCLXPopupMenu* pPopupMenu = static_cast<VCLXPopupMenu *>(comphelper::getFromUnoTunnel<VCLXMenu>( xPopupMenu )); if ( !pPopupMenu ) return; @@ -418,7 +418,7 @@ void SAL_CALL NewMenuController::itemActivated( const css::awt::MenuEvent& ) if ( !(m_xFrame.is() && m_xPopupMenu.is()) ) return; - VCLXPopupMenu* pPopupMenu = static_cast<VCLXPopupMenu *>(comphelper::getUnoTunnelImplementation<VCLXMenu>( m_xPopupMenu )); + VCLXPopupMenu* pPopupMenu = static_cast<VCLXPopupMenu *>(comphelper::getFromUnoTunnel<VCLXMenu>( m_xPopupMenu )); if ( !pPopupMenu ) return; diff --git a/framework/source/uielement/objectmenucontroller.cxx b/framework/source/uielement/objectmenucontroller.cxx index 74c3b2436602..7300eab60030 100644 --- a/framework/source/uielement/objectmenucontroller.cxx +++ b/framework/source/uielement/objectmenucontroller.cxx @@ -81,7 +81,7 @@ ObjectMenuController::ObjectMenuController( const css::uno::Reference< css::uno: void ObjectMenuController::fillPopupMenu( const Sequence< css::embed::VerbDescriptor >& rVerbCommandSeq, Reference< css::awt::XPopupMenu > const & rPopupMenu ) { const css::embed::VerbDescriptor* pVerbCommandArray = rVerbCommandSeq.getConstArray(); - VCLXPopupMenu* pPopupMenu = static_cast<VCLXPopupMenu *>(comphelper::getUnoTunnelImplementation<VCLXMenu>( rPopupMenu )); + VCLXPopupMenu* pPopupMenu = static_cast<VCLXPopupMenu *>(comphelper::getFromUnoTunnel<VCLXMenu>( rPopupMenu )); PopupMenu* pVCLPopupMenu = nullptr; SolarMutexGuard aSolarMutexGuard; diff --git a/framework/source/uielement/popuptoolbarcontroller.cxx b/framework/source/uielement/popuptoolbarcontroller.cxx index 7048778029e4..d4f702d84e50 100644 --- a/framework/source/uielement/popuptoolbarcontroller.cxx +++ b/framework/source/uielement/popuptoolbarcontroller.cxx @@ -352,7 +352,7 @@ void GenericPopupToolbarController::statusChanged( const css::frame::FeatureStat if ( m_bReplaceWithLast && !rEvent.IsEnabled && m_xPopupMenu.is() ) { - Menu* pVclMenu = comphelper::getUnoTunnelImplementation<VCLXMenu>( m_xPopupMenu )->GetMenu(); + Menu* pVclMenu = comphelper::getFromUnoTunnel<VCLXMenu>( m_xPopupMenu )->GetMenu(); ToolBox* pToolBox = nullptr; ToolBoxItemId nId; @@ -695,7 +695,7 @@ void SAL_CALL NewToolbarController::execute( sal_Int16 /*KeyModifier*/ ) { // TODO investigate how to wrap Get/SetUserValue in css::awt::XMenu SolarMutexGuard aSolarMutexGuard; - Menu* pVclMenu = comphelper::getUnoTunnelImplementation<VCLXMenu>( m_xPopupMenu )->GetMenu(); + Menu* pVclMenu = comphelper::getFromUnoTunnel<VCLXMenu>( m_xPopupMenu )->GetMenu(); aURL = pVclMenu->GetItemCommand( m_nMenuId ); MenuAttributes* pMenuAttributes( static_cast<MenuAttributes*>( pVclMenu->GetUserValue( m_nMenuId ) ) ); @@ -724,7 +724,7 @@ sal_uInt16 NewToolbarController::getMenuIdForCommand( std::u16string_view rComma { if ( m_xPopupMenu.is() && !rCommand.empty() ) { - Menu* pVclMenu( comphelper::getUnoTunnelImplementation<VCLXMenu>( m_xPopupMenu )->GetMenu() ); + Menu* pVclMenu( comphelper::getFromUnoTunnel<VCLXMenu>( m_xPopupMenu )->GetMenu() ); sal_uInt16 nCount = pVclMenu->GetItemCount(); for ( sal_uInt16 n = 0; n < nCount; ++n ) { @@ -751,7 +751,7 @@ void SAL_CALL NewToolbarController::updateImage() OUString aURL, aImageId; if ( m_xPopupMenu.is() && m_nMenuId ) { - Menu* pVclMenu = comphelper::getUnoTunnelImplementation<VCLXMenu>( m_xPopupMenu )->GetMenu(); + Menu* pVclMenu = comphelper::getFromUnoTunnel<VCLXMenu>( m_xPopupMenu )->GetMenu(); aURL = pVclMenu->GetItemCommand( m_nMenuId ); MenuAttributes* pMenuAttributes( static_cast<MenuAttributes*>( pVclMenu->GetUserValue( m_nMenuId ) ) ); diff --git a/framework/source/uielement/recentfilesmenucontroller.cxx b/framework/source/uielement/recentfilesmenucontroller.cxx index 9bf31b03c16c..87701f8b9ba6 100644 --- a/framework/source/uielement/recentfilesmenucontroller.cxx +++ b/framework/source/uielement/recentfilesmenucontroller.cxx @@ -118,7 +118,7 @@ RecentFilesMenuController::RecentFilesMenuController( const uno::Reference< uno: // private function void RecentFilesMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu > const & rPopupMenu ) { - VCLXPopupMenu* pPopupMenu = static_cast<VCLXPopupMenu *>(comphelper::getUnoTunnelImplementation<VCLXMenu>( rPopupMenu )); + VCLXPopupMenu* pPopupMenu = static_cast<VCLXPopupMenu *>(comphelper::getFromUnoTunnel<VCLXMenu>( rPopupMenu )); PopupMenu* pVCLPopupMenu = nullptr; SolarMutexGuard aSolarMutexGuard; diff --git a/framework/source/uielement/resourcemenucontroller.cxx b/framework/source/uielement/resourcemenucontroller.cxx index 81bacc75ae70..6e83ca846977 100644 --- a/framework/source/uielement/resourcemenucontroller.cxx +++ b/framework/source/uielement/resourcemenucontroller.cxx @@ -225,7 +225,7 @@ void ResourceMenuController::updatePopupMenu() m_nNewMenuId = 1; // Now fill the menu with the configuration data. - framework::MenuBarManager::FillMenu( m_nNewMenuId, comphelper::getUnoTunnelImplementation<VCLXMenu>( m_xPopupMenu )->GetMenu(), m_aModuleName, m_xMenuContainer, m_xDispatchProvider ); + framework::MenuBarManager::FillMenu( m_nNewMenuId, comphelper::getFromUnoTunnel<VCLXMenu>( m_xPopupMenu )->GetMenu(), m_aModuleName, m_xMenuContainer, m_xDispatchProvider ); // For context menus, add object verbs. if ( !m_bContextMenu ) @@ -259,7 +259,7 @@ void ResourceMenuController::addVerbs( const css::uno::Sequence< css::embed::Ver xStorable.set( xController->getModel(), css::uno::UNO_QUERY ); bool bReadOnly = xStorable.is() && xStorable->isReadonly(); - VCLXMenu* pAwtMenu = comphelper::getUnoTunnelImplementation<VCLXMenu>( m_xPopupMenu ); + VCLXMenu* pAwtMenu = comphelper::getFromUnoTunnel<VCLXMenu>( m_xPopupMenu ); Menu* pVCLMenu = pAwtMenu->GetMenu(); for ( const auto& rVerb : rVerbs ) @@ -279,7 +279,7 @@ void ResourceMenuController::itemActivated( const css::awt::MenuEvent& /*rEvent* // Must initialize MenuBarManager here, because we want to let the app do context menu interception before. if ( !m_xMenuBarManager.is() ) { - VCLXMenu* pAwtMenu = comphelper::getUnoTunnelImplementation<VCLXMenu>( m_xPopupMenu ); + VCLXMenu* pAwtMenu = comphelper::getFromUnoTunnel<VCLXMenu>( m_xPopupMenu ); m_xMenuBarManager.set( new framework::MenuBarManager( m_xContext, m_xFrame, m_xURLTransformer, m_xDispatchProvider, m_aModuleName, pAwtMenu->GetMenu(), false, !m_bContextMenu && !m_bInToolbar ) ); m_xFrame->addFrameActionListener( m_xMenuBarManager ); @@ -387,7 +387,7 @@ SaveAsMenuController::SaveAsMenuController( const css::uno::Reference< css::uno: void SaveAsMenuController::impl_setPopupMenu() { - VCLXMenu* pPopupMenu = comphelper::getUnoTunnelImplementation<VCLXMenu>( m_xPopupMenu ); + VCLXMenu* pPopupMenu = comphelper::getFromUnoTunnel<VCLXMenu>( m_xPopupMenu ); Menu* pVCLPopupMenu = nullptr; SolarMutexGuard aGuard; @@ -475,7 +475,7 @@ void WindowListMenuController::itemActivated( const css::awt::MenuEvent& rEvent { SolarMutexGuard g; - VCLXMenu* pAwtMenu = comphelper::getUnoTunnelImplementation<VCLXMenu>( m_xPopupMenu ); + VCLXMenu* pAwtMenu = comphelper::getFromUnoTunnel<VCLXMenu>( m_xPopupMenu ); Menu* pVCLMenu = pAwtMenu->GetMenu(); int nItemCount = pVCLMenu->GetItemCount(); diff --git a/framework/source/uielement/thesaurusmenucontroller.cxx b/framework/source/uielement/thesaurusmenucontroller.cxx index 492da8593ac2..85500186c835 100644 --- a/framework/source/uielement/thesaurusmenucontroller.cxx +++ b/framework/source/uielement/thesaurusmenucontroller.cxx @@ -81,7 +81,7 @@ void ThesaurusMenuController::fillPopupMenu() css::lang::Locale aLocale = LanguageTag::convertToLocale( aIsoLang ); getMeanings( aSynonyms, aText, aLocale, 7 /*max number of synonyms to retrieve*/ ); - VCLXMenu* pAwtMenu = comphelper::getUnoTunnelImplementation<VCLXMenu>( m_xPopupMenu ); + VCLXMenu* pAwtMenu = comphelper::getFromUnoTunnel<VCLXMenu>( m_xPopupMenu ); Menu* pVCLMenu = pAwtMenu->GetMenu(); pVCLMenu->SetMenuFlags( MenuFlags::NoAutoMnemonics ); if ( aSynonyms.empty() ) diff --git a/framework/source/uielement/toolbarmodemenucontroller.cxx b/framework/source/uielement/toolbarmodemenucontroller.cxx index 296db7c1bf20..653f0c5a6cca 100644 --- a/framework/source/uielement/toolbarmodemenucontroller.cxx +++ b/framework/source/uielement/toolbarmodemenucontroller.cxx @@ -183,7 +183,7 @@ void SAL_CALL ToolbarModeMenuController::statusChanged( const FeatureStateEvent& return; SolarMutexGuard aGuard; - VCLXPopupMenu* pXPopupMenu = static_cast<VCLXPopupMenu *>(comphelper::getUnoTunnelImplementation<VCLXMenu>( xPopupMenu )); + VCLXPopupMenu* pXPopupMenu = static_cast<VCLXPopupMenu *>(comphelper::getFromUnoTunnel<VCLXMenu>( xPopupMenu )); PopupMenu* pVCLPopupMenu = pXPopupMenu ? static_cast<PopupMenu *>(pXPopupMenu->GetMenu()) : nullptr; SAL_WARN_IF(!pVCLPopupMenu, "fwk.uielement", "worrying lack of popup menu"); diff --git a/framework/source/uielement/toolbarsmenucontroller.cxx b/framework/source/uielement/toolbarsmenucontroller.cxx index 33f896781696..7806acb53443 100644 --- a/framework/source/uielement/toolbarsmenucontroller.cxx +++ b/framework/source/uielement/toolbarsmenucontroller.cxx @@ -190,7 +190,7 @@ void ToolbarsMenuController::addCommand( if ( rSettings.GetUseImagesInMenus() ) aImage = vcl::CommandInfoProvider::GetImageForCommand(rCommandURL, m_xFrame); - VCLXPopupMenu* pPopupMenu = static_cast<VCLXPopupMenu *>(comphelper::getUnoTunnelImplementation<VCLXMenu>( rPopupMenu )); + VCLXPopupMenu* pPopupMenu = static_cast<VCLXPopupMenu *>(comphelper::getFromUnoTunnel<VCLXMenu>( rPopupMenu )); if ( pPopupMenu ) { PopupMenu* pVCLPopupMenu = static_cast<PopupMenu *>(pPopupMenu->GetMenu()); @@ -404,7 +404,7 @@ void ToolbarsMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu > co { SolarMutexGuard aGuard; - VCLXPopupMenu* pXPopupMenu = static_cast<VCLXPopupMenu *>(comphelper::getUnoTunnelImplementation<VCLXMenu>( m_xPopupMenu )); + VCLXPopupMenu* pXPopupMenu = static_cast<VCLXPopupMenu *>(comphelper::getFromUnoTunnel<VCLXMenu>( m_xPopupMenu )); PopupMenu* pVCLPopupMenu = pXPopupMenu ? static_cast<PopupMenu *>(pXPopupMenu->GetMenu()) : nullptr; assert(pVCLPopupMenu); if (pVCLPopupMenu) @@ -498,7 +498,7 @@ void SAL_CALL ToolbarsMenuController::statusChanged( const FeatureStateEvent& Ev return; SolarMutexGuard aGuard; - VCLXPopupMenu* pXPopupMenu = static_cast<VCLXPopupMenu *>(comphelper::getUnoTunnelImplementation<VCLXMenu>( xPopupMenu )); + VCLXPopupMenu* pXPopupMenu = static_cast<VCLXPopupMenu *>(comphelper::getFromUnoTunnel<VCLXMenu>( xPopupMenu )); PopupMenu* pVCLPopupMenu = pXPopupMenu ? static_cast<PopupMenu *>(pXPopupMenu->GetMenu()) : nullptr; SAL_WARN_IF(!pVCLPopupMenu, "fwk.uielement", "worrying lack of popup menu"); @@ -557,7 +557,7 @@ void SAL_CALL ToolbarsMenuController::itemSelected( const css::awt::MenuEvent& r if ( !xPopupMenu.is() ) return; - VCLXPopupMenu* pPopupMenu = static_cast<VCLXPopupMenu *>(comphelper::getUnoTunnelImplementation<VCLXMenu>( xPopupMenu )); + VCLXPopupMenu* pPopupMenu = static_cast<VCLXPopupMenu *>(comphelper::getFromUnoTunnel<VCLXMenu>( xPopupMenu )); if ( !pPopupMenu ) return; |