summaryrefslogtreecommitdiff
path: root/framework/source/dispatch/startmoduledispatcher.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-01-07 16:19:36 +0200
committerNoel Grandin <noel@peralex.com>2013-01-15 09:56:00 +0200
commite7018375cdf0e5e542631df9dee6023ff80b7840 (patch)
tree50879e1febe6555236be77e8eb956c113019cd8c /framework/source/dispatch/startmoduledispatcher.cxx
parent435989ad0616a36d03975096919721e8506f5516 (diff)
fdo#46808, Adapt frame::StartModule UNO service to new style
The service already existed, it just did not have an IDL file. Change-Id: I400551d34d074cc8cf36fad58badc921422a2efa
Diffstat (limited to 'framework/source/dispatch/startmoduledispatcher.cxx')
-rw-r--r--framework/source/dispatch/startmoduledispatcher.cxx25
1 files changed, 10 insertions, 15 deletions
diff --git a/framework/source/dispatch/startmoduledispatcher.cxx b/framework/source/dispatch/startmoduledispatcher.cxx
index ed7959d41116..d5a3d93d697a 100644
--- a/framework/source/dispatch/startmoduledispatcher.cxx
+++ b/framework/source/dispatch/startmoduledispatcher.cxx
@@ -32,6 +32,7 @@
#include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/frame/XController.hpp>
#include <com/sun/star/frame/CommandGroup.hpp>
+#include <com/sun/star/frame/StartModule.hpp>
#include <com/sun/star/awt/XTopWindow.hpp>
#include "com/sun/star/beans/XFastPropertySet.hpp"
#include <com/sun/star/frame/XModuleManager.hpp>
@@ -67,12 +68,12 @@ DEFINE_XTYPEPROVIDER_4(StartModuleDispatcher ,
css::frame::XDispatch )
//-----------------------------------------------
-StartModuleDispatcher::StartModuleDispatcher(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR ,
+StartModuleDispatcher::StartModuleDispatcher(const css::uno::Reference< css::uno::XComponentContext >& rxContext,
const css::uno::Reference< css::frame::XFrame >& xFrame ,
const ::rtl::OUString& sTarget)
: ThreadHelpBase (&Application::GetSolarMutex() )
, ::cppu::OWeakObject( )
- , m_xSMGR (xSMGR )
+ , m_xContext (rxContext )
, m_xOwner (xFrame )
, m_sDispatchTarget (sTarget )
, m_lStatusListener (m_aLock.getShareableOslMutex())
@@ -148,12 +149,12 @@ void SAL_CALL StartModuleDispatcher::removeStatusListener(const css::uno::Refere
// SAFE -> ----------------------------------
ReadGuard aReadLock(m_aLock);
- css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR;
+ css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
aReadLock.unlock();
// <- SAFE ----------------------------------
css::uno::Reference< css::frame::XFramesSupplier > xDesktop(
- css::frame::Desktop::create( comphelper::getComponentContext(xSMGR) ), css::uno::UNO_QUERY);
+ css::frame::Desktop::create( xContext ), css::uno::UNO_QUERY);
FrameListAnalyzer aCheck(
xDesktop,
@@ -179,21 +180,15 @@ void SAL_CALL StartModuleDispatcher::removeStatusListener(const css::uno::Refere
{
// SAFE -> ----------------------------------
ReadGuard aReadLock(m_aLock);
- css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR;
+ css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
aReadLock.unlock();
// <- SAFE ----------------------------------
- css::uno::Reference< css::frame::XDesktop2> xDesktop = css::frame::Desktop::create( comphelper::getComponentContext(xSMGR) );
- css::uno::Reference< css::frame::XFrame > xFrame = xDesktop->findFrame (SPECIALTARGET_BLANK, 0);
- css::uno::Reference< css::awt::XWindow > xContainerWindow = xFrame->getContainerWindow ();
-
- css::uno::Sequence< css::uno::Any > lArgs(1);
- lArgs[0] <<= xContainerWindow;
-
- css::uno::Reference< css::frame::XController > xStartModule(
- xSMGR->createInstanceWithArguments(SERVICENAME_STARTMODULE, lArgs),
- css::uno::UNO_QUERY_THROW);
+ css::uno::Reference< css::frame::XDesktop2> xDesktop = css::frame::Desktop::create( xContext );
+ css::uno::Reference< css::frame::XFrame > xFrame = xDesktop->findFrame(SPECIALTARGET_BLANK, 0);
+ css::uno::Reference< css::awt::XWindow > xContainerWindow = xFrame->getContainerWindow();
+ css::uno::Reference< css::frame::XController > xStartModule = css::frame::StartModule::createWithParentWindow(xContext, xContainerWindow);
css::uno::Reference< css::awt::XWindow > xComponentWindow(xStartModule, css::uno::UNO_QUERY);
xFrame->setComponent(xComponentWindow, xStartModule);
xStartModule->attachFrame(xFrame);