diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-11-25 12:15:58 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-11-27 09:59:27 +0100 |
commit | e84acb8c5829775cb9d5d1115bbcb1b61bd260ee (patch) | |
tree | 2b548068400dcadd7de6ea9d5644e60839697db6 /cui/source/customize | |
parent | c30dde552ad6420a655fd9f440fd68bff556d19a (diff) |
tdf#126043 identify the frame module just once
Change-Id: I7f68cf67838bb08672975e7a38cf213022e39ed8
Reviewed-on: https://gerrit.libreoffice.org/83672
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit 6e6233a5d0940e5bbdb346142091b0ae2e54e640)
Reviewed-on: https://gerrit.libreoffice.org/83832
Diffstat (limited to 'cui/source/customize')
-rw-r--r-- | cui/source/customize/cfg.cxx | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index 277ce523867a..1cb922bc51c6 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -1040,12 +1040,12 @@ void SvxConfigPage::Reset( const SfxItemSet* ) ::comphelper::getProcessComponentContext(), uno::UNO_SET_THROW ); m_xFrame = GetFrame(); - OUString aModuleId = GetFrameWithDefaultAndIdentify( m_xFrame ); + m_aModuleId = GetFrameWithDefaultAndIdentify( m_xFrame ); // replace %MODULENAME in the label with the correct module name uno::Reference< css::frame::XModuleManager2 > xModuleManager( css::frame::ModuleManager::create( xContext )); - OUString aModuleName = SvxConfigPageHelper::GetUIModuleName( aModuleId, xModuleManager ); + OUString aModuleName = SvxConfigPageHelper::GetUIModuleName( m_aModuleId, xModuleManager ); uno::Reference< css::ui::XModuleUIConfigurationManagerSupplier > xModuleCfgSupplier( css::ui::theModuleUIConfigurationManagerSupplier::get(xContext) ); @@ -1056,11 +1056,11 @@ void SvxConfigPage::Reset( const SfxItemSet* ) try { xCfgMgr = - xModuleCfgSupplier->getUIConfigurationManager( aModuleId ); + xModuleCfgSupplier->getUIConfigurationManager( m_aModuleId ); pModuleData = CreateSaveInData( xCfgMgr, uno::Reference< css::ui::XUIConfigurationManager >(), - aModuleId, + m_aModuleId, false ); } catch ( container::NoSuchElementException& ) @@ -1077,7 +1077,7 @@ void SvxConfigPage::Reset( const SfxItemSet* ) OUString aTitle; uno::Reference< frame::XController > xController = m_xFrame->getController(); - if ( CanConfig( aModuleId ) && xController.is() ) + if ( CanConfig( m_aModuleId ) && xController.is() ) { uno::Reference< frame::XModel > xModel( xController->getModel() ); if ( xModel.is() ) @@ -1096,7 +1096,7 @@ void SvxConfigPage::Reset( const SfxItemSet* ) SaveInData* pDocData = nullptr; if ( xDocCfgMgr.is() ) { - pDocData = CreateSaveInData( xDocCfgMgr, xCfgMgr, aModuleId, true ); + pDocData = CreateSaveInData( xDocCfgMgr, xCfgMgr, m_aModuleId, true ); if ( !pDocData->IsReadOnly() ) { @@ -1144,7 +1144,7 @@ void SvxConfigPage::Reset( const SfxItemSet* ) DBG_ASSERT( pCurrentSaveInData, "SvxConfigPage::Reset(): no SaveInData" ); #endif - if ( CanConfig( aModuleId ) ) + if ( CanConfig( m_aModuleId ) ) { // Load configuration for other open documents which have // same module type @@ -1178,7 +1178,7 @@ void SvxConfigPage::Reset( const SfxItemSet* ) } catch(const uno::Exception&) { aCheckId.clear(); } - if ( aModuleId == aCheckId ) + if ( m_aModuleId == aCheckId ) { // try to get the document based ui configuration manager OUString aTitle2; @@ -1207,7 +1207,7 @@ void SvxConfigPage::Reset( const SfxItemSet* ) if ( xDocCfgMgr.is() ) { - SaveInData* pData = CreateSaveInData( xDocCfgMgr, xCfgMgr, aModuleId, true ); + SaveInData* pData = CreateSaveInData( xDocCfgMgr, xCfgMgr, m_aModuleId, true ); if ( pData && !pData->IsReadOnly() ) { @@ -1406,9 +1406,8 @@ int SvxConfigPage::AddFunction(int nTarget, bool bAllowDuplicates) } OUString aDisplayName; - OUString aModuleId = vcl::CommandInfoProvider::GetModuleIdentifier( m_xFrame ); - auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(aURL, aModuleId); + auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(aURL, m_aModuleId); if ( typeid(*pCurrentSaveInData) == typeid(ContextMenuSaveInData) ) aDisplayName = vcl::CommandInfoProvider::GetPopupLabelForCommand(aProperties); |