summaryrefslogtreecommitdiff
path: root/cui/source
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-08-23 18:06:05 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-09-03 15:55:03 +0200
commit7a464263cc5c2ca2b7128734ff4860e02d662818 (patch)
tree4614aa57736484cb46c8702f6afee1c2e663e8a0 /cui/source
parent10362695c2060f6aa48bd88f6b8dd6cfa556392a (diff)
fdo#46808, Adapt UICommandDescription UNO service to new style
Change-Id: Ibca112904f137ff981ae9be3e5bd56aa11aec352
Diffstat (limited to 'cui/source')
-rw-r--r--cui/source/customize/acccfg.cxx5
-rw-r--r--cui/source/customize/cfg.cxx8
-rw-r--r--cui/source/customize/cfgutil.cxx5
-rw-r--r--cui/source/customize/selector.cxx14
4 files changed, 11 insertions, 21 deletions
diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx
index eafc26afacd8..84e0eeaac69d 100644
--- a/cui/source/customize/acccfg.cxx
+++ b/cui/source/customize/acccfg.cxx
@@ -56,7 +56,7 @@
#include <com/sun/star/form/XReset.hpp>
#include <com/sun/star/ui/ModuleUIConfigurationManagerSupplier.hpp>
#include <com/sun/star/frame/XModuleManager.hpp>
-
+#include <com/sun/star/ui/UICommandDescription.hpp>
#include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp>
#include <com/sun/star/ui/XUIConfigurationManager.hpp>
#include <com/sun/star/awt/KeyModifier.hpp>
@@ -94,7 +94,6 @@ static ::rtl::OUString SERVICE_UICONFIGMGR (RTL_CONSTASCII_USTRINGP
static ::rtl::OUString SERVICE_DESKTOP (RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop" ));
static ::rtl::OUString SERVICE_MODULEMANAGER (RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.ModuleManager" ));
static ::rtl::OUString SERVICE_GLOBALACCCFG (RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.GlobalAcceleratorConfiguration" ));
-static ::rtl::OUString SERVICE_UICMDDESCRIPTION (RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.UICommandDescription" ));
static ::rtl::OUString MODULEPROP_SHORTNAME (RTL_CONSTASCII_USTRINGPARAM("ooSetupFactoryShortName" ));
static ::rtl::OUString MODULEPROP_UINAME (RTL_CONSTASCII_USTRINGPARAM("ooSetupFactoryUIName" ));
@@ -854,7 +853,7 @@ void SfxAcceleratorConfigPage::InitAccCfg()
// no - initialize this instance
m_xSMGR = ::comphelper::getProcessServiceFactory();
- m_xUICmdDescription = css::uno::Reference< css::container::XNameAccess >(m_xSMGR->createInstance(SERVICE_UICMDDESCRIPTION), css::uno::UNO_QUERY_THROW);
+ m_xUICmdDescription = css::ui::UICommandDescription::create(comphelper::ComponentContext(m_xSMGR).getUNOContext());
// get the current active frame, which should be our "parent"
// for this session
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index 325689946a1b..e3b896aec6ee 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -71,6 +71,7 @@
#include <com/sun/star/ui/ModuleUIConfigurationManagerSupplier.hpp>
#include <com/sun/star/frame/XController.hpp>
#include <com/sun/star/frame/XDesktop.hpp>
+#include <com/sun/star/ui/UICommandDescription.hpp>
#include <com/sun/star/ui/XUIConfiguration.hpp>
#include <com/sun/star/ui/XUIConfigurationListener.hpp>
#include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp>
@@ -914,12 +915,9 @@ SaveInData::SaveInData(
::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
uno::Reference< container::XNameAccess > xNameAccess(
- m_xServiceManager->createInstance(
- OUString( "com.sun.star.frame.UICommandDescription" ) ),
- uno::UNO_QUERY );
+ css::ui::UICommandDescription::create(comphelper::ComponentContext(m_xServiceManager).getUNOContext()) );
- if ( xNameAccess.is() )
- xNameAccess->getByName( aModuleId ) >>= m_xCommandToLabelMap;
+ xNameAccess->getByName( aModuleId ) >>= m_xCommandToLabelMap;
if ( !m_xImgMgr.is() )
{
diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx
index e7f95a581b8c..86be792d8a39 100644
--- a/cui/source/customize/cfgutil.cxx
+++ b/cui/source/customize/cfgutil.cxx
@@ -45,6 +45,7 @@
#include <com/sun/star/document/XDocumentInfoSupplier.hpp>
#include <com/sun/star/document/XScriptInvocationContext.hpp>
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
+#include <com/sun/star/ui/UICommandDescription.hpp>
#include "acccfg.hrc"
#include "helpid.hrc"
@@ -58,6 +59,7 @@
#include "cuires.hrc"
#include <sfx2/app.hxx>
#include <sfx2/minfitem.hxx>
+#include <comphelper/componentcontext.hxx>
#include <comphelper/documentinfo.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/sequenceashashmap.hxx>
@@ -76,7 +78,6 @@ using namespace ::com::sun::star::document;
namespace css = ::com::sun::star;
static ::rtl::OUString SERVICE_UICATEGORYDESCRIPTION (RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.UICategoryDescription") );
-static ::rtl::OUString SERVICE_UICMDDESCRIPTION (RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.UICommandDescription") );
SfxStylesInfo_Impl::SfxStylesInfo_Impl()
{}
@@ -585,7 +586,7 @@ void SfxConfigGroupListBox_Impl::Init(const css::uno::Reference< css::lang::XMul
m_xGlobalCategoryInfo = css::uno::Reference< css::container::XNameAccess >(m_xSMGR->createInstance(SERVICE_UICATEGORYDESCRIPTION), css::uno::UNO_QUERY_THROW);
m_xModuleCategoryInfo = css::uno::Reference< css::container::XNameAccess >(m_xGlobalCategoryInfo->getByName(m_sModuleLongName) , css::uno::UNO_QUERY_THROW);
- m_xUICmdDescription = css::uno::Reference< css::container::XNameAccess >(m_xSMGR->createInstance(SERVICE_UICMDDESCRIPTION) , css::uno::UNO_QUERY_THROW);
+ m_xUICmdDescription = css::ui::UICommandDescription::create(::comphelper::ComponentContext(m_xSMGR).getUNOContext());
InitModule();
InitBasic();
diff --git a/cui/source/customize/selector.cxx b/cui/source/customize/selector.cxx
index f58aa45d3352..1da7e337b0bf 100644
--- a/cui/source/customize/selector.cxx
+++ b/cui/source/customize/selector.cxx
@@ -62,6 +62,7 @@
#include <com/sun/star/frame/XDispatchInformationProvider.hpp>
#include <com/sun/star/frame/DispatchInformation.hpp>
#include <com/sun/star/container/XChild.hpp>
+#include <com/sun/star/ui/UICommandDescription.hpp>
using ::rtl::OUString;
using namespace ::com::sun::star;
@@ -429,17 +430,8 @@ void SvxConfigGroupListBox_Impl::Init()
}catch(const uno::Exception&)
{ aModuleId = ::rtl::OUString(); }
- Reference< container::XNameAccess > xNameAccess(
- xMCF->createInstanceWithContext(
- OUString(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.frame.UICommandDescription" )),
- xContext ),
- UNO_QUERY );
-
- if ( xNameAccess.is() )
- {
- xNameAccess->getByName( aModuleId ) >>= m_xModuleCommands;
- }
+ Reference< container::XNameAccess > xNameAccess( ui::UICommandDescription::create(xContext) );
+ xNameAccess->getByName( aModuleId ) >>= m_xModuleCommands;
Reference< container::XNameAccess > xAllCategories(
xMCF->createInstanceWithContext(