summaryrefslogtreecommitdiff
path: root/sfx2/source/dialog/templdlg.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sfx2/source/dialog/templdlg.cxx')
-rw-r--r--sfx2/source/dialog/templdlg.cxx16
1 files changed, 6 insertions, 10 deletions
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;