diff options
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/dialog/recfloat.cxx | 7 | ||||
-rw-r--r-- | sfx2/source/dialog/templdlg.cxx | 16 | ||||
-rw-r--r-- | sfx2/source/view/viewsh.cxx | 5 |
3 files changed, 12 insertions, 16 deletions
diff --git a/sfx2/source/dialog/recfloat.cxx b/sfx2/source/dialog/recfloat.cxx index 49690dab556d..a43b9fba17db 100644 --- a/sfx2/source/dialog/recfloat.cxx +++ b/sfx2/source/dialog/recfloat.cxx @@ -21,10 +21,12 @@ #include <com/sun/star/frame/XModuleManager.hpp> #include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/ui/UICommandDescription.hpp> #include <svl/eitem.hxx> #include <svtools/generictoolboxcontroller.hxx> #include <vcl/msgbox.hxx> +#include <comphelper/componentcontext.hxx> #include <comphelper/processfactory.hxx> #include "recfloat.hxx" @@ -63,10 +65,7 @@ static rtl::OUString GetLabelFromCommandURL( const rtl::OUString& rCommandURL, c if ( !xUICommandDescription.is() ) { xUICommandDescription = uno::Reference< container::XNameAccess >( - xServiceManager->createInstance( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.frame.UICommandDescription" ))), - uno::UNO_QUERY ); + ui::UICommandDescription::create(comphelper::ComponentContext(xServiceManager).getUNOContext()) ); xTmpNameAccess = xUICommandDescription; } diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index 3982e2e3f24b..307bcb464071 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -31,6 +31,7 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/frame/XModuleManager.hpp> +#include <com/sun/star/ui/UICommandDescription.hpp> #include "sfx2/sfxhelp.hxx" #include <sfx2/app.hxx> @@ -2542,18 +2543,13 @@ IMPL_LINK( SfxTemplateDialog_Impl, ToolBoxRClick, ToolBox *, pBox ) //create a popup menu in Writer boost::scoped_ptr<PopupMenu> pMenu(new PopupMenu); uno::Reference< container::XNameAccess > xNameAccess( - ::comphelper::getProcessServiceFactory()-> - createInstance( ::rtl::OUString( - "com.sun.star.frame.UICommandDescription") ), uno::UNO_QUERY ); + ui::UICommandDescription::create(::comphelper::getProcessComponentContext()) ); uno::Reference< container::XNameAccess > xUICommands; - if ( xNameAccess.is() ) + rtl::OUString sTextDoc("com.sun.star.text.TextDocument"); + if(xNameAccess->hasByName(sTextDoc)) { - rtl::OUString sTextDoc("com.sun.star.text.TextDocument"); - if(xNameAccess->hasByName(sTextDoc)) - { - uno::Any a = xNameAccess->getByName( sTextDoc ); - a >>= xUICommands; - } + uno::Any a = xNameAccess->getByName( sTextDoc ); + a >>= xUICommands; } if(!xUICommands.is()) return 0; diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index e1d0210c70e5..e33d59c168d4 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -33,6 +33,8 @@ #include <com/sun/star/container/XContainerQuery.hpp> #include <com/sun/star/frame/XStorable.hpp> #include <com/sun/star/datatransfer/clipboard/XClipboard.hpp> +#include <com/sun/star/ui/UICommandDescription.hpp> +#include <comphelper/componentcontext.hxx> #include <cppuhelper/implbase1.hxx> #include <osl/file.hxx> @@ -247,8 +249,7 @@ static ::rtl::OUString RetrieveLabelFromCommand( if ( !xNameAccess.is() ) { xNameAccess = css::uno::Reference< css::container::XNameAccess >( - xSMGR->createInstance( - ::rtl::OUString( "com.sun.star.frame.UICommandDescription" )), + css::ui::UICommandDescription::create(comphelper::ComponentContext(xSMGR).getUNOContext()), css::uno::UNO_QUERY_THROW ); s_xNameAccess = xNameAccess; } |