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 /dbaccess | |
parent | 10362695c2060f6aa48bd88f6b8dd6cfa556392a (diff) |
fdo#46808, Adapt UICommandDescription UNO service to new style
Change-Id: Ibca112904f137ff981ae9be3e5bd56aa11aec352
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/ui/control/opendoccontrols.cxx | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/dbaccess/source/ui/control/opendoccontrols.cxx b/dbaccess/source/ui/control/opendoccontrols.cxx index 750289b5a4d7..693c02b19e67 100644 --- a/dbaccess/source/ui/control/opendoccontrols.cxx +++ b/dbaccess/source/ui/control/opendoccontrols.cxx @@ -25,6 +25,7 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/ui/ModuleUIConfigurationManagerSupplier.hpp> +#include <com/sun/star/ui/UICommandDescription.hpp> #include <com/sun/star/ui/XUIConfigurationManager.hpp> #include <com/sun/star/graphic/XGraphic.hpp> #include <com/sun/star/ui/XImageManager.hpp> @@ -49,6 +50,7 @@ namespace dbaui using ::com::sun::star::uno::Exception; using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::UNO_QUERY_THROW; + using ::com::sun::star::uno::XComponentContext; using ::com::sun::star::container::XNameAccess; using ::com::sun::star::lang::XMultiServiceFactory; using ::com::sun::star::beans::PropertyValue; @@ -56,6 +58,7 @@ namespace dbaui using ::com::sun::star::ui::XModuleUIConfigurationManagerSupplier; using ::com::sun::star::ui::XUIConfigurationManager; using ::com::sun::star::ui::XImageManager; + using ::com::sun::star::ui::UICommandDescription; using ::com::sun::star::graphic::XGraphic; String GetCommandText( const sal_Char* _pCommandURL, const ::rtl::OUString& _rModuleName ) @@ -72,16 +75,11 @@ namespace dbaui do { // Retrieve popup menu labels - Reference< XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() ); - if ( !xFactory.is() ) + Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); + if ( !xContext.is() ) break; - Reference< XNameAccess> xNameAccess; - xNameAccess = xNameAccess.query( xFactory->createInstance( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.UICommandDescription" ) ) - ) ); - if ( !xNameAccess.is() ) - break; + Reference< XNameAccess> xNameAccess( UICommandDescription::create(xContext) ); xNameAccess->getByName( _rModuleName ) >>= xUICommandLabels; if ( !xUICommandLabels.is() ) |