diff options
Diffstat (limited to 'cui/source')
-rw-r--r-- | cui/source/customize/acccfg.cxx | 8 | ||||
-rw-r--r-- | cui/source/customize/cfg.cxx | 52 | ||||
-rw-r--r-- | cui/source/customize/cfgutil.cxx | 4 | ||||
-rw-r--r-- | cui/source/customize/selector.cxx | 4 | ||||
-rw-r--r-- | cui/source/dialogs/scriptdlg.cxx | 4 | ||||
-rw-r--r-- | cui/source/options/treeopt.cxx | 2 |
6 files changed, 32 insertions, 42 deletions
diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx index c12a91a21ae5..957eb381670f 100644 --- a/cui/source/customize/acccfg.cxx +++ b/cui/source/customize/acccfg.cxx @@ -864,12 +864,10 @@ void SfxAcceleratorConfigPage::InitAccCfg() } // identify module - css::uno::Reference< css::frame::XModuleManager > xModuleManager( - css::frame::ModuleManager::create(comphelper::ComponentContext(m_xSMGR).getUNOContext()), - css::uno::UNO_QUERY_THROW); - css::uno::Reference< css::container::XNameAccess > xModuleManagerCont(xModuleManager , css::uno::UNO_QUERY_THROW); + css::uno::Reference< css::frame::XModuleManager2 > xModuleManager( + css::frame::ModuleManager::create(comphelper::ComponentContext(m_xSMGR).getUNOContext())); m_sModuleLongName = xModuleManager->identify(m_xFrame); - ::comphelper::SequenceAsHashMap lModuleProps(xModuleManagerCont->getByName(m_sModuleLongName)); + ::comphelper::SequenceAsHashMap lModuleProps(xModuleManager->getByName(m_sModuleLongName)); m_sModuleShortName = lModuleProps.getUnpackedValueOrDefault(MODULEPROP_SHORTNAME, ::rtl::OUString()); m_sModuleUIName = lModuleProps.getUnpackedValueOrDefault(MODULEPROP_UINAME , ::rtl::OUString()); diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index 4340091b642c..0a0e70611516 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -26,6 +26,9 @@ * ************************************************************************/ +#include "sal/config.h" + +#include <cassert> #include <stdlib.h> #include <time.h> @@ -447,41 +450,36 @@ OUString GetModuleName( const OUString& aModuleId ) return ::rtl::OUString(); } -OUString GetUIModuleName( const OUString& aModuleId, const uno::Reference< css::frame::XModuleManager >& rModuleManager ) +OUString GetUIModuleName( const OUString& aModuleId, const uno::Reference< css::frame::XModuleManager2 >& rModuleManager ) { + assert(rModuleManager.is()); + OUString aModuleUIName; - if ( rModuleManager.is() ) + try { - uno::Reference< css::container::XNameAccess > xNameAccess( rModuleManager, uno::UNO_QUERY ); - if ( xNameAccess.is() ) + uno::Any a = rModuleManager->getByName( aModuleId ); + uno::Sequence< beans::PropertyValue > aSeq; + + if ( a >>= aSeq ) { - try + for ( sal_Int32 i = 0; i < aSeq.getLength(); ++i ) { - uno::Any a = xNameAccess->getByName( aModuleId ); - uno::Sequence< beans::PropertyValue > aSeq; - - if ( a >>= aSeq ) + if ( aSeq[i].Name == "ooSetupFactoryUIName" ) { - for ( sal_Int32 i = 0; i < aSeq.getLength(); ++i ) - { - if ( aSeq[i].Name == "ooSetupFactoryUIName" ) - { - aSeq[i].Value >>= aModuleUIName; - break; - } - } + aSeq[i].Value >>= aModuleUIName; + break; } } - catch ( uno::RuntimeException& ) - { - throw; - } - catch ( uno::Exception& ) - { - } } } + catch ( uno::RuntimeException& ) + { + throw; + } + catch ( uno::Exception& ) + { + } if ( aModuleUIName.isEmpty() ) aModuleUIName = GetModuleName( aModuleId ); @@ -777,7 +775,7 @@ sal_Bool impl_showKeyConfigTabPage( const css::uno::Reference< css::frame::XFram css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory(); css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); css::uno::Reference< css::frame::XFramesSupplier > xDesktop(xSMGR->createInstance(SERVICENAME_DESKTOP), css::uno::UNO_QUERY_THROW); - css::uno::Reference< css::frame::XModuleManager > xMM (css::frame::ModuleManager::create(xContext), css::uno::UNO_QUERY_THROW); + css::uno::Reference< css::frame::XModuleManager2 > xMM (css::frame::ModuleManager::create(xContext)); if (xFrame.is()) { @@ -1672,8 +1670,8 @@ void SvxConfigPage::Reset( const SfxItemSet& ) OUString aModuleId = GetFrameWithDefaultAndIdentify( m_xFrame ); // replace %MODULENAME in the label with the correct module name - uno::Reference< css::frame::XModuleManager > xModuleManager( - css::frame::ModuleManager::create( xContext ), uno::UNO_QUERY_THROW); + uno::Reference< css::frame::XModuleManager2 > xModuleManager( + css::frame::ModuleManager::create( xContext )); OUString aModuleName = GetUIModuleName( aModuleId, xModuleManager ); OUString title = aTopLevelSeparator.GetText(); diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx index 4b12b50b30eb..44cd36bebcbf 100644 --- a/cui/source/customize/cfgutil.cxx +++ b/cui/source/customize/cfgutil.cxx @@ -767,13 +767,11 @@ Image SfxConfigGroupListBox_Impl::GetImage( if ( xDocumentModel.is() ) { Reference< frame::XModuleManager2 > xModuleManager( frame::ModuleManager::create(xCtx) ); - Reference<container::XNameAccess> xModuleConfig( - xModuleManager, UNO_QUERY_THROW ); // get the long name of the document: ::rtl::OUString appModule( xModuleManager->identify( xDocumentModel ) ); Sequence<beans::PropertyValue> moduleDescr; - Any aAny = xModuleConfig->getByName(appModule); + Any aAny = xModuleManager->getByName(appModule); if( sal_True != ( aAny >>= moduleDescr ) ) { throw RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SFTreeListBox::Init: failed to get PropertyValue") ), Reference< XInterface >()); diff --git a/cui/source/customize/selector.cxx b/cui/source/customize/selector.cxx index 67bc1bfaa947..8ccafd287706 100644 --- a/cui/source/customize/selector.cxx +++ b/cui/source/customize/selector.cxx @@ -567,13 +567,11 @@ Image SvxConfigGroupListBox_Impl::GetImage( if ( xDocumentModel.is() ) { Reference< frame::XModuleManager2 > xModuleManager( frame::ModuleManager::create(xCtx) ); - Reference<container::XNameAccess> xModuleConfig( - xModuleManager, UNO_QUERY_THROW ); // get the long name of the document: OUString appModule( xModuleManager->identify( xDocumentModel ) ); Sequence<beans::PropertyValue> moduleDescr; - Any aAny = xModuleConfig->getByName(appModule); + Any aAny = xModuleManager->getByName(appModule); if( sal_True != ( aAny >>= moduleDescr ) ) { throw RuntimeException(OUString(RTL_CONSTASCII_USTRINGPARAM("SFTreeListBox::Init: failed to get PropertyValue")), Reference< XInterface >()); diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx index ebd3676a4f7d..2c7b1544dd74 100644 --- a/cui/source/dialogs/scriptdlg.cxx +++ b/cui/source/dialogs/scriptdlg.cxx @@ -226,13 +226,11 @@ void SFTreeListBox::Init( const ::rtl::OUString& language ) { Reference< frame::XModuleManager2 > xModuleManager( frame::ModuleManager::create(xCtx) ); - Reference<container::XNameAccess> xModuleConfig( - xModuleManager, UNO_QUERY_THROW ); // get the long name of the document: Sequence<beans::PropertyValue> moduleDescr; try{ ::rtl::OUString appModule = xModuleManager->identify( xDocumentModel ); - xModuleConfig->getByName(appModule) >>= moduleDescr; + xModuleManager->getByName(appModule) >>= moduleDescr; } catch(const uno::Exception&) {} diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx index 16bfa7f434d2..c40bfdae7541 100644 --- a/cui/source/options/treeopt.cxx +++ b/cui/source/options/treeopt.cxx @@ -1955,7 +1955,7 @@ rtl::OUString OfaTreeOptionsDialog::GetModuleIdentifier( xCurrentFrame = xDesktop->getCurrentFrame(); } - if ( xCurrentFrame.is() && xModuleManager.is() ) + if ( xCurrentFrame.is() ) { try { |