diff options
author | Noel Grandin <noel@peralex.com> | 2012-08-23 18:06:05 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-09-03 15:55:03 +0200 |
commit | 7a464263cc5c2ca2b7128734ff4860e02d662818 (patch) | |
tree | 4614aa57736484cb46c8702f6afee1c2e663e8a0 /svtools | |
parent | 10362695c2060f6aa48bd88f6b8dd6cfa556392a (diff) |
fdo#46808, Adapt UICommandDescription UNO service to new style
Change-Id: Ibca112904f137ff981ae9be3e5bd56aa11aec352
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/uno/contextmenuhelper.cxx | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/svtools/source/uno/contextmenuhelper.cxx b/svtools/source/uno/contextmenuhelper.cxx index 3942760e5a4c..8e28720798ef 100644 --- a/svtools/source/uno/contextmenuhelper.cxx +++ b/svtools/source/uno/contextmenuhelper.cxx @@ -40,6 +40,7 @@ #include <com/sun/star/ui/XUIConfigurationManager.hpp> #include <com/sun/star/ui/ModuleUIConfigurationManagerSupplier.hpp> #include <com/sun/star/ui/ImageType.hpp> +#include <com/sun/star/ui/UICommandDescription.hpp> #include <com/sun/star/util/URLTransformer.hpp> #include <com/sun/star/beans/PropertyValue.hpp> @@ -442,20 +443,15 @@ ContextMenuHelper::associateUIConfigurationManagers() } uno::Reference< container::XNameAccess > xNameAccess( - ::comphelper::getProcessServiceFactory()->createInstance( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.frame.UICommandDescription" ))), - uno::UNO_QUERY ); - if ( xNameAccess.is() ) + ui::UICommandDescription::create(::comphelper::getProcessComponentContext()), + uno::UNO_QUERY_THROW ); + try + { + uno::Any a = xNameAccess->getByName( aModuleId ); + a >>= m_xUICommandLabels; + } + catch ( container::NoSuchElementException& ) { - try - { - uno::Any a = xNameAccess->getByName( aModuleId ); - a >>= m_xUICommandLabels; - } - catch ( container::NoSuchElementException& ) - { - } } } catch ( uno::RuntimeException& ) |