[Libreoffice-commits] core.git: 8 commits - basctl/source basic/source cui/source extensions/source filter/source framework/inc framework/source include/sfx2 include/toolkit offapi/com offapi/type_reference offapi/UnoApi_offapi.mk scripting/source sc/source sdext/source sfx2/source svtools/source xmlscript/test

Noel Grandin noel at peralex.com
Mon May 27 23:10:59 PDT 2013


 basctl/source/dlged/dlged.cxx                                          |   11 -
 basic/source/runtime/methods1.cxx                                      |    2 
 cui/source/customize/acccfg.cxx                                        |    2 
 extensions/source/update/check/updatehdl.cxx                           |   13 -
 filter/source/t602/t602filter.cxx                                      |   28 ---
 framework/inc/helper/persistentwindowstate.hxx                         |    4 
 framework/inc/helper/statusindicatorfactory.hxx                        |    4 
 framework/inc/helper/titlebarupdate.hxx                                |    6 
 framework/inc/helper/vclstatusindicator.hxx                            |    6 
 framework/inc/jobs/job.hxx                                             |    6 
 framework/inc/jobs/jobdispatch.hxx                                     |    4 
 framework/inc/jobs/jobexecutor.hxx                                     |    4 
 framework/inc/jobs/shelljob.hxx                                        |    6 
 framework/inc/recording/dispatchrecorder.hxx                           |    3 
 framework/inc/services.h                                               |    7 
 framework/inc/services/autorecovery.hxx                                |    4 
 framework/inc/services/backingcomp.hxx                                 |    5 
 framework/inc/services/frame.hxx                                       |    4 
 framework/inc/services/layoutmanager.hxx                               |   16 -
 framework/inc/uiconfiguration/moduleimagemanager.hxx                   |    2 
 framework/inc/uiconfiguration/moduleuiconfigurationmanager.hxx         |    8 
 framework/inc/uiconfiguration/uiconfigurationmanager.hxx               |    7 
 framework/source/accelerators/acceleratorconfiguration.cxx             |   34 +--
 framework/source/accelerators/documentacceleratorconfiguration.cxx     |   30 ++-
 framework/source/accelerators/globalacceleratorconfiguration.cxx       |   13 -
 framework/source/accelerators/moduleacceleratorconfiguration.cxx       |   27 +-
 framework/source/accelerators/presethandler.cxx                        |   18 -
 framework/source/classes/taskcreator.cxx                               |    4 
 framework/source/dispatch/dispatchinformationprovider.cxx              |    3 
 framework/source/dispatch/popupmenudispatcher.cxx                      |    2 
 framework/source/helper/persistentwindowstate.cxx                      |    6 
 framework/source/helper/statusindicatorfactory.cxx                     |   31 +--
 framework/source/helper/titlebarupdate.cxx                             |   13 -
 framework/source/helper/vclstatusindicator.cxx                         |    4 
 framework/source/inc/accelerators/acceleratorconfiguration.hxx         |    8 
 framework/source/inc/accelerators/documentacceleratorconfiguration.hxx |    2 
 framework/source/inc/accelerators/globalacceleratorconfiguration.hxx   |    2 
 framework/source/inc/accelerators/moduleacceleratorconfiguration.hxx   |    2 
 framework/source/inc/accelerators/presethandler.hxx                    |    6 
 framework/source/jobs/job.cxx                                          |   20 +-
 framework/source/jobs/jobdispatch.cxx                                  |   36 +--
 framework/source/jobs/jobexecutor.cxx                                  |   36 +--
 framework/source/jobs/shelljob.cxx                                     |   15 -
 framework/source/layoutmanager/layoutmanager.cxx                       |   45 ++--
 framework/source/recording/dispatchrecorder.cxx                        |    7 
 framework/source/services/autorecovery.cxx                             |   76 ++++----
 framework/source/services/backingcomp.cxx                              |   18 -
 framework/source/services/frame.cxx                                    |   52 ++---
 framework/source/services/taskcreatorsrv.cxx                           |    4 
 framework/source/uiconfiguration/moduleimagemanager.cxx                |    4 
 framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx      |   39 +---
 framework/source/uiconfiguration/uiconfigurationmanager.cxx            |   17 -
 framework/source/uielement/addonstoolbarmanager.cxx                    |    6 
 framework/source/uielement/menubarmanager.cxx                          |    4 
 framework/source/uielement/newmenucontroller.cxx                       |    4 
 framework/source/uielement/popupmenucontroller.cxx                     |    5 
 framework/source/uielement/toolbarmanager.cxx                          |    4 
 include/sfx2/sidebar/CommandInfoProvider.hxx                           |    4 
 include/toolkit/controls/dialogcontrol.hxx                             |   74 +++++++-
 offapi/UnoApi_offapi.mk                                                |    8 
 offapi/com/sun/star/awt/UnoControlDialog.idl                           |   20 --
 offapi/com/sun/star/awt/XUnoControlDialog.idl                          |   58 ++++++
 offapi/com/sun/star/frame/LayoutManager.idl                            |   53 -----
 offapi/com/sun/star/frame/XLayoutManager2.idl                          |   88 +++++++++
 offapi/com/sun/star/ui/DocumentAcceleratorConfiguration.idl            |   40 ++++
 offapi/com/sun/star/ui/ModuleAcceleratorConfiguration.idl              |   39 ++++
 offapi/com/sun/star/ui/XUIConfigurationManager.idl                     |    3 
 offapi/type_reference/offapi.rdb                                       |binary
 sc/source/ui/docshell/docsh.cxx                                        |    3 
 scripting/source/dlgprov/dlgprov.cxx                                   |   92 ++++------
 scripting/source/dlgprov/dlgprov.hxx                                   |   11 -
 sdext/source/minimizer/optimizerdialog.cxx                             |    2 
 sdext/source/minimizer/unodialog.cxx                                   |   51 ++---
 sdext/source/minimizer/unodialog.hxx                                   |    7 
 sfx2/source/sidebar/CommandInfoProvider.cxx                            |   41 +---
 sfx2/source/sidebar/ControllerFactory.cxx                              |    1 
 svtools/source/misc/acceleratorexecute.cxx                             |    4 
 xmlscript/test/imexp.cxx                                               |   24 +-
 78 files changed, 766 insertions(+), 606 deletions(-)

New commits:
commit e0fc16f769efc7b0c0b517a80523bb4e2c87b618
Author: Noel Grandin <noel at peralex.com>
Date:   Mon May 27 15:38:47 2013 +0200

    fdo#46808, Convert some XMultiServiceFactory to XComponentContext
    
    Change-Id: I8272ecab34711654ed27625a571cf2553ffd7468

diff --git a/framework/inc/helper/statusindicatorfactory.hxx b/framework/inc/helper/statusindicatorfactory.hxx
index a5cfa5e..b564f91 100644
--- a/framework/inc/helper/statusindicatorfactory.hxx
+++ b/framework/inc/helper/statusindicatorfactory.hxx
@@ -170,7 +170,7 @@ class StatusIndicatorFactory : public  css::lang::XTypeProvider
         IndicatorStack m_aStack;
 
         /** uno service manager to create own needed uno resources. */
-        css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR;
+        css::uno::Reference< css::uno::XComponentContext > m_xContext;
 
         /** most active indicator child, which could work with our shared indicator window only. */
         css::uno::Reference< css::task::XStatusIndicator > m_xActiveChild;
@@ -213,7 +213,7 @@ class StatusIndicatorFactory : public  css::lang::XTypeProvider
 
         //---------------------------------------
         // ctor
-        StatusIndicatorFactory(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR);
+        StatusIndicatorFactory(const css::uno::Reference< css::uno::XComponentContext >& xContext);
 
         //---------------------------------------
         // XInterface, XTypeProvider, XServiceInfo
diff --git a/framework/inc/helper/titlebarupdate.hxx b/framework/inc/helper/titlebarupdate.hxx
index b6ac825..7dfc262 100644
--- a/framework/inc/helper/titlebarupdate.hxx
+++ b/framework/inc/helper/titlebarupdate.hxx
@@ -30,7 +30,7 @@
 
 #include <general.h>
 
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
 
 #include <com/sun/star/lang/XInitialization.hpp>
 
@@ -88,7 +88,7 @@ class TitleBarUpdate : // interfaces
     private:
 
         /// may we need an uno service manager to create own services
-        css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR;
+        css::uno::Reference< css::uno::XComponentContext > m_xContext;
 
         /// reference to the frame which was created by the office himself
         css::uno::WeakReference< css::frame::XFrame > m_xFrame;
@@ -100,7 +100,7 @@ class TitleBarUpdate : // interfaces
 
         //____________________________
         // ctor/dtor
-                 TitleBarUpdate(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR);
+                 TitleBarUpdate(const css::uno::Reference< css::uno::XComponentContext >& xContext);
         virtual ~TitleBarUpdate(                                                                   );
 
         //____________________________
diff --git a/framework/inc/jobs/shelljob.hxx b/framework/inc/jobs/shelljob.hxx
index ed8d71f..a54fbcb 100644
--- a/framework/inc/jobs/shelljob.hxx
+++ b/framework/inc/jobs/shelljob.hxx
@@ -58,7 +58,7 @@ class ShellJob : private ThreadHelpBase
 
         //.......................................
         /** @short  reference to an uno service manager. */
-        css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR;
+        css::uno::Reference< css::uno::XComponentContext > m_xContext;
 
     //-------------------------------------------
     // native interface
@@ -67,11 +67,11 @@ class ShellJob : private ThreadHelpBase
         //---------------------------------------
         /** @short  create new instance of this class.
 
-            @param  xSMGR
+            @param  xContext
                     reference to the uno service manager, which created this instance.
                     Can be used later to create own needed uno resources on demand.
          */
-        ShellJob(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR);
+        ShellJob(const css::uno::Reference< css::uno::XComponentContext >& xContext);
 
         //---------------------------------------
         /** @short  does nothing real ...
diff --git a/framework/inc/recording/dispatchrecorder.hxx b/framework/inc/recording/dispatchrecorder.hxx
index e88893a..bfdfc4b 100644
--- a/framework/inc/recording/dispatchrecorder.hxx
+++ b/framework/inc/recording/dispatchrecorder.hxx
@@ -59,14 +59,13 @@ class DispatchRecorder
 {
     // private member
     private:
-        css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR        ;
         DispatchStatementList                                  m_aStatements;
         sal_Int32                                              m_nRecordingID ;
         css::uno::Reference< css::script::XTypeConverter >     m_xConverter;
 
     // public interface
     public:
-        DispatchRecorder( const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR );
+        DispatchRecorder( const css::uno::Reference< css::uno::XComponentContext >& xSMGR );
         ~DispatchRecorder();
 
         // XInterface, XTypeProvider, XServiceInfo
diff --git a/framework/inc/services/autorecovery.hxx b/framework/inc/services/autorecovery.hxx
index 2d837c0..51359c0 100644
--- a/framework/inc/services/autorecovery.hxx
+++ b/framework/inc/services/autorecovery.hxx
@@ -307,7 +307,7 @@ class AutoRecovery  : public  css::lang::XTypeProvider
         /** @short  the global uno service manager.
             @descr  Must be used to create own needed services.
          */
-        css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR;
+        css::uno::Reference< css::uno::XComponentContext > m_xContext;
 
         //---------------------------------------
         /** @short  points to the underlying recovery configuration.
@@ -439,7 +439,7 @@ class AutoRecovery  : public  css::lang::XTypeProvider
 
     public:
 
-                 AutoRecovery(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR);
+                 AutoRecovery(const css::uno::Reference< css::uno::XComponentContext >& xContext);
         virtual ~AutoRecovery(                                                                   );
 
         // XInterface, XTypeProvider, XServiceInfo
diff --git a/framework/inc/services/backingcomp.hxx b/framework/inc/services/backingcomp.hxx
index 17517c3..734291c 100644
--- a/framework/inc/services/backingcomp.hxx
+++ b/framework/inc/services/backingcomp.hxx
@@ -31,6 +31,7 @@
 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
 #include <com/sun/star/awt/XWindow.hpp>
 #include <com/sun/star/awt/XKeyListener.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
 
 #include <com/sun/star/frame/XFrame.hpp>
 
@@ -74,7 +75,7 @@ class BackingComp : public  css::lang::XTypeProvider
 
         /** the global uno service manager.
             Must be used to create own needed services. */
-        css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR;
+        css::uno::Reference< css::uno::XComponentContext > m_xContext;
 
         /** reference to the component window. */
         css::uno::Reference< css::awt::XWindow > m_xWindow;
@@ -90,7 +91,7 @@ class BackingComp : public  css::lang::XTypeProvider
 
     public:
 
-                 BackingComp( const css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR );
+                 BackingComp( const css::uno::Reference< css::uno::XComponentContext >& xContext );
         virtual ~BackingComp(                                                                    );
 
         // XInterface
diff --git a/framework/inc/services/layoutmanager.hxx b/framework/inc/services/layoutmanager.hxx
index 7bf8d48..9abb77a 100644
--- a/framework/inc/services/layoutmanager.hxx
+++ b/framework/inc/services/layoutmanager.hxx
@@ -93,7 +93,7 @@ namespace framework
         public:
             enum { DOCKINGAREAS_COUNT = 4 };
 
