summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-11-25 12:15:58 +0000
committerCaolán McNamara <caolanm@redhat.com>2019-11-26 13:52:21 +0100
commit6e6233a5d0940e5bbdb346142091b0ae2e54e640 (patch)
treeb75498df9c873a7f7b650979d60026e3c3b023d6
parent9426162a3b24732167e4fa7aa2fa6ee19d33e7e9 (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>
-rw-r--r--cui/source/customize/cfg.cxx21
-rw-r--r--cui/source/inc/cfg.hxx1
2 files changed, 11 insertions, 11 deletions
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index e47bb5d4bf7f..30dd22c71325 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);
diff --git a/cui/source/inc/cfg.hxx b/cui/source/inc/cfg.hxx
index 0cd522354124..80b0e29d009b 100644
--- a/cui/source/inc/cfg.hxx
+++ b/cui/source/inc/cfg.hxx
@@ -381,6 +381,7 @@ protected:
OUString m_aURLToSelect;
css::uno::Reference< css::frame::XFrame > m_xFrame;
+ OUString m_aModuleId;
// Left side of the dialog where command categories and the available
// commands in them are displayed as a searchable list