summaryrefslogtreecommitdiff
path: root/sfx2/source/sidebar/ControllerFactory.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-05-31 09:54:28 +0200
committerNoel Grandin <noel@peralex.com>2013-06-03 10:00:01 +0200
commite6c13f2846c684410e060701cbf1deb9bcaec890 (patch)
tree7c18df0ad2de8297cff389c091714b3eedd92621 /sfx2/source/sidebar/ControllerFactory.cxx
parent1f79707438d84ba639a2c601ae9d25c4647d37f6 (diff)
fdo#46808, Convert XMultiServiceFactory to XComponentContext
Change-Id: Ice5ec3a056f7f2f5184523bda1c709ccac876736
Diffstat (limited to 'sfx2/source/sidebar/ControllerFactory.cxx')
-rw-r--r--sfx2/source/sidebar/ControllerFactory.cxx14
1 files changed, 4 insertions, 10 deletions
diff --git a/sfx2/source/sidebar/ControllerFactory.cxx b/sfx2/source/sidebar/ControllerFactory.cxx
index 4702c898fb9e..0c9d7217b735 100644
--- a/sfx2/source/sidebar/ControllerFactory.cxx
+++ b/sfx2/source/sidebar/ControllerFactory.cxx
@@ -22,7 +22,7 @@
#include <com/sun/star/frame/XToolbarController.hpp>
#include <com/sun/star/frame/XFrame.hpp>
-#include <com/sun/star/frame/XUIControllerFactory.hpp>
+#include <com/sun/star/frame/ToolbarControllerFactory.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <framework/sfxhelperfunctions.hxx>
@@ -145,9 +145,8 @@ Reference<frame::XToolbarController> ControllerFactory::CreateToolBarController(
{
try
{
- Reference<frame::XUIControllerFactory> xFactory (
- comphelper::getProcessServiceFactory()->createInstance(A2S("com.sun.star.frame.ToolbarControllerFactory")),
- UNO_QUERY);
+ Reference<XComponentContext> xContext = comphelper::getProcessComponentContext();
+ Reference<frame::XUIControllerFactory> xFactory = frame::ToolbarControllerFactory::create( xContext );
OUString sModuleName (Tools::GetModuleName(rxFrame));
if (xFactory.is() && xFactory->hasController(rsCommandName, sModuleName))
@@ -178,17 +177,12 @@ Reference<frame::XToolbarController> ControllerFactory::CreateToolBarController(
aPropertyVector.push_back( makeAny( aPropValue ));
}
- Reference<beans::XPropertySet> xFactoryProperties (comphelper::getProcessServiceFactory(), UNO_QUERY);
- Reference<XComponentContext > xComponentContext;
- if (xFactoryProperties.is())
- xFactoryProperties->getPropertyValue(A2S("DefaultContext")) >>= xComponentContext;
-
Sequence<Any> aArgs (comphelper::containerToSequence(aPropertyVector));
return Reference<frame::XToolbarController>(
xFactory->createInstanceWithArgumentsAndContext(
rsCommandName,
aArgs,
- xComponentContext),
+ xContext),
UNO_QUERY);
}
}