-            LayoutManager( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rSMGR );
+            LayoutManager( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& xContext );
             virtual ~LayoutManager();
 
             /** declaration of XInterface, XTypeProvider, XServiceInfo */
@@ -285,7 +285,7 @@ namespace framework
             virtual ::cppu::IPropertyArrayHelper&                       SAL_CALL getInfoHelper();
             virtual ::com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() throw (::com::sun::star::uno::RuntimeException);
 
-            css::uno::Reference< css::lang::XMultiServiceFactory >                      m_xSMGR; /** reference to factory, which has created this instance. */
+            css::uno::Reference< css::uno::XComponentContext >                          m_xContext; /** reference to factory, which has created this instance. */
             css::uno::Reference< css::util::XURLTransformer >                           m_xURLTransformer;
             css::uno::Reference< css::frame::XFrame >                                   m_xFrame;
             css::uno::Reference< ::com::sun::star::ui::XUIConfigurationManager >        m_xModuleCfgMgr;
diff --git a/framework/source/helper/statusindicatorfactory.cxx b/framework/source/helper/statusindicatorfactory.cxx
index 18ed206..d019551 100644
--- a/framework/source/helper/statusindicatorfactory.cxx
+++ b/framework/source/helper/statusindicatorfactory.cxx
@@ -69,10 +69,10 @@ DEFINE_XTYPEPROVIDER_5(StatusIndicatorFactory            ,
                        css::task::XStatusIndicatorFactory,
                        css::util::XUpdatable             )
 
-DEFINE_XSERVICEINFO_MULTISERVICE(StatusIndicatorFactory                   ,
-                                 ::cppu::OWeakObject                      ,
-                                 OUString("com.sun.star.task.StatusIndicatorFactory"),
-                                 OUString("com.sun.star.comp.framework.StatusIndicatorFactory"))
+DEFINE_XSERVICEINFO_MULTISERVICE_2(StatusIndicatorFactory                   ,
+                                   ::cppu::OWeakObject                      ,
+                                   OUString("com.sun.star.task.StatusIndicatorFactory"),
+                                   OUString("com.sun.star.comp.framework.StatusIndicatorFactory"))
 
 DEFINE_INIT_SERVICE(StatusIndicatorFactory,
                     {
@@ -85,10 +85,10 @@ DEFINE_INIT_SERVICE(StatusIndicatorFactory,
                    )
 
 //-----------------------------------------------
-StatusIndicatorFactory::StatusIndicatorFactory(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR)
+StatusIndicatorFactory::StatusIndicatorFactory(const css::uno::Reference< css::uno::XComponentContext >& xContext)
     : ThreadHelpBase      (         )
     , ::cppu::OWeakObject (         )
-    , m_xSMGR             (xSMGR    )
+    , m_xContext          (xContext )
     , m_pWakeUp           (0        )
     , m_bAllowReschedule  (sal_False)
     , m_bAllowParentShow  (sal_False)
@@ -352,7 +352,7 @@ void StatusIndicatorFactory::implts_makeParentVisibleIfAllowed()
 
     css::uno::Reference< css::frame::XFrame > xFrame      (m_xFrame.get()      , css::uno::UNO_QUERY);
     css::uno::Reference< css::awt::XWindow >  xPluggWindow(m_xPluggWindow.get(), css::uno::UNO_QUERY);
-    css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR( m_xSMGR.get(), css::uno::UNO_QUERY);
+    css::uno::Reference< css::uno::XComponentContext > xContext( m_xContext);
 
     aReadLock.unlock();
     // <- SAFE ----------------------------------
@@ -430,7 +430,7 @@ void StatusIndicatorFactory::implts_makeParentVisibleIfAllowed()
     {
         bool bForceFrontAndFocus(false);
         ::comphelper::ConfigurationHelper::readDirectKey(
-            comphelper::getComponentContext(xSMGR),
+            xContext,
             OUString("org.openoffice.Office.Common/View"),
             OUString("NewDocumentHandling"),
             OUString("ForceFocusAndToFront"),
@@ -499,7 +499,6 @@ void StatusIndicatorFactory::impl_showProgress()
 
     css::uno::Reference< css::frame::XFrame >              xFrame (m_xFrame.get()      , css::uno::UNO_QUERY);
     css::uno::Reference< css::awt::XWindow >               xWindow(m_xPluggWindow.get(), css::uno::UNO_QUERY);
-    css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR  = m_xSMGR;
 
     aReadLock.lock();
     // <- SAFE ----------------------------------
@@ -545,7 +544,6 @@ void StatusIndicatorFactory::impl_hideProgress()
 
     css::uno::Reference< css::frame::XFrame >              xFrame (m_xFrame.get()      , css::uno::UNO_QUERY);
     css::uno::Reference< css::awt::XWindow >               xWindow(m_xPluggWindow.get(), css::uno::UNO_QUERY);
-    css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR  = m_xSMGR;
 
     aReadLock.lock();
     // <- SAFE ----------------------------------
diff --git a/framework/source/helper/titlebarupdate.cxx b/framework/source/helper/titlebarupdate.cxx
index ddf55b7..5899b83 100644
--- a/framework/source/helper/titlebarupdate.cxx
+++ b/framework/source/helper/titlebarupdate.cxx
@@ -72,9 +72,9 @@ DEFINE_XTYPEPROVIDER_5(TitleBarUpdate                  ,
                        css::lang::XEventListener       )
 
 //*****************************************************************************************************************
-TitleBarUpdate::TitleBarUpdate(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR)
+TitleBarUpdate::TitleBarUpdate(const css::uno::Reference< css::uno::XComponentContext >& xContext)
     : ThreadHelpBase          (&Application::GetSolarMutex())
-    , m_xSMGR                 (xSMGR                        )
+    , m_xContext              (xContext                     )
     , m_xFrame                (                             )
 {
 }
@@ -163,12 +163,12 @@ void TitleBarUpdate::impl_updateApplicationID(const css::uno::Reference< css::fr
     {
         // SYNCHRONIZED ->
         ReadGuard aReadLock(m_aLock);
-        css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR;
+        css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
         aReadLock.unlock();
         // <- SYNCHRONIZED
 
         css::uno::Reference< css::frame::XModuleManager2 > xModuleManager =
-            css::frame::ModuleManager::create( comphelper::getComponentContext(xSMGR) );
+            css::frame::ModuleManager::create( xContext );
 
         OUString aModuleId = xModuleManager->identify(xFrame);
         OUString sDesktopName;
@@ -228,14 +228,14 @@ void TitleBarUpdate::impl_updateApplicationID(const css::uno::Reference< css::fr
 
     // SYNCHRONIZED ->
     ReadGuard aReadLock(m_aLock);
-    css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR;
+    css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
     aReadLock.unlock();
     // <- SYNCHRONIZED
 
     try
     {
         css::uno::Reference< css::frame::XModuleManager2 > xModuleManager =
-            css::frame::ModuleManager::create( comphelper::getComponentContext(xSMGR) );
+            css::frame::ModuleManager::create( xContext );
 
         rInfo.sID = xModuleManager->identify(xFrame);
         ::comphelper::SequenceAsHashMap lProps    = xModuleManager->getByName (rInfo.sID);
@@ -259,7 +259,6 @@ void TitleBarUpdate::impl_forceUpdate()
 {
     // SYNCHRONIZED ->
     ReadGuard aReadLock(m_aLock);
-    css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR ;
     css::uno::Reference< css::frame::XFrame >              xFrame(m_xFrame.get(), css::uno::UNO_QUERY);
     aReadLock.unlock();
     // <- SYNCHRONIZED
diff --git a/framework/source/jobs/shelljob.cxx b/framework/source/jobs/shelljob.cxx
index 52583f8..9464718 100644
--- a/framework/source/jobs/shelljob.cxx
+++ b/framework/source/jobs/shelljob.cxx
@@ -63,10 +63,10 @@ static const OUString PROP_CHECKEXITCODE("CheckExitCode");
 
 //-----------------------------------------------
 
-DEFINE_XSERVICEINFO_MULTISERVICE(ShellJob                   ,
-                                 ::cppu::OWeakObject        ,
-                                 SERVICENAME_JOB            ,
-                                 IMPLEMENTATIONNAME_SHELLJOB)
+DEFINE_XSERVICEINFO_MULTISERVICE_2(ShellJob                   ,
+                                   ::cppu::OWeakObject        ,
+                                   SERVICENAME_JOB            ,
+                                   IMPLEMENTATIONNAME_SHELLJOB)
 
 DEFINE_INIT_SERVICE(ShellJob,
                     {
@@ -79,9 +79,9 @@ DEFINE_INIT_SERVICE(ShellJob,
                    )
 
 //-----------------------------------------------
-ShellJob::ShellJob(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR)
+ShellJob::ShellJob(const css::uno::Reference< css::uno::XComponentContext >& xContext)
     : ThreadHelpBase(     )
-    , m_xSMGR       (xSMGR)
+    , m_xContext    (xContext)
 {
 }
 
@@ -143,13 +143,12 @@ OUString ShellJob::impl_substituteCommandVariables(const OUString& sCommand)
 {
     // SYNCHRONIZED ->
     ReadGuard aReadLock(m_aLock);
-    css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR;
+    css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
     aReadLock.unlock();
     // <- SYNCHRONIZED
 
     try
     {
-        css::uno::Reference< css::uno::XComponentContext >    xContext( comphelper::getComponentContext(xSMGR) );
         css::uno::Reference< css::util::XStringSubstitution > xSubst(  css::util::PathSubstitution::create(xContext) );
         const ::sal_Bool                                      bSubstRequired   = sal_True;
         const OUString                                 sCompleteCommand = xSubst->substituteVariables(sCommand, bSubstRequired);
diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx
index 7bc5a14..05bab58 100644
--- a/framework/source/layoutmanager/layoutmanager.cxx
+++ b/framework/source/layoutmanager/layoutmanager.cxx
@@ -109,15 +109,15 @@ namespace framework
 
 IMPLEMENT_FORWARD_XTYPEPROVIDER2( LayoutManager, LayoutManager_Base, LayoutManager_PBase )
 IMPLEMENT_FORWARD_XINTERFACE2( LayoutManager, LayoutManager_Base, LayoutManager_PBase )
-DEFINE_XSERVICEINFO_MULTISERVICE( LayoutManager, ::cppu::OWeakObject, SERVICENAME_LAYOUTMANAGER, IMPLEMENTATIONNAME_LAYOUTMANAGER)
+DEFINE_XSERVICEINFO_MULTISERVICE_2( LayoutManager, ::cppu::OWeakObject, SERVICENAME_LAYOUTMANAGER, IMPLEMENTATIONNAME_LAYOUTMANAGER)
 DEFINE_INIT_SERVICE( LayoutManager, {} )
 
-LayoutManager::LayoutManager( const Reference< XMultiServiceFactory >& xServiceManager ) : LayoutManager_Base()
+LayoutManager::LayoutManager( const Reference< XComponentContext >& xContext ) : LayoutManager_Base()
         , ThreadHelpBase( &Application::GetSolarMutex())
         , ::cppu::OBroadcastHelperVar< ::cppu::OMultiTypeInterfaceContainerHelper, ::cppu::OMultiTypeInterfaceContainerHelper::keyType >( m_aLock.getShareableOslMutex())
         , LayoutManager_PBase( *(static_cast< ::cppu::OBroadcastHelper* >(this)) )
-        , m_xSMGR( xServiceManager )
-        , m_xURLTransformer( URLTransformer::create(::comphelper::getComponentContext(xServiceManager)) )
+        , m_xContext( xContext )
+        , m_xURLTransformer( URLTransformer::create(xContext) )
         , m_nLockCount( 0 )
         , m_bActive( false )
         , m_bInplaceMenuSet( false )
@@ -135,9 +135,9 @@ LayoutManager::LayoutManager( const Reference< XMultiServiceFactory >& xServiceM
         , m_bPreserveContentSize( false )
         , m_bMenuBarCloser( false )
         , m_pInplaceMenuBar( NULL )
-        , m_xModuleManager( ModuleManager::create( comphelper::getComponentContext(xServiceManager) ))
-        , m_xUIElementFactoryManager( ui::UIElementFactoryManager::create(comphelper::getComponentContext(xServiceManager)) )
-        , m_xPersistentWindowStateSupplier( ui::WindowStateConfiguration::create( comphelper::getComponentContext(xServiceManager) ) )
+        , m_xModuleManager( ModuleManager::create( xContext ))
+        , m_xUIElementFactoryManager( ui::UIElementFactoryManager::create(xContext) )
+        , m_xPersistentWindowStateSupplier( ui::WindowStateConfiguration::create( xContext ) )
         , m_pGlobalSettings( 0 )
         , m_aListenerContainer( m_aLock.getShareableOslMutex() )
         , m_pToolbarManager( 0 )
@@ -148,7 +148,7 @@ LayoutManager::LayoutManager( const Reference< XMultiServiceFactory >& xServiceM
     m_aStatusBarElement.m_aType = "statusbar";
     m_aStatusBarElement.m_aName = STATUS_BAR_ALIAS;
 
-    m_pToolbarManager = new ToolbarLayoutManager( comphelper::getComponentContext(xServiceManager), Reference<XUIElementFactory>(m_xUIElementFactoryManager, UNO_QUERY_THROW), this );
+    m_pToolbarManager = new ToolbarLayoutManager( xContext, Reference<XUIElementFactory>(m_xUIElementFactoryManager, UNO_QUERY_THROW), this );
     m_xToolbarManager = uno::Reference< ui::XUIConfigurationListener >( static_cast< OWeakObject* >( m_pToolbarManager ), uno::UNO_QUERY );
 
     Application::AddEventListener( LINK( this, LayoutManager, SettingsChanged ) );
@@ -254,7 +254,7 @@ void LayoutManager::implts_reset( sal_Bool bAttached )
     Reference< XUIConfiguration > xModuleCfgMgr( m_xModuleCfgMgr, UNO_QUERY );
     Reference< XUIConfiguration > xDocCfgMgr( m_xDocCfgMgr, UNO_QUERY );
     Reference< XNameAccess > xPersistentWindowState( m_xPersistentWindowState );
-    Reference< XMultiServiceFactory > xServiceManager( m_xSMGR );
+    Reference< XComponentContext > xContext( m_xContext );
     Reference< XNameAccess > xPersistentWindowStateSupplier( m_xPersistentWindowStateSupplier );
     ToolbarLayoutManager* pToolbarManager( m_pToolbarManager );
     OUString aModuleIdentifier( m_aModuleIdentifier );
@@ -279,8 +279,8 @@ void LayoutManager::implts_reset( sal_Bool bAttached )
             if ( !aModuleIdentifier.isEmpty() && aOldModuleIdentifier != aModuleIdentifier )
             {
                 Reference< XModuleUIConfigurationManagerSupplier > xModuleCfgSupplier;
-                if ( xServiceManager.is() )
-                    xModuleCfgSupplier = ModuleUIConfigurationManagerSupplier::create( comphelper::getComponentContext(xServiceManager) );
+                if ( xContext.is() )
+                    xModuleCfgSupplier = ModuleUIConfigurationManagerSupplier::create( xContext );
 
                 if ( xModuleCfgMgr.is() )
                 {
@@ -485,7 +485,7 @@ uno::Reference< ui::XUIElement > LayoutManager::implts_findElement( const OUStri
 sal_Bool LayoutManager::implts_readWindowStateData( const OUString& aName, UIElement& rElementData )
 {
     return readWindowStateData( aName, rElementData, m_aLock, m_xPersistentWindowState,
-            m_pGlobalSettings, m_bGlobalSettings, comphelper::getComponentContext(m_xSMGR) );
+            m_pGlobalSettings, m_bGlobalSettings, m_xContext );
 }
 
 sal_Bool LayoutManager::readWindowStateData( const OUString& aName, UIElement& rElementData,
@@ -1171,7 +1171,7 @@ throw (uno::RuntimeException)
             Reference< XDispatchProvider > xDispatchProvider;
 
             MenuBar* pMenuBar = new MenuBar;
-            m_pInplaceMenuBar = new MenuBarManager( comphelper::getComponentContext(m_xSMGR), m_xFrame, m_xURLTransformer, xDispatchProvider, aModuleIdentifier, pMenuBar, sal_True, sal_True );
+            m_pInplaceMenuBar = new MenuBarManager( m_xContext, m_xFrame, m_xURLTransformer, xDispatchProvider, aModuleIdentifier, pMenuBar, sal_True, sal_True );
             m_pInplaceMenuBar->SetItemContainer( xMergedMenuBar );
 
             SystemWindow* pSysWindow = getTopSystemWindow( m_xContainerWindow );
@@ -1619,10 +1619,10 @@ throw (RuntimeException)
     else if ( aElementType.equalsIgnoreAsciiCase("dockingwindow"))
     {
         uno::Reference< frame::XFrame > xFrame( m_xFrame );
-        uno::Reference< lang::XMultiServiceFactory > xSMGR( m_xSMGR );
+        uno::Reference< XComponentContext > xContext( m_xContext );
         aWriteLock.unlock();
 
-        impl_setDockingWindowVisibility( comphelper::getComponentContext(xSMGR), xFrame, aElementName, false );
+        impl_setDockingWindowVisibility( xContext, xFrame, aElementName, false );
         bMustBeLayouted = false;
         bNotify         = false;
     }
@@ -1836,10 +1836,10 @@ throw (RuntimeException)
     {
         ReadGuard aReadGuard( m_aLock );
         uno::Reference< frame::XFrame > xFrame( m_xFrame );
-        uno::Reference< lang::XMultiServiceFactory > xSMGR( m_xSMGR );
+        uno::Reference< XComponentContext > xContext( m_xContext );
         aReadGuard.unlock();
 
-        impl_setDockingWindowVisibility( comphelper::getComponentContext(xSMGR), xFrame, aElementName, true );
+        impl_setDockingWindowVisibility( xContext, xFrame, aElementName, true );
     }
     else if ( aElementType.equalsIgnoreAsciiCase("toolpanel"))
     {
@@ -1928,10 +1928,10 @@ throw (RuntimeException)
     {
         ReadGuard aReadGuard( m_aLock );
         uno::Reference< frame::XFrame > xFrame( m_xFrame );
-        uno::Reference< lang::XMultiServiceFactory > xSMGR( m_xSMGR );
+        uno::Reference< XComponentContext > xContext( m_xContext );
         aReadGuard.unlock();
 
-        impl_setDockingWindowVisibility( comphelper::getComponentContext(xSMGR), xFrame, aElementName, false );
+        impl_setDockingWindowVisibility( xContext, xFrame, aElementName, false );
     }
 
     if ( bMustLayout )
@@ -2623,13 +2623,13 @@ IMPL_LINK_NOARG(LayoutManager, MenuBarClose)
 {
     ReadGuard aReadLock( m_aLock );
     uno::Reference< frame::XDispatchProvider >   xProvider(m_xFrame, uno::UNO_QUERY);
-    uno::Reference< lang::XMultiServiceFactory > xSMGR    = m_xSMGR;
+    uno::Reference< XComponentContext > xContext( m_xContext );
     aReadLock.unlock();
 
     if ( !xProvider.is())
         return 0;
 
-    uno::Reference< frame::XDispatchHelper > xDispatcher = frame::DispatchHelper::create( comphelper::getComponentContext( xSMGR ) );
+    uno::Reference< frame::XDispatchHelper > xDispatcher = frame::DispatchHelper::create( xContext );
 
     xDispatcher->executeDispatch(
         xProvider,
diff --git a/framework/source/recording/dispatchrecorder.cxx b/framework/source/recording/dispatchrecorder.cxx
index 02451e1..708b4cd 100644
--- a/framework/source/recording/dispatchrecorder.cxx
+++ b/framework/source/recording/dispatchrecorder.cxx
@@ -56,7 +56,7 @@ DEFINE_XTYPEPROVIDER_6(
     css::container::XIndexAccess,
     css::container::XElementAccess)
 
-DEFINE_XSERVICEINFO_MULTISERVICE(
+DEFINE_XSERVICEINFO_MULTISERVICE_2(
     DispatchRecorder,
     ::cppu::OWeakObject,
     OUString("com.sun.star.frame.DispatchRecorder"),
@@ -119,11 +119,10 @@ Sequence< Any > make_seq_out_of_struct(
 }
 
 //***********************************************************************
-DispatchRecorder::DispatchRecorder( const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR )
+DispatchRecorder::DispatchRecorder( const css::uno::Reference< css::uno::XComponentContext >& xContext )
         : ThreadHelpBase     ( &Application::GetSolarMutex() )
         , ::cppu::OWeakObject(                               )
-        , m_xSMGR            ( xSMGR                         )
-        , m_xConverter( css::script::Converter::create(comphelper::getComponentContext(m_xSMGR)) )
+        , m_xConverter( css::script::Converter::create(xContext) )
 {
 }
 
diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx
index 9541000..9af8eb7 100644
--- a/framework/source/services/autorecovery.cxx
+++ b/framework/source/services/autorecovery.cxx
@@ -416,10 +416,10 @@ DEFINE_XTYPEPROVIDER_6(AutoRecovery                 ,
                        css::beans::XPropertySet     )
 
 //-----------------------------------------------
-DEFINE_XSERVICEINFO_ONEINSTANCESERVICE(AutoRecovery                   ,
-                                       ::cppu::OWeakObject            ,
-                                       "com.sun.star.frame.AutoRecovery",
-                                       IMPLEMENTATIONNAME_AUTORECOVERY)
+DEFINE_XSERVICEINFO_ONEINSTANCESERVICE_2(AutoRecovery                   ,
+                                         ::cppu::OWeakObject            ,
+                                         "com.sun.star.frame.AutoRecovery",
+                                         IMPLEMENTATIONNAME_AUTORECOVERY)
 
 //-----------------------------------------------
 DEFINE_INIT_SERVICE(
@@ -443,12 +443,12 @@ DEFINE_INIT_SERVICE(
                    )
 
 //-----------------------------------------------
-AutoRecovery::AutoRecovery(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR)
+AutoRecovery::AutoRecovery(const css::uno::Reference< css::uno::XComponentContext >& xContext)
     : ThreadHelpBase            (&Application::GetSolarMutex()                      )
     , ::cppu::OBroadcastHelper  ( m_aLock.getShareableOslMutex()                    )
     , ::cppu::OPropertySetHelper( *(static_cast< ::cppu::OBroadcastHelper* >(this)) )
     , ::cppu::OWeakObject       (                                                   )
-    , m_xSMGR                   (xSMGR                                              )
+    , m_xContext                (xContext                                           )
     , m_bListenForDocEvents     (sal_False                                          )
     , m_bListenForConfigChanges (sal_False                                          )
     , m_nAutoSaveTimeIntervall  (0                                                  )
@@ -930,7 +930,7 @@ css::uno::Reference< css::container::XNameAccess > AutoRecovery::implts_openConf
 
     if (m_xRecoveryCFG.is())
         return m_xRecoveryCFG;
-    css::uno::Reference< css::uno::XComponentContext > xContext = comphelper::getComponentContext(m_xSMGR);
+    css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
 
     aWriteLock.unlock();
     // <- SAFE ----------------------------------
@@ -1130,7 +1130,7 @@ void AutoRecovery::implts_specifyDefaultFilterAndExtension(AutoRecovery::TDocume
 
     // SAFE -> ----------------------------------
     ReadGuard aReadLock(m_aLock);
-    css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR;
+    css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
     css::uno::Reference< css::container::XNameAccess>      xCFG  = m_xModuleCFG;
     aReadLock.unlock();
     // <- SAFE ----------------------------------
@@ -1141,7 +1141,7 @@ void AutoRecovery::implts_specifyDefaultFilterAndExtension(AutoRecovery::TDocume
         {
             // open module config on demand and cache the update access
             xCFG = css::uno::Reference< css::container::XNameAccess >(
-                ::comphelper::ConfigurationHelper::openConfig(comphelper::getComponentContext(xSMGR), OUString(CFG_PACKAGE_MODULES),
+                ::comphelper::ConfigurationHelper::openConfig(xContext, OUString(CFG_PACKAGE_MODULES),
                 ::comphelper::ConfigurationHelper::E_STANDARD),
                 css::uno::UNO_QUERY_THROW);
 
@@ -1158,8 +1158,8 @@ void AutoRecovery::implts_specifyDefaultFilterAndExtension(AutoRecovery::TDocume
 
         xModuleProps->getByName(OUString(CFG_ENTRY_REALDEFAULTFILTER)) >>= rInfo.DefaultFilter;
 
-        css::uno::Reference< css::container::XNameAccess > xFilterCFG(xSMGR->createInstance(SERVICENAME_FILTERFACTORY), css::uno::UNO_QUERY_THROW);
-        css::uno::Reference< css::container::XNameAccess > xTypeCFG  (xSMGR->createInstance(SERVICENAME_TYPEDETECTION), css::uno::UNO_QUERY_THROW);
+        css::uno::Reference< css::container::XNameAccess > xFilterCFG(xContext->getServiceManager()->createInstanceWithContext(SERVICENAME_FILTERFACTORY, xContext), css::uno::UNO_QUERY_THROW);
+        css::uno::Reference< css::container::XNameAccess > xTypeCFG  (xContext->getServiceManager()->createInstanceWithContext(SERVICENAME_TYPEDETECTION, xContext), css::uno::UNO_QUERY_THROW);
 
         ::comphelper::SequenceAsHashMap       lFilterProps        (xFilterCFG->getByName(rInfo.DefaultFilter));
         OUString                       sTypeRegistration   = lFilterProps.getUnpackedValueOrDefault(OUString(FILTER_PROP_TYPE), OUString());
@@ -1190,11 +1190,11 @@ void AutoRecovery::implts_specifyAppModuleAndFactory(AutoRecovery::TDocumentInfo
 
     // 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::XModuleManager2 > xManager = ModuleManager::create( comphelper::getComponentContext(xSMGR) );
+    css::uno::Reference< css::frame::XModuleManager2 > xManager = ModuleManager::create( xContext );
 
     if (rInfo.AppModule.isEmpty())
         rInfo.AppModule = xManager->identify(rInfo.Document);
@@ -1373,7 +1373,7 @@ void AutoRecovery::implts_startListening()
 {
     // SAFE -> ----------------------------------
     ReadGuard aReadLock(m_aLock);
-    css::uno::Reference< css::lang::XMultiServiceFactory >  xSMGR               = m_xSMGR;
+    css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
     css::uno::Reference< css::util::XChangesNotifier >      xCFG                (m_xRecoveryCFG, css::uno::UNO_QUERY);
     css::uno::Reference< css::frame::XGlobalEventBroadcaster > xBroadcaster        = m_xNewDocBroadcaster;
     sal_Bool                                                bListenForDocEvents = m_bListenForDocEvents;
@@ -1392,7 +1392,7 @@ void AutoRecovery::implts_startListening()
 
     if (!xBroadcaster.is())
     {
-        xBroadcaster = css::frame::GlobalEventBroadcaster::create( comphelper::getComponentContext(xSMGR) );
+        xBroadcaster = css::frame::GlobalEventBroadcaster::create( xContext );
         // SAFE -> ----------------------------------
         WriteGuard aWriteLock(m_aLock);
         m_xNewDocBroadcaster = xBroadcaster;
@@ -1717,7 +1717,7 @@ void AutoRecovery::implts_registerDocument(const css::uno::Reference< css::frame
 
     // 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 ----------------------------------
 
@@ -2004,11 +2004,11 @@ void AutoRecovery::implts_changeAllDocVisibility(sal_Bool bVisible)
 {
     // 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::uno::Reference< css::frame::XFramesSupplier > xDesktop( css::frame::Desktop::create( xContext ), css::uno::UNO_QUERY);
     lcl_changeVisibility( xDesktop, bVisible );
 
     aReadLock.unlock();
@@ -2144,7 +2144,7 @@ AutoRecovery::ETimerType AutoRecovery::implts_saveDocs(      sal_Bool        bAl
 {
     // 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 ----------------------------------
 
@@ -2152,7 +2152,7 @@ AutoRecovery::ETimerType AutoRecovery::implts_saveDocs(      sal_Bool        bAl
     if (pParams)
         xExternalProgress = pParams->m_xProgress;
 
-    css::uno::Reference< css::frame::XDesktop2 > xDesktop   = css::frame::Desktop::create( comphelper::getComponentContext(xSMGR));
+    css::uno::Reference< css::frame::XDesktop2 > xDesktop   = css::frame::Desktop::create( xContext);
     OUString                              sBackupPath(SvtPathOptions().GetBackupPath());
 
     css::uno::Reference< css::frame::XController > xActiveController;
@@ -2557,7 +2557,7 @@ AutoRecovery::ETimerType AutoRecovery::implts_openDocs(const DispatchParams& aPa
         else
             continue; // TODO ERROR!
 
-        LoadEnv::initializeUIDefaults( comphelper::getComponentContext(m_xSMGR), lDescriptor, true, NULL );
+        LoadEnv::initializeUIDefaults( m_xContext, lDescriptor, true, NULL );
 
         // <- SAFE ------------------------------
         aWriteLock.unlock();
@@ -2648,17 +2648,17 @@ void AutoRecovery::implts_openOneDoc(const OUString&               sURL       ,
 {
     // 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::XDesktop2 > xDesktop   = css::frame::Desktop::create( xContext);
 
     ::std::vector< Reference< XComponent > > aCleanup;
     try
     {
         // create a new document of the desired type
-        Reference< XModel2 > xModel( xSMGR->createInstance( rInfo.FactoryService ), UNO_QUERY_THROW );
+        Reference< XModel2 > xModel( xContext->getServiceManager()->createInstanceWithContext(rInfo.FactoryService, xContext), UNO_QUERY_THROW );
         aCleanup.push_back( xModel.get() );
 
         // put the filter name into the descriptor - we're not going to involve any type detection, so
@@ -2773,7 +2773,7 @@ void AutoRecovery::implts_generateNewTempURL(const OUString&               sBack
 {
     // 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 ----------------------------------
 
@@ -2788,7 +2788,7 @@ void AutoRecovery::implts_generateNewTempURL(const OUString&               sBack
     OUStringBuffer sUniqueName;
     if (!rInfo.OrgURL.isEmpty())
     {
-        css::uno::Reference< css::util::XURLTransformer > xParser(css::util::URLTransformer::create(::comphelper::getComponentContext(m_xSMGR)));
+        css::uno::Reference< css::util::XURLTransformer > xParser(css::util::URLTransformer::create(m_xContext));
         css::util::URL aURL;
         aURL.Complete = rInfo.OrgURL;
         xParser->parseStrict(aURL);
@@ -2980,7 +2980,7 @@ void AutoRecovery::implts_doEmergencySave(const DispatchParams& aParams)
     // the error report tool is started too in case no recovery
     // documents exists and was saved.
     ::comphelper::ConfigurationHelper::writeDirectKey(
-        comphelper::getComponentContext(m_xSMGR),
+        m_xContext,
         OUString(CFG_PACKAGE_RECOVERY),
         OUString(CFG_PATH_RECOVERYINFO),
         OUString(CFG_ENTRY_CRASHED),
@@ -3041,7 +3041,7 @@ void AutoRecovery::implts_doRecovery(const DispatchParams& aParams)
 
     // Reset the configuration hint "we was crashed"!
     ::comphelper::ConfigurationHelper::writeDirectKey(
-        comphelper::getComponentContext(m_xSMGR),
+        m_xContext,
         OUString(CFG_PACKAGE_RECOVERY),
         OUString(CFG_PATH_RECOVERYINFO),
         OUString(CFG_ENTRY_CRASHED),
@@ -3108,7 +3108,7 @@ void AutoRecovery::implts_doSessionQuietQuit(const DispatchParams& /*aParams*/)
     // Write a hint for "stored session data" into the configuration, so
     // the on next startup we know what's happen last time
     ::comphelper::ConfigurationHelper::writeDirectKey(
-        comphelper::getComponentContext(m_xSMGR),
+        m_xContext,
         OUString(CFG_PACKAGE_RECOVERY),
         OUString(CFG_PATH_RECOVERYINFO),
         OUString(CFG_ENTRY_SESSIONDATA),
@@ -3145,7 +3145,7 @@ void AutoRecovery::implts_doSessionRestore(const DispatchParams& aParams)
     // Reset the configuration hint for "session save"!
     LOG_RECOVERY("... reset config key 'SessionData'")
     ::comphelper::ConfigurationHelper::writeDirectKey(
-        comphelper::getComponentContext(m_xSMGR),
+        m_xContext,
         OUString(CFG_PACKAGE_RECOVERY),
         OUString(CFG_PATH_RECOVERYINFO),
         OUString(CFG_ENTRY_SESSIONDATA),
@@ -3230,7 +3230,7 @@ AutoRecovery::EFailureSafeResult AutoRecovery::implts_copyFile(const OUString& s
 
     try
     {
-        aTargetContent = ::ucbhelper::Content(sTargetPath, xEnvironment, comphelper::getComponentContext(m_xSMGR));
+        aTargetContent = ::ucbhelper::Content(sTargetPath, xEnvironment, m_xContext);
     }
     catch(const css::uno::Exception&)
     {
@@ -3242,7 +3242,7 @@ AutoRecovery::EFailureSafeResult AutoRecovery::implts_copyFile(const OUString& s
 
     try
     {
-        ::ucbhelper::Content::create(sSource, xEnvironment, comphelper::getComponentContext(m_xSMGR), aSourceContent);
+        ::ucbhelper::Content::create(sSource, xEnvironment, m_xContext, aSourceContent);
         aTargetContent.transferContent(aSourceContent, ::ucbhelper::InsertOperation_COPY, sTargetName, nNameClash);
     }
     catch(const css::uno::Exception&)
@@ -3282,7 +3282,7 @@ void SAL_CALL AutoRecovery::getFastPropertyValue(css::uno::Any& aValue ,
                 {
                     sal_Bool bSessionData  = sal_False;
                     ::comphelper::ConfigurationHelper::readDirectKey(
-                                                    comphelper::getComponentContext(m_xSMGR),
+                                                    m_xContext,
                                                     OUString(CFG_PACKAGE_RECOVERY),
                                                     OUString(CFG_PATH_RECOVERYINFO),
                                                     OUString(CFG_ENTRY_SESSIONDATA),
@@ -3301,7 +3301,7 @@ void SAL_CALL AutoRecovery::getFastPropertyValue(css::uno::Any& aValue ,
 
         case AUTORECOVERY_PROPHANDLE_CRASHED :
                 aValue = ::comphelper::ConfigurationHelper::readDirectKey(
-                            comphelper::getComponentContext(m_xSMGR),
+                            m_xContext,
                             OUString(CFG_PACKAGE_RECOVERY),
                             OUString(CFG_PATH_RECOVERYINFO),
                             OUString(CFG_ENTRY_CRASHED),
@@ -3310,7 +3310,7 @@ void SAL_CALL AutoRecovery::getFastPropertyValue(css::uno::Any& aValue ,
 
         case AUTORECOVERY_PROPHANDLE_EXISTS_SESSIONDATA :
                 aValue = ::comphelper::ConfigurationHelper::readDirectKey(
-                            comphelper::getComponentContext(m_xSMGR),
+                            m_xContext,
                             OUString(CFG_PACKAGE_RECOVERY),
                             OUString(CFG_PATH_RECOVERYINFO),
                             OUString(CFG_ENTRY_SESSIONDATA),
@@ -3374,13 +3374,13 @@ void AutoRecovery::implts_verifyCacheAgainstDesktopDocumentList()
 
     // SAFE -> ----------------------------------
     WriteGuard aWriteLock(m_aLock);
-    css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR;
+    css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
     aWriteLock.unlock();
     // <- SAFE ----------------------------------
 
     try
     {
-        css::uno::Reference< css::frame::XDesktop2 > xDesktop   = css::frame::Desktop::create( comphelper::getComponentContext(xSMGR));
+        css::uno::Reference< css::frame::XDesktop2 > xDesktop   = css::frame::Desktop::create( xContext);
 
         css::uno::Reference< css::container::XIndexAccess > xContainer(
             xDesktop->getFrames(),
@@ -3628,7 +3628,7 @@ void AutoRecovery::st_impl_removeFile(const OUString& sURL)
 
     try
     {
-        ::ucbhelper::Content aContent = ::ucbhelper::Content(sURL, css::uno::Reference< css::ucb::XCommandEnvironment >(), comphelper::getComponentContext(m_xSMGR));
+        ::ucbhelper::Content aContent = ::ucbhelper::Content(sURL, css::uno::Reference< css::ucb::XCommandEnvironment >(), m_xContext);
         aContent.executeCommand(OUString("delete"), css::uno::makeAny(sal_True));
     }
     catch(const css::uno::Exception&)
diff --git a/framework/source/services/backingcomp.cxx b/framework/source/services/backingcomp.cxx
index b7c1c4e..89a757d 100644
--- a/framework/source/services/backingcomp.cxx
+++ b/framework/source/services/backingcomp.cxx
@@ -65,9 +65,9 @@ namespace framework
 
 //_______________________________________________
 
-BackingComp::BackingComp( const css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR )
+BackingComp::BackingComp( const css::uno::Reference< css::uno::XComponentContext >& xContext )
     : ThreadHelpBase    (&Application::GetSolarMutex()                  )
-    , m_xSMGR           (xSMGR                                          )
+    , m_xContext        (xContext                                          )
 {
 }
 
@@ -348,7 +348,7 @@ css::uno::Sequence< OUString > BackingComp::impl_getStaticSupportedServiceNames(
 css::uno::Reference< css::uno::XInterface > SAL_CALL BackingComp::impl_createInstance( /*IN*/ const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR )
     throw(css::uno::Exception)
 {
-    BackingComp* pObject = new BackingComp(xSMGR);
+    BackingComp* pObject = new BackingComp(comphelper::getComponentContext(xSMGR));
     return css::uno::Reference< css::uno::XInterface >(static_cast< ::cppu::OWeakObject* >(pObject), css::uno::UNO_QUERY);
 }
 
@@ -459,10 +459,10 @@ void SAL_CALL BackingComp::attachFrame( /*IN*/ const css::uno::Reference< css::f
     m_xFrame = xFrame;
 
     // establish drag&drop mode
-    ::framework::DropTargetListener* pDropListener = new ::framework::DropTargetListener( comphelper::getComponentContext(m_xSMGR), m_xFrame);
+    ::framework::DropTargetListener* pDropListener = new ::framework::DropTargetListener( m_xContext, m_xFrame);
     m_xDropTargetListener = css::uno::Reference< css::datatransfer::dnd::XDropTargetListener >(static_cast< ::cppu::OWeakObject* >(pDropListener), css::uno::UNO_QUERY);
 
-    css::uno::Reference< css::awt::XToolkit2 > xToolkit = css::awt::Toolkit::create( comphelper::getComponentContext(m_xSMGR) );
+    css::uno::Reference< css::awt::XToolkit2 > xToolkit = css::awt::Toolkit::create( m_xContext );
     css::uno::Reference< css::datatransfer::dnd::XDropTarget > xDropTarget = xToolkit->getDropTarget(m_xWindow);
     if (xDropTarget.is())
     {
@@ -663,7 +663,7 @@ void SAL_CALL BackingComp::dispose()
     // kill the menu
     css::util::URL aURL;
     aURL.Complete = DECLARE_ASCII(".uno:close");
-    css::uno::Reference< css::util::XURLTransformer > xParser(css::util::URLTransformer::create(::comphelper::getComponentContext(m_xSMGR)));
+    css::uno::Reference< css::util::XURLTransformer > xParser = css::util::URLTransformer::create(m_xContext);
     if (xParser.is())
         xParser->parseStrict(aURL);
 
@@ -678,7 +678,7 @@ void SAL_CALL BackingComp::dispose()
     // deregister drag&drop helper
     if (m_xDropTargetListener.is())
     {
-        css::uno::Reference< css::awt::XToolkit2 > xToolkit = css::awt::Toolkit::create( comphelper::getComponentContext(m_xSMGR) );
+        css::uno::Reference< css::awt::XToolkit2 > xToolkit = css::awt::Toolkit::create( m_xContext );
         css::uno::Reference< css::datatransfer::dnd::XDropTarget > xDropTarget = xToolkit->getDropTarget(m_xWindow);
         if (xDropTarget.is())
         {
@@ -703,8 +703,8 @@ void SAL_CALL BackingComp::dispose()
     }
 
     // forget all other used references
-    m_xFrame  = css::uno::Reference< css::frame::XFrame >();
-    m_xSMGR   = css::uno::Reference< css::lang::XMultiServiceFactory >();
+    m_xFrame.clear();
+    m_xContext.clear();
 
     aWriteLock.unlock();
     /* } SAFE */
diff --git a/framework/source/services/taskcreatorsrv.cxx b/framework/source/services/taskcreatorsrv.cxx
index a7e0d6c..6b11a3f 100644
--- a/framework/source/services/taskcreatorsrv.cxx
+++ b/framework/source/services/taskcreatorsrv.cxx
@@ -348,7 +348,7 @@ void TaskCreatorService::implts_establishTitleBarUpdate( const css::uno::Referen
     aReadLock.unlock();
     // <- SAFE
 
-    TitleBarUpdate* pHelper = new TitleBarUpdate (xSMGR);
+    TitleBarUpdate* pHelper = new TitleBarUpdate (comphelper::getComponentContext(xSMGR));
     css::uno::Reference< css::lang::XInitialization > xInit(static_cast< ::cppu::OWeakObject* >(pHelper), css::uno::UNO_QUERY_THROW);
 
     css::uno::Sequence< css::uno::Any > lInitData(1);
commit c380b432e32647ca9583b688c9b2f5688d7c2695
Author: Noel Grandin <noel at peralex.com>
Date:   Mon May 27 15:35:24 2013 +0200

    remove unnecessary parameter and field
    
    Change-Id: I10311ea88f69566d9e30308c0cff193dd5ddcd11

diff --git a/framework/inc/helper/vclstatusindicator.hxx b/framework/inc/helper/vclstatusindicator.hxx
index 1827174..62021bf 100644
--- a/framework/inc/helper/vclstatusindicator.hxx
+++ b/framework/inc/helper/vclstatusindicator.hxx
@@ -47,9 +47,6 @@ class VCLStatusIndicator : public  css::task::XStatusIndicator
 
     private:
 
-        /** can be used to create own needed uno resources. */
-        css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR;
-
         /** points to the parent window of this progress and
             hold it alive. */
         css::uno::Reference< css::awt::XWindow > m_xParentWindow;
@@ -79,8 +76,7 @@ class VCLStatusIndicator : public  css::task::XStatusIndicator
         FWK_DECLARE_XINTERFACE
 
         /// ctor
-        VCLStatusIndicator(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR        ,
-                           const css::uno::Reference< css::awt::XWindow >&               xParentWindow);
+        VCLStatusIndicator(const css::uno::Reference< css::awt::XWindow >&               xParentWindow);
 
         /// dtor
         virtual ~VCLStatusIndicator();
diff --git a/framework/source/helper/statusindicatorfactory.cxx b/framework/source/helper/statusindicatorfactory.cxx
index 091da14..18ed206 100644
--- a/framework/source/helper/statusindicatorfactory.cxx
+++ b/framework/source/helper/statusindicatorfactory.cxx
@@ -449,7 +449,6 @@ void StatusIndicatorFactory::impl_createProgress()
 
     css::uno::Reference< css::frame::XFrame >              xFrame (m_xFrame.get()      , css::uno::UNO_QUERY);
     css::uno::Reference< css::awt::XWindow >               xWindow(m_xPluggWindow.get(), css::uno::UNO_QUERY);
-    css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR  = m_xSMGR;
 
     aReadLock.lock();
     // <- SAFE ----------------------------------
@@ -459,7 +458,7 @@ void StatusIndicatorFactory::impl_createProgress()
     if (xWindow.is())
     {
         // use vcl based progress implementation in plugged mode
-        VCLStatusIndicator* pVCLProgress = new VCLStatusIndicator(xSMGR, xWindow);
+        VCLStatusIndicator* pVCLProgress = new VCLStatusIndicator(xWindow);
         xProgress = css::uno::Reference< css::task::XStatusIndicator >(static_cast< css::task::XStatusIndicator* >(pVCLProgress), css::uno::UNO_QUERY);
     }
     else if (xFrame.is())
diff --git a/framework/source/helper/vclstatusindicator.cxx b/framework/source/helper/vclstatusindicator.cxx
index b8517a4..75c12bd 100644
--- a/framework/source/helper/vclstatusindicator.cxx
+++ b/framework/source/helper/vclstatusindicator.cxx
@@ -35,11 +35,9 @@ DEFINE_XINTERFACE_1(VCLStatusIndicator                           ,
                     DIRECT_INTERFACE(css::task::XStatusIndicator))
 
 //-----------------------------------------------
-VCLStatusIndicator::VCLStatusIndicator(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR        ,
-                                       const css::uno::Reference< css::awt::XWindow >&               xParentWindow)
+VCLStatusIndicator::VCLStatusIndicator(const css::uno::Reference< css::awt::XWindow >&               xParentWindow)
     : ThreadHelpBase     (&Application::GetSolarMutex())
     , ::cppu::OWeakObject(                             )
-    , m_xSMGR            (xSMGR                        )
     , m_xParentWindow    (xParentWindow                )
     , m_pStatusBar       (0                            )
     , m_nRange           (0                            )
commit 5835d8d2716448fb5549e7bae433704143d63e84
Author: Noel Grandin <noel at peralex.com>
Date:   Mon May 27 15:33:07 2013 +0200

    fdo#46808, Convert some XMultiServiceFactory to XComponentContext
    
    Change-Id: Ia55bb7af6e5d1c76f3cf8001ea53892e1e1bdac0

diff --git a/framework/inc/helper/persistentwindowstate.hxx b/framework/inc/helper/persistentwindowstate.hxx
index e2af1bd..60cc05d 100644
--- a/framework/inc/helper/persistentwindowstate.hxx
+++ b/framework/inc/helper/persistentwindowstate.hxx
@@ -70,7 +70,7 @@ class PersistentWindowState :   // interfaces
     private:
 
         /// may we need an uno service manager to create own services
-        css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR;
+        css::uno::Reference< css::uno::XComponentContext > m_xContext;
 
         /// reference to the frame which was created by the office himself
         css::uno::WeakReference< css::frame::XFrame > m_xFrame;
@@ -85,7 +85,7 @@ class PersistentWindowState :   // interfaces
 
         //____________________________
         // ctor/dtor
-                 PersistentWindowState(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR);
+                 PersistentWindowState(const css::uno::Reference< css::uno::XComponentContext >& xContext);
         virtual ~PersistentWindowState(                                                                   );
 
         //____________________________
diff --git a/framework/source/helper/persistentwindowstate.cxx b/framework/source/helper/persistentwindowstate.cxx
index d6733ea..4cc20cd 100644
--- a/framework/source/helper/persistentwindowstate.cxx
+++ b/framework/source/helper/persistentwindowstate.cxx
@@ -61,9 +61,9 @@ DEFINE_XTYPEPROVIDER_4(PersistentWindowState           ,
                        css::lang::XEventListener       )
 
 //*****************************************************************************************************************
-PersistentWindowState::PersistentWindowState(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR)
+PersistentWindowState::PersistentWindowState(const css::uno::Reference< css::uno::XComponentContext >& xContext)
     : ThreadHelpBase          (&Application::GetSolarMutex())
-    , m_xSMGR                 (xSMGR                        )
+    , m_xContext              (xContext                     )
     , m_bWindowStateAlreadySet(sal_False                    )
 {
 }
@@ -110,7 +110,7 @@ void SAL_CALL PersistentWindowState::frameAction(const css::frame::FrameActionEv
 {
     // SAFE -> ----------------------------------
     ReadGuard aReadLock(m_aLock);
-    css::uno::Reference< css::uno::XComponentContext >     xContext = comphelper::getComponentContext(m_xSMGR);
+    css::uno::Reference< css::uno::XComponentContext >     xContext = m_xContext;
     css::uno::Reference< css::frame::XFrame >              xFrame(m_xFrame.get(), css::uno::UNO_QUERY);
     sal_Bool                                               bRestoreWindowState = !m_bWindowStateAlreadySet;
     aReadLock.unlock();
diff --git a/framework/source/services/taskcreatorsrv.cxx b/framework/source/services/taskcreatorsrv.cxx
index 1231066..a7e0d6c 100644
--- a/framework/source/services/taskcreatorsrv.cxx
+++ b/framework/source/services/taskcreatorsrv.cxx
@@ -311,7 +311,7 @@ void TaskCreatorService::implts_establishWindowStateListener( const css::uno::Re
     // We must create a special listener service and couple it with the new created task frame.
     // He will restore or save the window state of it ...
     // See used classes for further information too.
-    PersistentWindowState* pPersistentStateHandler = new PersistentWindowState(xSMGR);
+    PersistentWindowState* pPersistentStateHandler = new PersistentWindowState( comphelper::getComponentContext(xSMGR));
     css::uno::Reference< css::lang::XInitialization > xInit(static_cast< ::cppu::OWeakObject* >(pPersistentStateHandler), css::uno::UNO_QUERY_THROW);
 
     css::uno::Sequence< css::uno::Any > lInitData(1);
commit 052de9c16bc4018d2ae3edc6282267e04d3956ac
Author: Noel Grandin <noel at peralex.com>
Date:   Mon May 27 15:15:03 2013 +0200

    fdo#46808, Convert some XMultiServiceFactory to XComponentContext
    
    Change-Id: I7223d8e2c962ca90eda08119ed73a034d334329d

diff --git a/framework/inc/jobs/job.hxx b/framework/inc/jobs/job.hxx
index 6ed4f55..a9861ca 100644
--- a/framework/inc/jobs/job.hxx
+++ b/framework/inc/jobs/job.hxx
@@ -92,7 +92,7 @@ class Job : public  css::lang::XTypeProvider
         /**
             We need it to create own services on demand.
          */
-        css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR;
+        css::uno::Reference< css::uno::XComponentContext > m_xContext;
 
         /**
             Hold the (may asynchronous) job alive.
@@ -176,9 +176,9 @@ class Job : public  css::lang::XTypeProvider
 
     public:
 
-                 Job( const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR  ,
+                 Job( const css::uno::Reference< css::uno::XComponentContext >& xContext  ,
                       const css::uno::Reference< css::frame::XFrame >&              xFrame );
-                 Job( const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR  ,
+                 Job( const css::uno::Reference< css::uno::XComponentContext >& xContext  ,
                       const css::uno::Reference< css::frame::XModel >&              xModel );
         virtual ~Job(                                                                      );
 
diff --git a/framework/inc/jobs/jobdispatch.hxx b/framework/inc/jobs/jobdispatch.hxx
index 47f2c62..9500230 100644
--- a/framework/inc/jobs/jobdispatch.hxx
+++ b/framework/inc/jobs/jobdispatch.hxx
@@ -77,7 +77,7 @@ class JobDispatch : public  css::lang::XTypeProvider
     private:
 
         /** reference to the uno service manager */
-        css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR;
+        css::uno::Reference< css::uno::XComponentContext > m_xContext;
 
         /** reference to the frame, inside which this dispatch is used */
         css::uno::Reference< css::frame::XFrame > m_xFrame;
@@ -90,7 +90,7 @@ class JobDispatch : public  css::lang::XTypeProvider
 
     public:
 
-                  JobDispatch( const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR );
+                  JobDispatch( const css::uno::Reference< css::uno::XComponentContext >& xContext );
          virtual ~JobDispatch(                                                                     );
 
         void impl_dispatchEvent  ( const OUString&                                            sEvent    ,
diff --git a/framework/inc/jobs/jobexecutor.hxx b/framework/inc/jobs/jobexecutor.hxx
index 931fb07..a557470 100644
--- a/framework/inc/jobs/jobexecutor.hxx
+++ b/framework/inc/jobs/jobexecutor.hxx
@@ -65,7 +65,7 @@ class JobExecutor : public  css::lang::XTypeProvider
     private:
 
         /** reference to the uno service manager */
-        css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR;
+        css::uno::Reference< css::uno::XComponentContext > m_xContext;
 
         /** reference to the module info service */
         css::uno::Reference< css::frame::XModuleManager2 > m_xModuleManager;
@@ -84,7 +84,7 @@ class JobExecutor : public  css::lang::XTypeProvider
 
     public:
 
-                  JobExecutor( const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR );
+                  JobExecutor( const css::uno::Reference< css::uno::XComponentContext >& xContext );
          virtual ~JobExecutor(                                                                     );
 
     //___________________________________
diff --git a/framework/inc/uiconfiguration/moduleimagemanager.hxx b/framework/inc/uiconfiguration/moduleimagemanager.hxx
index 0a8be67..de9525e 100644
--- a/framework/inc/uiconfiguration/moduleimagemanager.hxx
+++ b/framework/inc/uiconfiguration/moduleimagemanager.hxx
@@ -63,7 +63,7 @@ namespace framework
                                   public ::cppu::WeakImplHelper1< ::com::sun::star::ui::XImageManager>
     {
         public:
-            ModuleImageManager( com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > xServiceManager );
+            ModuleImageManager( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& xContext );
             virtual ~ModuleImageManager();
 
             // XComponent
diff --git a/framework/inc/uiconfiguration/moduleuiconfigurationmanager.hxx b/framework/inc/uiconfiguration/moduleuiconfigurationmanager.hxx
index 25894ce..efa56ec 100644
--- a/framework/inc/uiconfiguration/moduleuiconfigurationmanager.hxx
+++ b/framework/inc/uiconfiguration/moduleuiconfigurationmanager.hxx
@@ -74,7 +74,7 @@ namespace framework
             FWK_DECLARE_XTYPEPROVIDER
             DECLARE_XSERVICEINFO
 
-            ModuleUIConfigurationManager( com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > xServiceManager );
+            ModuleUIConfigurationManager( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& xServiceManager );
             virtual ~ModuleUIConfigurationManager();
 
             // XComponent
@@ -199,7 +199,7 @@ namespace framework
             OUString                                                                   m_aModuleIdentifier;
             OUString                                                                   m_aModuleShortName;
             com::sun::star::uno::Reference< com::sun::star::embed::XTransactedObject >      m_xUserRootCommit;
-            com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >    m_xServiceManager;
+            com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >        m_xContext;
             ::cppu::OMultiTypeInterfaceContainerHelper                                      m_aListenerContainer;   /// container for ALL Listener
             com::sun::star::uno::Reference< com::sun::star::lang::XComponent >              m_xModuleImageManager;
             com::sun::star::uno::Reference< com::sun::star::ui::XAcceleratorConfiguration > m_xModuleAcceleratorManager;
diff --git a/framework/source/accelerators/acceleratorconfiguration.cxx b/framework/source/accelerators/acceleratorconfiguration.cxx
index 01a4339..cfb5618 100644
--- a/framework/source/accelerators/acceleratorconfiguration.cxx
+++ b/framework/source/accelerators/acceleratorconfiguration.cxx
@@ -104,10 +104,10 @@ DEFINE_XTYPEPROVIDER_6(XMLBasedAcceleratorConfiguration     ,
                        css::ui::XUIConfiguration           )
 
 //-----------------------------------------------
-XMLBasedAcceleratorConfiguration::XMLBasedAcceleratorConfiguration(const css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR)
+XMLBasedAcceleratorConfiguration::XMLBasedAcceleratorConfiguration(const css::uno::Reference< css::uno::XComponentContext >& xContext)
     : ThreadHelpBase  (&Application::GetSolarMutex())
-    , m_xSMGR         (xSMGR                        )
-    , m_aPresetHandler(xSMGR                        )
+    , m_xContext      (xContext                     )
+    , m_aPresetHandler(xContext                     )
     , m_pWriteCache   (0                            )
 {
 }
@@ -485,7 +485,7 @@ void XMLBasedAcceleratorConfiguration::impl_ts_load(const css::uno::Reference< c
     // SAFE -> ----------------------------------
     WriteGuard aWriteLock(m_aLock);
 
-    css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR;
+    css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
     if (m_pWriteCache)
     {
         // be aware of reentrance problems - use temp variable for calling delete ... :-)
@@ -515,7 +515,7 @@ void XMLBasedAcceleratorConfiguration::impl_ts_load(const css::uno::Reference< c
     css::uno::Reference< css::xml::sax::XDocumentHandler > xFilter (static_cast< ::cppu::OWeakObject* >(pFilter), css::uno::UNO_QUERY_THROW);
 
     // connect parser, filter and stream
-    css::uno::Reference< css::xml::sax::XParser > xParser = css::xml::sax::Parser::create(comphelper::getComponentContext(xSMGR));
+    css::uno::Reference< css::xml::sax::XParser > xParser = css::xml::sax::Parser::create(xContext);
     xParser->setDocumentHandler(xFilter);
 
     css::xml::sax::InputSource aSource;
@@ -540,7 +540,7 @@ void XMLBasedAcceleratorConfiguration::impl_ts_save(const css::uno::Reference< c
         aCache.takeOver(*m_pWriteCache);
     else
         aCache.takeOver(m_aReadCache);
-    css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR;
+    css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
 
     aReadLock.unlock();
     // <- SAFE ----------------------------------
@@ -554,7 +554,7 @@ void XMLBasedAcceleratorConfiguration::impl_ts_save(const css::uno::Reference< c
         xSeek->seek(0);
 
     // combine writer/cache/stream etcpp.
-    css::uno::Reference< css::xml::sax::XWriter > xWriter = css::xml::sax::Writer::create(comphelper::getComponentContext(xSMGR));
+    css::uno::Reference< css::xml::sax::XWriter > xWriter = css::xml::sax::Writer::create(xContext);
     xWriter->setOutputStream(xStream);
 
     // write into the stream
@@ -611,11 +611,11 @@ OUString XMLBasedAcceleratorConfiguration::impl_ts_getLocale() const
 {
     // 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::uno::XInterface >     xCFG      = fpc::ConfigurationHelper::openConfig( comphelper::getComponentContext(xSMGR),
+    css::uno::Reference< css::uno::XInterface >     xCFG      = fpc::ConfigurationHelper::openConfig( xContext,
         "/org.openoffice.Setup", "L10N", fpc::ConfigurationHelper::E_READONLY);
     css::uno::Reference< css::beans::XPropertySet > xProp     (xCFG, css::uno::UNO_QUERY_THROW);
     OUString                                 sISOLocale;
@@ -656,15 +656,15 @@ DEFINE_XINTERFACE_8(XCUBasedAcceleratorConfiguration                       ,
                     css::ui::XUIConfiguration           )
 
 //-----------------------------------------------
-XCUBasedAcceleratorConfiguration::XCUBasedAcceleratorConfiguration(const css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR)
+XCUBasedAcceleratorConfiguration::XCUBasedAcceleratorConfiguration(const css::uno::Reference< css::uno::XComponentContext >& xContext)
                                 : ThreadHelpBase  (&Application::GetSolarMutex())
-                                , m_xSMGR         (xSMGR                        )
+                                , m_xContext      (xContext                     )
                                 , m_pPrimaryWriteCache(0                        )
                                 , m_pSecondaryWriteCache(0                      )
 {
     const OUString CFG_ENTRY_ACCELERATORS("org.openoffice.Office.Accelerators");
     m_xCfg = css::uno::Reference< css::container::XNameAccess > (
-             ::comphelper::ConfigurationHelper::openConfig( comphelper::getComponentContext(m_xSMGR), CFG_ENTRY_ACCELERATORS, ::comphelper::ConfigurationHelper::E_ALL_LOCALES ),
+             ::comphelper::ConfigurationHelper::openConfig( m_xContext, CFG_ENTRY_ACCELERATORS, ::comphelper::ConfigurationHelper::E_ALL_LOCALES ),
              css::uno::UNO_QUERY );
 }
 
@@ -1105,7 +1105,7 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::storeToStorage(const css::uno::R
     if (xSeek.is())
         xSeek->seek(0);
 
-    css::uno::Reference< css::xml::sax::XWriter > xWriter = css::xml::sax::Writer::create(comphelper::getComponentContext(m_xSMGR));
+    css::uno::Reference< css::xml::sax::XWriter > xWriter = css::xml::sax::Writer::create(m_xContext);
     xWriter->setOutputStream(xOut);
 
     // write into the stream
@@ -1166,14 +1166,14 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::reset()
     if ( sConfig == "Global" )
     {
         m_xCfg = css::uno::Reference< css::container::XNameAccess > (
-            ::comphelper::ConfigurationHelper::openConfig( comphelper::getComponentContext(m_xSMGR), CFG_ENTRY_GLOBAL, ::comphelper::ConfigurationHelper::E_ALL_LOCALES ),
+            ::comphelper::ConfigurationHelper::openConfig( m_xContext, CFG_ENTRY_GLOBAL, ::comphelper::ConfigurationHelper::E_ALL_LOCALES ),
             css::uno::UNO_QUERY );
         XCUBasedAcceleratorConfiguration::reload();
     }
     else if ( sConfig == "Modules" )
     {
         m_xCfg = css::uno::Reference< css::container::XNameAccess > (
-            ::comphelper::ConfigurationHelper::openConfig( comphelper::getComponentContext(m_xSMGR), CFG_ENTRY_MODULES, ::comphelper::ConfigurationHelper::E_ALL_LOCALES ),
+            ::comphelper::ConfigurationHelper::openConfig( m_xContext, CFG_ENTRY_MODULES, ::comphelper::ConfigurationHelper::E_ALL_LOCALES ),
             css::uno::UNO_QUERY );
         XCUBasedAcceleratorConfiguration::reload();
     }
@@ -1672,11 +1672,11 @@ OUString XCUBasedAcceleratorConfiguration::impl_ts_getLocale() const
 {
     // 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::uno::XInterface >     xCFG      = fpc::ConfigurationHelper::openConfig( comphelper::getComponentContext(xSMGR),
+    css::uno::Reference< css::uno::XInterface >     xCFG      = fpc::ConfigurationHelper::openConfig( xContext,
         "/org.openoffice.Setup", "L10N", fpc::ConfigurationHelper::E_READONLY);
     css::uno::Reference< css::beans::XPropertySet > xProp     (xCFG, css::uno::UNO_QUERY_THROW);
     OUString                                 sISOLocale;
diff --git a/framework/source/accelerators/documentacceleratorconfiguration.cxx b/framework/source/accelerators/documentacceleratorconfiguration.cxx
index b28c478..2feca79 100644
--- a/framework/source/accelerators/documentacceleratorconfiguration.cxx
+++ b/framework/source/accelerators/documentacceleratorconfiguration.cxx
@@ -66,10 +66,10 @@ DEFINE_XTYPEPROVIDER_2_WITH_BASECLASS(DocumentAcceleratorConfiguration ,
                                       css::lang::XInitialization)
 //                                      css::ui::XUIConfigurationStorage)
 
-DEFINE_XSERVICEINFO_MULTISERVICE(DocumentAcceleratorConfiguration                   ,
-                                 ::cppu::OWeakObject                                ,
-                                 SERVICENAME_DOCUMENTACCELERATORCONFIGURATION       ,
-                                 IMPLEMENTATIONNAME_DOCUMENTACCELERATORCONFIGURATION)
+DEFINE_XSERVICEINFO_MULTISERVICE_2(DocumentAcceleratorConfiguration                   ,
+                                   ::cppu::OWeakObject                                ,
+                                   SERVICENAME_DOCUMENTACCELERATORCONFIGURATION       ,
+                                   IMPLEMENTATIONNAME_DOCUMENTACCELERATORCONFIGURATION)
 
 DEFINE_INIT_SERVICE(DocumentAcceleratorConfiguration,
                     {
@@ -82,8 +82,8 @@ DEFINE_INIT_SERVICE(DocumentAcceleratorConfiguration,
                    )
 
 //-----------------------------------------------
-DocumentAcceleratorConfiguration::DocumentAcceleratorConfiguration(const css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR)
-    : XMLBasedAcceleratorConfiguration(xSMGR)
+DocumentAcceleratorConfiguration::DocumentAcceleratorConfiguration(const css::uno::Reference< css::uno::XComponentContext >& xContext)
+    : XMLBasedAcceleratorConfiguration(xContext)
 {
 }
 
diff --git a/framework/source/accelerators/globalacceleratorconfiguration.cxx b/framework/source/accelerators/globalacceleratorconfiguration.cxx
index cc9a36f..1bc6c03 100644
--- a/framework/source/accelerators/globalacceleratorconfiguration.cxx
+++ b/framework/source/accelerators/globalacceleratorconfiguration.cxx
@@ -52,10 +52,10 @@ DEFINE_XTYPEPROVIDER_2_WITH_BASECLASS(GlobalAcceleratorConfiguration,
                                       css::lang::XServiceInfo       ,
                                       css::lang::XInitialization)
 
-DEFINE_XSERVICEINFO_MULTISERVICE(GlobalAcceleratorConfiguration                   ,
-                                 ::cppu::OWeakObject                              ,
-                                 DECLARE_ASCII("com.sun.star.ui.GlobalAcceleratorConfiguration"),
-                                 IMPLEMENTATIONNAME_GLOBALACCELERATORCONFIGURATION)
+DEFINE_XSERVICEINFO_MULTISERVICE_2(GlobalAcceleratorConfiguration                   ,
+                                   ::cppu::OWeakObject                              ,
+                                   DECLARE_ASCII("com.sun.star.ui.GlobalAcceleratorConfiguration"),
+                                   IMPLEMENTATIONNAME_GLOBALACCELERATORCONFIGURATION)
 
 DEFINE_INIT_SERVICE(GlobalAcceleratorConfiguration,
                     {
@@ -69,8 +69,8 @@ DEFINE_INIT_SERVICE(GlobalAcceleratorConfiguration,
                    )
 
 //-----------------------------------------------
-GlobalAcceleratorConfiguration::GlobalAcceleratorConfiguration(const css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR)
-    : XCUBasedAcceleratorConfiguration(xSMGR)
+GlobalAcceleratorConfiguration::GlobalAcceleratorConfiguration(const css::uno::Reference< css::uno::XComponentContext >& xContext)
+    : XCUBasedAcceleratorConfiguration(xContext)
 {
 }
 
diff --git a/framework/source/accelerators/moduleacceleratorconfiguration.cxx b/framework/source/accelerators/moduleacceleratorconfiguration.cxx
index 45305ed..8717e91 100644
--- a/framework/source/accelerators/moduleacceleratorconfiguration.cxx
+++ b/framework/source/accelerators/moduleacceleratorconfiguration.cxx
@@ -59,10 +59,10 @@ DEFINE_XTYPEPROVIDER_2_WITH_BASECLASS(ModuleAcceleratorConfiguration,
                                       css::lang::XServiceInfo       ,
                                       css::lang::XInitialization    )
 
-DEFINE_XSERVICEINFO_MULTISERVICE(ModuleAcceleratorConfiguration                   ,
-                                 ::cppu::OWeakObject                              ,
-                                 SERVICENAME_MODULEACCELERATORCONFIGURATION       ,
-                                 IMPLEMENTATIONNAME_MODULEACCELERATORCONFIGURATION)
+DEFINE_XSERVICEINFO_MULTISERVICE_2(ModuleAcceleratorConfiguration                   ,
+                                   ::cppu::OWeakObject                              ,
+                                   SERVICENAME_MODULEACCELERATORCONFIGURATION       ,
+                                   IMPLEMENTATIONNAME_MODULEACCELERATORCONFIGURATION)
 
 DEFINE_INIT_SERVICE(ModuleAcceleratorConfiguration,
                     {
@@ -75,8 +75,8 @@ DEFINE_INIT_SERVICE(ModuleAcceleratorConfiguration,
                    )
 
 //-----------------------------------------------
-ModuleAcceleratorConfiguration::ModuleAcceleratorConfiguration(const css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR)
-    : XCUBasedAcceleratorConfiguration(xSMGR)
+ModuleAcceleratorConfiguration::ModuleAcceleratorConfiguration(const css::uno::Reference< css::uno::XComponentContext >& xContext)
+    : XCUBasedAcceleratorConfiguration(xContext)
 {
     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen at sun.com", "ModuleAcceleratorConfiguration::ModuleAcceleratorConfiguration" );
 }
diff --git a/framework/source/accelerators/presethandler.cxx b/framework/source/accelerators/presethandler.cxx
index 7735ea5..6c6539d 100644
--- a/framework/source/accelerators/presethandler.cxx
+++ b/framework/source/accelerators/presethandler.cxx
@@ -97,9 +97,9 @@ OUString PresetHandler::RESOURCETYPE_STATUSBAR()
 }
 
 //-----------------------------------------------
-PresetHandler::PresetHandler(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR)
+PresetHandler::PresetHandler(const css::uno::Reference< css::uno::XComponentContext >& xContext)
     : ThreadHelpBase     (&Application::GetSolarMutex()        )
-    , m_xSMGR            (xSMGR                                )
+    , m_xContext         (xContext                                )
     , m_aSharedStorages  (                                     )
     , m_lDocumentStorages()
     , m_aLanguageTag     (LANGUAGE_USER_PRIV_NOTRANSLATE)
@@ -111,7 +111,7 @@ PresetHandler::PresetHandler(const PresetHandler& rCopy)
     : ThreadHelpBase     (&Application::GetSolarMutex()        )
     , m_aLanguageTag( rCopy.m_aLanguageTag)
 {
-    m_xSMGR                 = rCopy.m_xSMGR;
+    m_xContext              = rCopy.m_xContext;
     m_eConfigType           = rCopy.m_eConfigType;
     m_sResourceType         = rCopy.m_sResourceType;
     m_sModule               = rCopy.m_sModule;
@@ -222,12 +222,12 @@ css::uno::Reference< css::embed::XStorage > PresetHandler::getOrCreateRootStorag
 
     // 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::util::XPathSettings > xPathSettings =
-        css::util::PathSettings::create( comphelper::getComponentContext(xSMGR) );
+        css::util::PathSettings::create( xContext );
 
     OUString sShareLayer = xPathSettings->getBasePathShareLayer();
 
@@ -252,7 +252,7 @@ css::uno::Reference< css::embed::XStorage > PresetHandler::getOrCreateRootStorag
     lArgs[0] <<= sShareLayer;
     lArgs[1] <<= css::embed::ElementModes::READ | css::embed::ElementModes::NOCREATE;
 
-    css::uno::Reference< css::lang::XSingleServiceFactory > xStorageFactory = css::embed::FileSystemStorageFactory::create( comphelper::getComponentContext(xSMGR) );
+    css::uno::Reference< css::lang::XSingleServiceFactory > xStorageFactory = css::embed::FileSystemStorageFactory::create( xContext );
     css::uno::Reference< css::embed::XStorage >             xStorage;
 
     try
@@ -280,12 +280,12 @@ css::uno::Reference< css::embed::XStorage > PresetHandler::getOrCreateRootStorag
 
     // 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::util::XPathSettings > xPathSettings =
-        css::util::PathSettings::create( comphelper::getComponentContext(xSMGR) );
+        css::util::PathSettings::create( xContext );
 
     OUString sUserLayer = xPathSettings->getBasePathUserLayer();
 
@@ -300,7 +300,7 @@ css::uno::Reference< css::embed::XStorage > PresetHandler::getOrCreateRootStorag
     lArgs[0] <<= sUserLayer;
     lArgs[1] <<= css::embed::ElementModes::READWRITE;
 
-    css::uno::Reference< css::lang::XSingleServiceFactory > xStorageFactory = css::embed::FileSystemStorageFactory::create( comphelper::getComponentContext(xSMGR) );
+    css::uno::Reference< css::lang::XSingleServiceFactory > xStorageFactory = css::embed::FileSystemStorageFactory::create( xContext );
     css::uno::Reference< css::embed::XStorage >             xStorage;
 
     try
diff --git a/framework/source/inc/accelerators/acceleratorconfiguration.hxx b/framework/source/inc/accelerators/acceleratorconfiguration.hxx
index f4e77e5..ff30b44 100644
--- a/framework/source/inc/accelerators/acceleratorconfiguration.hxx
+++ b/framework/source/inc/accelerators/acceleratorconfiguration.hxx
@@ -85,7 +85,7 @@ class XMLBasedAcceleratorConfiguration : protected ThreadHelpBase
         //---------------------------------------
         /** the global uno service manager.
         Must be used to create own needed services. */
-        css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR;
+        css::uno::Reference< css::uno::XComponentContext > m_xContext;
 
         //---------------------------------------
         /** used to:
@@ -108,7 +108,7 @@ class XMLBasedAcceleratorConfiguration : protected ThreadHelpBase
 
     public:
 
-        XMLBasedAcceleratorConfiguration( const css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR );
+        XMLBasedAcceleratorConfiguration( const css::uno::Reference< css::uno::XComponentContext >& xContext);
         virtual ~XMLBasedAcceleratorConfiguration(                                                                    );
 
         //______________________________________
@@ -304,7 +304,7 @@ class XCUBasedAcceleratorConfiguration : protected ThreadHelpBase
         //---------------------------------------
         /** the global uno service manager.
         Must be used to create own needed services. */
-        css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR;
+        css::uno::Reference< css::uno::XComponentContext > m_xContext;
 
         css::uno::Reference< css::container::XNameAccess > m_xCfg;
         AcceleratorCache m_aPrimaryReadCache;
@@ -322,7 +322,7 @@ class XCUBasedAcceleratorConfiguration : protected ThreadHelpBase
 
     public:
 
-        XCUBasedAcceleratorConfiguration( const css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR );
+        XCUBasedAcceleratorConfiguration( const css::uno::Reference< css::uno::XComponentContext >& xContext );
         virtual ~XCUBasedAcceleratorConfiguration(                                                           );
 
         //______________________________________
diff --git a/framework/source/inc/accelerators/documentacceleratorconfiguration.hxx b/framework/source/inc/accelerators/documentacceleratorconfiguration.hxx
index 2bddcc5..d6283f0 100644
--- a/framework/source/inc/accelerators/documentacceleratorconfiguration.hxx
+++ b/framework/source/inc/accelerators/documentacceleratorconfiguration.hxx
@@ -67,7 +67,7 @@ class DocumentAcceleratorConfiguration : public XMLBasedAcceleratorConfiguration
             @param  xSMGR
                     reference to an uno service manager, which is used internaly.
          */
-        DocumentAcceleratorConfiguration(const css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR);
+        DocumentAcceleratorConfiguration(const css::uno::Reference< css::uno::XComponentContext >& xContext);
         virtual ~DocumentAcceleratorConfiguration();
 
         // XInterface, XTypeProvider, XServiceInfo
diff --git a/framework/source/inc/accelerators/globalacceleratorconfiguration.hxx b/framework/source/inc/accelerators/globalacceleratorconfiguration.hxx
index 2d0e330..3f8a6c6 100644
--- a/framework/source/inc/accelerators/globalacceleratorconfiguration.hxx
+++ b/framework/source/inc/accelerators/globalacceleratorconfiguration.hxx
@@ -54,7 +54,7 @@ class GlobalAcceleratorConfiguration : public XCUBasedAcceleratorConfiguration
             @param  xSMGR
                     reference to an uno service manager, which is used internaly.
          */
-        GlobalAcceleratorConfiguration(const css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR);
+        GlobalAcceleratorConfiguration(const css::uno::Reference< css::uno::XComponentContext >& xContext);
 
         //----------------------------------
         /** TODO */
diff --git a/framework/source/inc/accelerators/moduleacceleratorconfiguration.hxx b/framework/source/inc/accelerators/moduleacceleratorconfiguration.hxx
index 8ff1c94..816d2d8 100644
--- a/framework/source/inc/accelerators/moduleacceleratorconfiguration.hxx
+++ b/framework/source/inc/accelerators/moduleacceleratorconfiguration.hxx
@@ -65,7 +65,7 @@ class ModuleAcceleratorConfiguration : public XCUBasedAcceleratorConfiguration
             @param  xSMGR
                     reference to an uno service manager, which is used internaly.
          */
-        ModuleAcceleratorConfiguration(const css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR);
+        ModuleAcceleratorConfiguration(const css::uno::Reference< css::uno::XComponentContext >& xContext);
 
         //----------------------------------
         /** TODO */
diff --git a/framework/source/inc/accelerators/presethandler.hxx b/framework/source/inc/accelerators/presethandler.hxx
index 30ef101..7cb7ea0 100644
--- a/framework/source/inc/accelerators/presethandler.hxx
+++ b/framework/source/inc/accelerators/presethandler.hxx
@@ -119,7 +119,7 @@ class PresetHandler : private ThreadHelpBase // attention! Must be the first bas
 
         //---------------------------------------
         /** @short  can be used to create on needed uno resources. */
-        css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR;
+        css::uno::Reference< css::uno::XComponentContext > m_xContext;
 
         //---------------------------------------
         /** @short  knows the type of provided configuration.
@@ -225,11 +225,11 @@ class PresetHandler : private ThreadHelpBase // attention! Must be the first bas
                     with ::salhelper::SingletonRef template this ctor
                     cant have any special parameters!
 
-            @param  xSMGR
+            @param  xContext
                     points to an uno service manager, which is used internaly
                     to create own needed uno resources.
          */
-        PresetHandler(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR);
+        PresetHandler(const css::uno::Reference< css::uno::XComponentContext >& xContext);
 
         //---------------------------------------
         /** @short  copy ctor */
diff --git a/framework/source/jobs/job.cxx b/framework/source/jobs/job.cxx
index 22d286c..0629df3 100644
--- a/framework/source/jobs/job.cxx
+++ b/framework/source/jobs/job.cxx
@@ -58,19 +58,19 @@ DEFINE_XTYPEPROVIDER_4( Job                           ,
                 Specialized information (e.g. the alias or service name ofthis job) will be set
                 later using the method setJobData().
 
-    @param      xSMGR
+    @param      xContext
                 reference to the uno service manager
 
     @param      xFrame
                 reference to the frame, in which environment we run
                 (May be null!)
 */
-Job::Job( /*IN*/ const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR  ,
+Job::Job( /*IN*/ const css::uno::Reference< css::uno::XComponentContext >& xContext  ,
           /*IN*/ const css::uno::Reference< css::frame::XFrame >&              xFrame )
     : ThreadHelpBase       (&Application::GetSolarMutex())
     , ::cppu::OWeakObject  (                             )
-    , m_aJobCfg            (comphelper::getComponentContext(xSMGR))
-    , m_xSMGR              (xSMGR                        )
+    , m_aJobCfg            (xContext                     )
+    , m_xContext           (xContext                     )
     , m_xFrame             (xFrame                       )
     , m_bListenOnDesktop   (sal_False                    )
     , m_bListenOnFrame     (sal_False                    )
@@ -88,19 +88,19 @@ Job::Job( /*IN*/ const css::uno::Reference< css::lang::XMultiServiceFactory >& x
                 Specialized information (e.g. the alias or service name ofthis job) will be set
                 later using the method setJobData().
 
-    @param      xSMGR
+    @param      xContext
                 reference to the uno service manager
 
     @param      xModel
                 reference to the model, in which environment we run
                 (May be null!)
 */
-Job::Job( /*IN*/ const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR  ,
+Job::Job( /*IN*/ const css::uno::Reference< css::uno::XComponentContext >& xContext  ,
           /*IN*/ const css::uno::Reference< css::frame::XModel >&              xModel )
     : ThreadHelpBase       (&Application::GetSolarMutex())
     , ::cppu::OWeakObject  (                             )
-    , m_aJobCfg            (comphelper::getComponentContext(xSMGR))
-    , m_xSMGR              (xSMGR                        )
+    , m_aJobCfg            (xContext                     )
+    , m_xContext           (xContext                     )
     , m_xModel             (xModel                       )
     , m_bListenOnDesktop   (sal_False                    )
     , m_bListenOnFrame     (sal_False                    )
@@ -212,7 +212,7 @@ void Job::execute( /*IN*/ const css::uno::Sequence< css::beans::NamedValue >& lD
         // create the job
         // We must check for the supported interface on demand!
         // But we preferr the synchronous one ...
-        m_xJob = m_xSMGR->createInstance(m_aJobCfg.getService());
+        m_xJob = m_xContext->getServiceManager()->createInstanceWithContext(m_aJobCfg.getService(), m_xContext);
         xSJob  = css::uno::Reference< css::task::XJob >(m_xJob, css::uno::UNO_QUERY);
         if (!xSJob.is())
             xAJob = css::uno::Reference< css::task::XAsyncJob >(m_xJob, css::uno::UNO_QUERY);
@@ -542,7 +542,7 @@ void Job::impl_startListening()
     {
         try
         {
-            m_xDesktop = css::frame::Desktop::create( comphelper::getComponentContext(m_xSMGR) );
+            m_xDesktop = css::frame::Desktop::create( m_xContext );
             css::uno::Reference< css::frame::XTerminateListener > xThis(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY);
             m_xDesktop->addTerminateListener(xThis);
             m_bListenOnDesktop = sal_True;
diff --git a/framework/source/jobs/jobdispatch.cxx b/framework/source/jobs/jobdispatch.cxx
index d66feca..adc4690 100644
--- a/framework/source/jobs/jobdispatch.cxx
+++ b/framework/source/jobs/jobdispatch.cxx
@@ -55,11 +55,11 @@ DEFINE_XTYPEPROVIDER_6( JobDispatch                   ,
                         css::frame::XDispatch
                       )
 
-DEFINE_XSERVICEINFO_MULTISERVICE( JobDispatch                   ,
-                                  ::cppu::OWeakObject           ,
-                                  SERVICENAME_PROTOCOLHANDLER   ,
-                                  IMPLEMENTATIONNAME_JOBDISPATCH
-                                )
+DEFINE_XSERVICEINFO_MULTISERVICE_2( JobDispatch                   ,
+                                    ::cppu::OWeakObject           ,
+                                    SERVICENAME_PROTOCOLHANDLER   ,
+                                    IMPLEMENTATIONNAME_JOBDISPATCH
+                                  )
 
 DEFINE_INIT_SERVICE( JobDispatch,
                      {
@@ -76,13 +76,13 @@ DEFINE_INIT_SERVICE( JobDispatch,
     @short      standard ctor
     @descr      It initialize this new instance.
 
-    @param      xSMGR
+    @param      xContext
                     reference to the uno service manager
 */
-JobDispatch::JobDispatch( /*IN*/ const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR )
+JobDispatch::JobDispatch( /*IN*/ const css::uno::Reference< css::uno::XComponentContext >& xContext )
     : ThreadHelpBase(&Application::GetSolarMutex())
     , OWeakObject   (                             )
-    , m_xSMGR       (xSMGR                        )
+    , m_xContext    (xContext                        )
 {
 }
 
@@ -94,8 +94,8 @@ JobDispatch::JobDispatch( /*IN*/ const css::uno::Reference< css::lang::XMultiSer
 JobDispatch::~JobDispatch()
 {
     // release all used resources
-    m_xSMGR  = css::uno::Reference< css::lang::XMultiServiceFactory >();
-    m_xFrame = css::uno::Reference< css::frame::XFrame >();
+    m_xContext.clear();
+    m_xFrame.clear();
 }
 
 //________________________________
@@ -121,7 +121,7 @@ void SAL_CALL JobDispatch::initialize( const css::uno::Sequence< css::uno::Any >
             lArguments[a] >>= m_xFrame;
 
             css::uno::Reference< css::frame::XModuleManager2 > xModuleManager =
-                css::frame::ModuleManager::create(comphelper::getComponentContext(m_xSMGR));
+                css::frame::ModuleManager::create(m_xContext);
             try
             {
                 m_sModuleIdentifier = xModuleManager->identify( m_xFrame );
@@ -262,7 +262,7 @@ void JobDispatch::impl_dispatchEvent( /*IN*/ const OUString&
     // filter disabled jobs using it's time stamp values.
     /* SAFE { */
     ReadGuard aReadLock(m_aLock);
-    css::uno::Sequence< OUString > lJobs = JobData::getEnabledJobsForEvent(comphelper::getComponentContext(m_xSMGR), sEvent);
+    css::uno::Sequence< OUString > lJobs = JobData::getEnabledJobsForEvent(m_xContext, sEvent);
     aReadLock.unlock();
     /* } SAFE */
 
@@ -279,7 +279,7 @@ void JobDispatch::impl_dispatchEvent( /*IN*/ const OUString&
         /* SAFE { */
         aReadLock.lock();
 
-        JobData aCfg(comphelper::getComponentContext(m_xSMGR));
+        JobData aCfg(m_xContext);
         aCfg.setEvent(sEvent, lJobs[j]);
         aCfg.setEnvironment(JobData::E_DISPATCH);
         const bool bIsEnabled=aCfg.hasCorrectContext(m_sModuleIdentifier);
@@ -289,7 +289,7 @@ void JobDispatch::impl_dispatchEvent( /*IN*/ const OUString&
             And freeing of such uno object is done by uno itself.
             So we have to use dynamic memory everytimes.
          */
-        Job* pJob = new Job(m_xSMGR, m_xFrame);
+        Job* pJob = new Job(m_xContext, m_xFrame);
         css::uno::Reference< css::uno::XInterface > xJob(static_cast< ::cppu::OWeakObject* >(pJob), css::uno::UNO_QUERY);
         pJob->setJobData(aCfg);
 
@@ -343,7 +343,7 @@ void JobDispatch::impl_dispatchService( /*IN*/ const OUString&
     /* SAFE { */
     ReadGuard aReadLock(m_aLock);
 
-    JobData aCfg(comphelper::getComponentContext(m_xSMGR));
+    JobData aCfg(m_xContext);
     aCfg.setService(sService);
     aCfg.setEnvironment(JobData::E_DISPATCH);
 
@@ -352,7 +352,7 @@ void JobDispatch::impl_dispatchService( /*IN*/ const OUString&
         And freeing of such uno object is done by uno itself.
         So we have to use dynamic memory everytimes.
      */
-    Job* pJob = new Job(m_xSMGR, m_xFrame);
+    Job* pJob = new Job(m_xContext, m_xFrame);
     css::uno::Reference< css::uno::XInterface > xJob(static_cast< ::cppu::OWeakObject* >(pJob), css::uno::UNO_QUERY);
     pJob->setJobData(aCfg);
 
@@ -394,7 +394,7 @@ void JobDispatch::impl_dispatchAlias( /*IN*/ const OUString&
     /* SAFE { */
     ReadGuard aReadLock(m_aLock);
 
-    JobData aCfg(comphelper::getComponentContext(m_xSMGR));
+    JobData aCfg(m_xContext);
     aCfg.setAlias(sAlias);
     aCfg.setEnvironment(JobData::E_DISPATCH);
 
@@ -403,7 +403,7 @@ void JobDispatch::impl_dispatchAlias( /*IN*/ const OUString&
         And freeing of such uno object is done by uno itself.
         So we have to use dynamic memory everytimes.
      */
-    Job* pJob = new Job(m_xSMGR, m_xFrame);
+    Job* pJob = new Job(m_xContext, m_xFrame);
     css::uno::Reference< css::uno::XInterface > xJob(static_cast< ::cppu::OWeakObject* >(pJob), css::uno::UNO_QUERY);
     pJob->setJobData(aCfg);
 
diff --git a/framework/source/jobs/jobexecutor.cxx b/framework/source/jobs/jobexecutor.cxx
index 54fe846..6d6de63 100644
--- a/framework/source/jobs/jobexecutor.cxx
+++ b/framework/source/jobs/jobexecutor.cxx
@@ -62,15 +62,15 @@ DEFINE_XTYPEPROVIDER_6( JobExecutor                       ,
                         css::lang::XEventListener
                       )
 
-DEFINE_XSERVICEINFO_ONEINSTANCESERVICE( JobExecutor                   ,
-                                        ::cppu::OWeakObject           ,
-                                        "com.sun.star.task.JobExecutor",
-                                        IMPLEMENTATIONNAME_JOBEXECUTOR
-                                      )
+DEFINE_XSERVICEINFO_ONEINSTANCESERVICE_2( JobExecutor                   ,
+                                          ::cppu::OWeakObject           ,
+                                          "com.sun.star.task.JobExecutor",
+                                          IMPLEMENTATIONNAME_JOBEXECUTOR
+                                        )
 
 DEFINE_INIT_SERVICE( JobExecutor,
                      {
-                         m_xModuleManager = css::frame::ModuleManager::create( comphelper::getComponentContext(m_xSMGR) );
+                         m_xModuleManager = css::frame::ModuleManager::create( m_xContext );
 
                          /*Attention
                              I think we don't need any mutex or lock here ... because we are called by our own static method impl_createInstance()
@@ -109,15 +109,15 @@ DEFINE_INIT_SERVICE( JobExecutor,
     @short      standard ctor
     @descr      It initialize this new instance.
 
-    @param      xSMGR
+    @param      xContext
                     reference to the uno service manager
  */
-JobExecutor::JobExecutor( /*IN*/ const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR )
+JobExecutor::JobExecutor( /*IN*/ const css::uno::Reference< css::uno::XComponentContext >& xContext )
     : ThreadHelpBase      (&Application::GetSolarMutex()                                   )
     , ::cppu::OWeakObject (                                                                )
-    , m_xSMGR             (xSMGR                                                           )
+    , m_xContext          (xContext                                                        )
     , m_xModuleManager    (                                                                )
-    , m_aConfig           (comphelper::getComponentContext(xSMGR), OUString::createFromAscii(JobData::EVENTCFG_ROOT) )
+    , m_aConfig           (xContext, OUString::createFromAscii(JobData::EVENTCFG_ROOT) )
 {
     // Don't do any reference related code here! Do it inside special
     // impl_ method() ... see DEFINE_INIT_SERVICE() macro for further information.
@@ -157,7 +157,7 @@ void SAL_CALL JobExecutor::trigger( const OUString& sEvent ) throw(css::uno::Run
     // get list of all enabled jobs
     // The called static helper methods read it from the configuration and
     // filter disabled jobs using it's time stamp values.
-    css::uno::Sequence< OUString > lJobs = JobData::getEnabledJobsForEvent(comphelper::getComponentContext(m_xSMGR), sEvent);
+    css::uno::Sequence< OUString > lJobs = JobData::getEnabledJobsForEvent(m_xContext, sEvent);
 
     aReadLock.unlock();
     /* } SAFE */
@@ -169,7 +169,7 @@ void SAL_CALL JobExecutor::trigger( const OUString& sEvent ) throw(css::uno::Run
         /* SAFE { */
         aReadLock.lock();
 
-        JobData aCfg(comphelper::getComponentContext(m_xSMGR));
+        JobData aCfg(m_xContext);
         aCfg.setEvent(sEvent, lJobs[j]);
         aCfg.setEnvironment(JobData::E_EXECUTION);
 

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list