[Libreoffice-commits] core.git: 7 commits - connectivity/source filter/source framework/inc framework/source include/svtools reportdesign/source svtools/source

Noel Grandin noel at peralex.com
Wed May 22 06:21:13 PDT 2013


 connectivity/source/drivers/calc/CConnection.cxx                |    2 
 connectivity/source/drivers/calc/CDriver.cxx                    |    3 
 connectivity/source/drivers/dbase/DDriver.cxx                   |    3 
 connectivity/source/drivers/file/FDatabaseMetaData.cxx          |    2 
 connectivity/source/drivers/file/FDriver.cxx                    |    4 
 connectivity/source/drivers/file/FStatement.cxx                 |    2 
 connectivity/source/drivers/flat/EDriver.cxx                    |    3 
 connectivity/source/drivers/flat/ETable.cxx                     |    8 -
 connectivity/source/inc/calc/CDriver.hxx                        |    4 
 connectivity/source/inc/dbase/DDriver.hxx                       |    2 
 connectivity/source/inc/file/FDriver.hxx                        |    6 
 connectivity/source/inc/flat/EDriver.hxx                        |    2 
 filter/source/xsltfilter/LibXSLTTransformer.cxx                 |    6 
 filter/source/xsltfilter/LibXSLTTransformer.hxx                 |   10 -
 filter/source/xsltfilter/OleHandler.cxx                         |   13 +
 filter/source/xsltfilter/OleHandler.hxx                         |    6 
 filter/source/xsltfilter/XSLTFilter.cxx                         |    2 
 framework/inc/classes/droptargetlistener.hxx                    |    4 
 framework/inc/classes/propertysethelper.hxx                     |   10 -
 framework/inc/classes/taskcreator.hxx                           |    6 
 framework/inc/dispatch/closedispatcher.hxx                      |   12 -
 framework/inc/dispatch/dispatchinformationprovider.hxx          |    6 
 framework/inc/dispatch/dispatchprovider.hxx                     |    4 
 framework/inc/helper/oframes.hxx                                |   12 -
 framework/inc/helper/uiconfigelementwrapperbase.hxx             |    6 
 framework/inc/services/frame.hxx                                |   12 -
 framework/inc/uiconfiguration/imagemanager.hxx                  |    2 
 framework/inc/uielement/genericstatusbarcontroller.hxx          |    2 
 framework/inc/uielement/langselectionstatusbarcontroller.hxx    |    2 
 framework/inc/uielement/menubarwrapper.hxx                      |    3 
 framework/inc/uielement/statusbarmanager.hxx                    |    8 -
 framework/inc/uielement/statusbarwrapper.hxx                    |    5 
 framework/inc/uielement/toolbarwrapper.hxx                      |    4 
 framework/source/classes/droptargetlistener.cxx                 |   16 +-
 framework/source/classes/taskcreator.cxx                        |   18 +-
 framework/source/dispatch/closedispatcher.cxx                   |   26 +--
 framework/source/dispatch/dispatchinformationprovider.cxx       |   17 +-
 framework/source/dispatch/dispatchprovider.cxx                  |   25 +--
 framework/source/dispatch/loaddispatcher.cxx                    |   10 -
 framework/source/dispatch/windowcommanddispatch.cxx             |   10 -
 framework/source/fwi/classes/propertysethelper.cxx              |    6 
 framework/source/helper/oframes.cxx                             |   11 -
 framework/source/helper/uiconfigelementwrapperbase.cxx          |    3 
 framework/source/inc/dispatch/loaddispatcher.hxx                |    8 -
 framework/source/inc/dispatch/windowcommanddispatch.hxx         |    6 
 framework/source/inc/loadenv/loadenv.hxx                        |    8 -
 framework/source/loadenv/loadenv.cxx                            |   49 +++----
 framework/source/services/backingcomp.cxx                       |    2 
 framework/source/services/desktop.cxx                           |   10 -
 framework/source/services/frame.cxx                             |   69 ++++------
 framework/source/services/tabwindowservice.cxx                  |    3 
 framework/source/uiconfiguration/imagemanager.cxx               |    6 
 framework/source/uiconfiguration/uiconfigurationmanager.cxx     |    4 
 framework/source/uielement/addonstoolbarmanager.cxx             |    1 
 framework/source/uielement/genericstatusbarcontroller.cxx       |    4 
 framework/source/uielement/langselectionstatusbarcontroller.cxx |   14 --
 framework/source/uielement/menubarwrapper.cxx                   |   13 +
 framework/source/uielement/statusbarmanager.cxx                 |   22 +--
 framework/source/uielement/statusbarwrapper.cxx                 |    9 -
 framework/source/uielement/toolbarmanager.cxx                   |    1 
 framework/source/uielement/toolbarwrapper.cxx                   |    7 -
 framework/source/uifactory/menubarfactory.cxx                   |    2 
 framework/source/uifactory/statusbarfactory.cxx                 |    2 
 framework/source/uifactory/toolboxfactory.cxx                   |    2 
 include/svtools/statusbarcontroller.hxx                         |   10 -
 reportdesign/source/ui/inc/statusbarcontroller.hxx              |    2 
 reportdesign/source/ui/misc/statusbarcontroller.cxx             |    8 -
 svtools/source/uno/statusbarcontroller.cxx                      |   26 ++-
 68 files changed, 298 insertions(+), 308 deletions(-)

New commits:
commit a726677724a5a8dd6ae39d5a7a829c2ed62f3efd
Author: Noel Grandin <noel at peralex.com>
Date:   Wed May 22 11:08:43 2013 +0200

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

diff --git a/framework/inc/uielement/genericstatusbarcontroller.hxx b/framework/inc/uielement/genericstatusbarcontroller.hxx
index bc4a71d..59548a2 100644
--- a/framework/inc/uielement/genericstatusbarcontroller.hxx
+++ b/framework/inc/uielement/genericstatusbarcontroller.hxx
@@ -30,7 +30,7 @@ struct AddonStatusbarItemData;
 class GenericStatusbarController : public svt::StatusbarController
 {
     public:
-        GenericStatusbarController( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rServiceManager,
+        GenericStatusbarController( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext,
                                     const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rFrame,
                                     const com::sun::star::uno::Reference< com::sun::star::ui::XStatusbarItem >& rxItem,
                                     AddonStatusbarItemData *pItemData );
diff --git a/framework/inc/uielement/langselectionstatusbarcontroller.hxx b/framework/inc/uielement/langselectionstatusbarcontroller.hxx
index 71896ef..0f7a77d 100644
--- a/framework/inc/uielement/langselectionstatusbarcontroller.hxx
+++ b/framework/inc/uielement/langselectionstatusbarcontroller.hxx
@@ -42,7 +42,7 @@ namespace framework {
 class LangSelectionStatusbarController : public svt::StatusbarController
 {
     public:
-        explicit LangSelectionStatusbarController( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
+        explicit LangSelectionStatusbarController( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext );
 
         // XServiceInfo
         DECLARE_XSERVICEINFO
diff --git a/framework/source/uielement/addonstoolbarmanager.cxx b/framework/source/uielement/addonstoolbarmanager.cxx
index 0bde95d..6723b95 100644
--- a/framework/source/uielement/addonstoolbarmanager.cxx
+++ b/framework/source/uielement/addonstoolbarmanager.cxx
@@ -41,6 +41,7 @@
 #include <com/sun/star/frame/XToolbarController.hpp>
 #include <com/sun/star/frame/XDispatchProvider.hpp>
 #include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <com/sun/star/frame/XLayoutManager.hpp>
 #include <com/sun/star/ui/DockingArea.hpp>
 #include <com/sun/star/lang/XMultiComponentFactory.hpp>
diff --git a/framework/source/uielement/genericstatusbarcontroller.cxx b/framework/source/uielement/genericstatusbarcontroller.cxx
index 4b4d721..4140ab8 100644
--- a/framework/source/uielement/genericstatusbarcontroller.cxx
+++ b/framework/source/uielement/genericstatusbarcontroller.cxx
@@ -43,11 +43,11 @@ namespace framework
 {
 
 GenericStatusbarController::GenericStatusbarController(
-    const Reference< XMultiServiceFactory >& rxServiceManager,
+    const Reference< XComponentContext >& rxContext,
     const Reference< XFrame >& rxFrame,
     const Reference< ui::XStatusbarItem >& rxItem,
     AddonStatusbarItemData *pItemData )
-    : svt::StatusbarController( rxServiceManager, rxFrame, OUString(), 0 )
+    : svt::StatusbarController( rxContext, rxFrame, OUString(), 0 )
     , m_bEnabled( sal_False )
     , m_bOwnerDraw( sal_False )
     , m_pItemData( pItemData )
diff --git a/framework/source/uielement/langselectionstatusbarcontroller.cxx b/framework/source/uielement/langselectionstatusbarcontroller.cxx
index 09c0a3d..8773c81 100644
--- a/framework/source/uielement/langselectionstatusbarcontroller.cxx
+++ b/framework/source/uielement/langselectionstatusbarcontroller.cxx
@@ -44,8 +44,6 @@
 #include <com/sun/star/frame/XFrame.hpp>
 #include <com/sun/star/frame/XDispatch.hpp>
 #include <com/sun/star/frame/XDispatchProvider.hpp>
-#include <com/sun/star/util/URLTransformer.hpp>
-#include <com/sun/star/util/XURLTransformer.hpp>
 #include <comphelper/processfactory.hxx>
 
 #include <toolkit/helper/vclunohelper.hxx>
@@ -75,7 +73,7 @@ using ::rtl::OUStringBuffer;
 namespace framework
 {
 
-DEFINE_XSERVICEINFO_MULTISERVICE        (   LangSelectionStatusbarController            ,
+DEFINE_XSERVICEINFO_MULTISERVICE_2      (   LangSelectionStatusbarController            ,
                                             OWeakObject                             ,
                                             SERVICENAME_STATUSBARCONTROLLER         ,
                                             IMPLEMENTATIONNAME_LANGSELECTIONSTATUSBARCONTROLLER
@@ -83,11 +81,11 @@ DEFINE_XSERVICEINFO_MULTISERVICE        (   LangSelectionStatusbarController
 
 DEFINE_INIT_SERVICE                     (   LangSelectionStatusbarController, {} )
 
-LangSelectionStatusbarController::LangSelectionStatusbarController( const uno::Reference< lang::XMultiServiceFactory >& xServiceManager ) :
-    svt::StatusbarController( xServiceManager, uno::Reference< frame::XFrame >(), OUString(), 0 ),
+LangSelectionStatusbarController::LangSelectionStatusbarController( const uno::Reference< uno::XComponentContext >& xContext ) :
+    svt::StatusbarController( xContext, uno::Reference< frame::XFrame >(), OUString(), 0 ),
     m_bShowMenu( sal_True ),
     m_nScriptType( LS_SCRIPT_LATIN | LS_SCRIPT_ASIAN | LS_SCRIPT_COMPLEX ),
-    m_aLangGuessHelper( comphelper::getComponentContext(xServiceManager) )
+    m_aLangGuessHelper( xContext )
 {
 }
 
@@ -114,9 +112,9 @@ throw (::com::sun::star::uno::RuntimeException)
         return;
 
     //add context menu
-    Reference< awt::XPopupMenu > xPopupMenu( awt::PopupMenu::create( comphelper::getComponentContext(m_xServiceManager) ) );
+    Reference< awt::XPopupMenu > xPopupMenu( awt::PopupMenu::create( m_xContext ) );
     //sub menu that contains all items except the last two items: Separator + Set Language for Paragraph
-    Reference< awt::XPopupMenu > subPopupMenu( awt::PopupMenu::create( comphelper::getComponentContext(m_xServiceManager) ) );
+    Reference< awt::XPopupMenu > subPopupMenu( awt::PopupMenu::create( m_xContext ) );
 
     SvtLanguageTable    aLanguageTable;
 
diff --git a/framework/source/uielement/statusbarmanager.cxx b/framework/source/uielement/statusbarmanager.cxx
index b6ba246..2b096a5 100644
--- a/framework/source/uielement/statusbarmanager.cxx
+++ b/framework/source/uielement/statusbarmanager.cxx
@@ -421,7 +421,7 @@ void StatusBarManager::CreateControllers()
                 // 3º) Is Add-on? Generic statusbar controller
                 if ( pItemData )
                 {
-                    pController = new GenericStatusbarController( uno::Reference<lang::XMultiServiceFactory>(m_xContext->getServiceManager(), uno::UNO_QUERY_THROW),
+                    pController = new GenericStatusbarController( m_xContext,
                                                                   m_xFrame,
                                                                   xStatusbarItem,
                                                                   pItemData );
@@ -429,7 +429,7 @@ void StatusBarManager::CreateControllers()
                 else
                 {
                     // 4º) Default Statusbar controller
-                    pController = new svt::StatusbarController( uno::Reference<lang::XMultiServiceFactory>(m_xContext->getServiceManager(), uno::UNO_QUERY_THROW), m_xFrame, aCommandURL, nId );
+                    pController = new svt::StatusbarController( m_xContext, m_xFrame, aCommandURL, nId );
                 }
             }
 
diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx
index fdbb17b..2ddcda5 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -40,6 +40,7 @@
 #include <com/sun/star/ui/DockingArea.hpp>
 #include <com/sun/star/graphic/XGraphic.hpp>
 #include <com/sun/star/lang/XMultiComponentFactory.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <com/sun/star/frame/ModuleManager.hpp>
 #include <com/sun/star/frame/ToolbarControllerFactory.hpp>
 #include <com/sun/star/ui/GlobalAcceleratorConfiguration.hpp>
diff --git a/include/svtools/statusbarcontroller.hxx b/include/svtools/statusbarcontroller.hxx
index 9d094fa..3b0f5bd 100644
--- a/include/svtools/statusbarcontroller.hxx
+++ b/include/svtools/statusbarcontroller.hxx
@@ -21,13 +21,13 @@
 #define _SVTOOLS_STATUSBARCONTROLLER_HXX
 
 #include "svtools/svtdllapi.h"
-#include <com/sun/star/ui/XStatusbarItem.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <com/sun/star/frame/XFrame.hpp>
 #include <com/sun/star/frame/XDispatch.hpp>
 #include <com/sun/star/frame/XStatusbarController.hpp>
-#include <com/sun/star/util/XURLTransformer.hpp>
 #include <com/sun/star/frame/XLayoutManager.hpp>
+#include <com/sun/star/ui/XStatusbarItem.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/util/XURLTransformer.hpp>
 #include <cppuhelper/weak.hxx>
 #include <cppuhelper/interfacecontainer.hxx>
 #include <comphelper/broadcasthelper.hxx>
@@ -46,7 +46,7 @@ class SVT_DLLPUBLIC StatusbarController :
                             public ::cppu::OWeakObject
 {
     public:
-        StatusbarController( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rServiceManager,
+        StatusbarController( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext,
                              const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame,
                              const OUString& aCommandURL,
                              unsigned short       nID );
@@ -123,7 +123,7 @@ class SVT_DLLPUBLIC StatusbarController :
         unsigned short                                                                      m_nID;
         ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >                 m_xFrame;
         ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >                  m_xParentWindow;
-        ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >    m_xServiceManager;
+        ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >        m_xContext;
         OUString                                                                       m_aCommandURL;
         URLToDispatchMap                                                                    m_aListenerMap;
         ::cppu::OMultiTypeInterfaceContainerHelper                                          m_aListenerContainer;   /// container for ALL Listener
diff --git a/reportdesign/source/ui/inc/statusbarcontroller.hxx b/reportdesign/source/ui/inc/statusbarcontroller.hxx
index 6e6fda9..91ff232 100644
--- a/reportdesign/source/ui/inc/statusbarcontroller.hxx
+++ b/reportdesign/source/ui/inc/statusbarcontroller.hxx
@@ -37,7 +37,7 @@ namespace rptui
         sal_uInt16      m_nSlotId;
         sal_uInt16      m_nId;
     public:
-        OStatusbarController(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB);
+        OStatusbarController(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB);
 
         static OUString getImplementationName_Static() throw( ::com::sun::star::uno::RuntimeException );
         static ::com::sun::star::uno::Sequence< OUString > getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException );
diff --git a/reportdesign/source/ui/misc/statusbarcontroller.cxx b/reportdesign/source/ui/misc/statusbarcontroller.cxx
index 9bb946e..4294d5b 100644
--- a/reportdesign/source/ui/misc/statusbarcontroller.cxx
+++ b/reportdesign/source/ui/misc/statusbarcontroller.cxx
@@ -69,15 +69,15 @@ Sequence< OUString> SAL_CALL OStatusbarController::getSupportedServiceNames() th
 // -------------------------------------------------------------------------
 Reference< XInterface > OStatusbarController::create(Reference< XComponentContext > const & xContext)
 {
-    return *(new OStatusbarController(Reference< XMultiServiceFactory >(xContext->getServiceManager(),UNO_QUERY)));
+    return *(new OStatusbarController(xContext));
 }
 IMPLEMENT_FORWARD_XINTERFACE2(OStatusbarController, ::svt::StatusbarController,OStatusbarController_BASE)
 
-OStatusbarController::OStatusbarController(const Reference< XMultiServiceFactory >& _rxORB)
-: m_nSlotId(0)
+OStatusbarController::OStatusbarController(const Reference< XComponentContext >& rxContext)
+: ::svt::StatusbarController(rxContext, Reference< XFrame >(), OUString(), 0)
+,m_nSlotId(0)
 ,m_nId(1)
 {
-    m_xServiceManager = _rxORB;
 }
 // -----------------------------------------------------------------------------
 void SAL_CALL OStatusbarController::initialize( const Sequence< Any >& _rArguments ) throw (Exception, RuntimeException)
diff --git a/svtools/source/uno/statusbarcontroller.cxx b/svtools/source/uno/statusbarcontroller.cxx
index d93feed..2f6fbba 100644
--- a/svtools/source/uno/statusbarcontroller.cxx
+++ b/svtools/source/uno/statusbarcontroller.cxx
@@ -22,6 +22,7 @@
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/frame/XDispatchProvider.hpp>
 #include <com/sun/star/lang/DisposedException.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <com/sun/star/frame/XLayoutManager.hpp>
 #include <com/sun/star/util/URLTransformer.hpp>
 #include <osl/mutex.hxx>
@@ -45,7 +46,7 @@ namespace svt
 {
 
 StatusbarController::StatusbarController(
-    const Reference< XMultiServiceFactory >& rServiceManager,
+    const Reference< XComponentContext >& rxContext,
     const Reference< XFrame >& xFrame,
     const OUString& aCommandURL,
     unsigned short nID ) :
@@ -54,7 +55,7 @@ StatusbarController::StatusbarController(
     ,   m_bDisposed( sal_False )
     ,   m_nID( nID )
     ,   m_xFrame( xFrame )
-    ,   m_xServiceManager( rServiceManager )
+    ,   m_xContext( rxContext )
     ,   m_aCommandURL( aCommandURL )
     ,   m_aListenerContainer( m_aMutex )
 {
@@ -82,9 +83,9 @@ Reference< XFrame > StatusbarController::getFrameInterface() const
 Reference< XURLTransformer > StatusbarController::getURLTransformer() const
 {
     SolarMutexGuard aSolarMutexGuard;
-    if ( !m_xURLTransformer.is() && m_xServiceManager.is() )
+    if ( !m_xURLTransformer.is() && m_xContext.is() )
     {
-        m_xURLTransformer = com::sun::star::util::URLTransformer::create( ::comphelper::getComponentContext(m_xServiceManager) );
+        m_xURLTransformer = com::sun::star::util::URLTransformer::create( m_xContext );
     }
 
     return m_xURLTransformer;
@@ -148,7 +149,12 @@ throw ( Exception, RuntimeException )
                 else if ( aPropValue.Name == "CommandURL" )
                     aPropValue.Value >>= m_aCommandURL;
                 else if ( aPropValue.Name == "ServiceManager" )
-                    aPropValue.Value >>= m_xServiceManager;
+                {
+                    Reference<XMultiServiceFactory> xMSF;
+                    aPropValue.Value >>= xMSF;
+                    if( xMSF.is() )
+                        m_xContext = comphelper::getComponentContext(xMSF);
+                }
                 else if ( aPropValue.Name == "ParentWindow" )
                     aPropValue.Value >>= m_xParentWindow;
                 else if ( aPropValue.Name == "Identifier" )
@@ -219,7 +225,7 @@ throw (::com::sun::star::uno::RuntimeException)
 
     // release references
     m_xURLTransformer.clear();
-    m_xServiceManager.clear();
+    m_xContext.clear();
     m_xFrame.clear();
     m_xParentWindow.clear();
     m_xStatusbarItem.clear();
@@ -373,7 +379,7 @@ void StatusbarController::addStatusListener( const OUString& aCommandURL )
         {
             // Add status listener directly as intialize has already been called.
             Reference< XDispatchProvider > xDispatchProvider( m_xFrame, UNO_QUERY );
-            if ( m_xServiceManager.is() && xDispatchProvider.is() )
+            if ( m_xContext.is() && xDispatchProvider.is() )
             {
                 Reference< XURLTransformer > xURLTransformer = getURLTransformer();
                 aTargetURL.Complete = aCommandURL;
@@ -426,7 +432,7 @@ void StatusbarController::bindListener()
 
         // Collect all registered command URL's and store them temporary
         Reference< XDispatchProvider > xDispatchProvider( m_xFrame, UNO_QUERY );
-        if ( m_xServiceManager.is() && xDispatchProvider.is() )
+        if ( m_xContext.is() && xDispatchProvider.is() )
         {
             xStatusListener = Reference< XStatusListener >( static_cast< OWeakObject* >( this ), UNO_QUERY );
             URLToDispatchMap::iterator pIter = m_aListenerMap.begin();
@@ -533,7 +539,7 @@ void StatusbarController::execute( const ::com::sun::star::uno::Sequence< ::com:
 
         if ( m_bInitialized &&
              m_xFrame.is() &&
-             m_xServiceManager.is() &&
+             m_xContext.is() &&
              !m_aCommandURL.isEmpty() )
         {
             xURLTransformer = getURLTransformer();
@@ -575,7 +581,7 @@ void StatusbarController::execute(
 
         if ( m_bInitialized &&
              m_xFrame.is() &&
-             m_xServiceManager.is() &&
+             m_xContext.is() &&
              !m_aCommandURL.isEmpty() )
         {
             Reference< XURLTransformer > xURLTransformer( getURLTransformer() );
commit fe1ac1bf904ec7905187c3c3a5fe6a90f31f94e7
Author: Noel Grandin <noel at peralex.com>
Date:   Tue May 21 17:38:02 2013 +0200

    fdo#46808, convert XMultiServiceFactory to XComponentContext
    
    Change-Id: I5ed0b12bf37e7d235fc88182c006a6ed07ef2343

diff --git a/framework/inc/classes/droptargetlistener.hxx b/framework/inc/classes/droptargetlistener.hxx
index 0a71804..0a7e7d2 100644
--- a/framework/inc/classes/droptargetlistener.hxx
+++ b/framework/inc/classes/droptargetlistener.hxx
@@ -41,7 +41,7 @@ class DropTargetListener : private ThreadHelpBase
     private:
 
         /// uno service manager to create necessary services
-        css::uno::Reference< css::lang::XMultiServiceFactory > m_xFactory;
+        css::uno::Reference< css::uno::XComponentContext > m_xContext;
         /// weakreference to target frame (Don't use a hard reference. Owner can't delete us then!)
         css::uno::WeakReference< css::frame::XFrame > m_xTargetFrame;
         /// drag/drop info
@@ -51,7 +51,7 @@ class DropTargetListener : private ThreadHelpBase
     // c++ interface
     public:
 
-         DropTargetListener( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory ,
+         DropTargetListener( const css::uno::Reference< css::uno::XComponentContext >& xContext ,
                              const css::uno::Reference< css::frame::XFrame >& xFrame                );
         ~DropTargetListener(                                                                        );
 
diff --git a/framework/inc/classes/propertysethelper.hxx b/framework/inc/classes/propertysethelper.hxx
index f414cf6..2bc4109 100644
--- a/framework/inc/classes/propertysethelper.hxx
+++ b/framework/inc/classes/propertysethelper.hxx
@@ -26,7 +26,6 @@
 #include <general.h>
 #include <stdtypes.h>
 
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/beans/XPropertySetInfo.hpp>
 #include <com/sun/star/beans/PropertyExistException.hpp>
@@ -62,8 +61,6 @@ class FWI_DLLPUBLIC PropertySetHelper : public css::beans::XPropertySet
     /* member */
     protected:
 
-        css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR;
-
         PropertySetHelper::TPropInfoHash m_lProps;
 
         ListenerHash m_lSimpleChangeListener;
@@ -84,10 +81,6 @@ class FWI_DLLPUBLIC PropertySetHelper : public css::beans::XPropertySet
         //---------------------------------------------------------------------
         /** initialize new instance of this helper.
          *
-         *  @param  xSMGR
-         *          points to an uno service manager, which is used internaly to create own
-         *          needed uno services.
-         *
          *  @param  pExternalLock
          *          this helper must be used as a baseclass ...
          *          but then it should synchronize its own calls
@@ -101,8 +94,7 @@ class FWI_DLLPUBLIC PropertySetHelper : public css::beans::XPropertySet
          *  @param  bReleaseLockOnCall
          *          see member m_bReleaseLockOnCall
          */
-        PropertySetHelper(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR                       ,
-                                LockHelper*                                             pExternalLock               ,
+        PropertySetHelper(      LockHelper*                                             pExternalLock               ,
                                 TransactionManager*                                     pExternalTransactionManager ,
                                 sal_Bool                                                bReleaseLockOnCall          );
 
diff --git a/framework/inc/classes/taskcreator.hxx b/framework/inc/classes/taskcreator.hxx
index 44b5111..4a297f9 100644
--- a/framework/inc/classes/taskcreator.hxx
+++ b/framework/inc/classes/taskcreator.hxx
@@ -26,7 +26,7 @@
 #include <general.h>
 
 #include <com/sun/star/frame/XFramesSupplier.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
 
 #include <com/sun/star/uno/Reference.hxx>
 #include <rtl/ustring.hxx>
@@ -48,13 +48,13 @@ class TaskCreator : private ThreadHelpBase
     // member
     private:
 
-        css::uno::Reference< css::lang::XMultiServiceFactory >  m_xSMGR;
+        css::uno::Reference< css::uno::XComponentContext >  m_xContext;
 
     //_______________________
     // interface
     public:
 
-                 TaskCreator( const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR );
+                 TaskCreator( const css::uno::Reference< css::uno::XComponentContext >& xContext );
         virtual ~TaskCreator(                                                                     );
 
         css::uno::Reference< css::frame::XFrame > createTask( const OUString& sName    ,
diff --git a/framework/inc/dispatch/closedispatcher.hxx b/framework/inc/dispatch/closedispatcher.hxx
index 5b8860f..96ef71c 100644
--- a/framework/inc/dispatch/closedispatcher.hxx
+++ b/framework/inc/dispatch/closedispatcher.hxx
@@ -35,7 +35,7 @@
 #include <com/sun/star/frame/XDispatchInformationProvider.hpp>
 #include <com/sun/star/util/URL.hpp>
 #include <com/sun/star/frame/XDispatchResultListener.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
 #include <com/sun/star/frame/DispatchResultState.hpp>
 
 #include <cppuhelper/weak.hxx>
@@ -89,7 +89,7 @@ class CloseDispatcher : public css::lang::XTypeProvider
         /** @short reference to an uno service manager,
                    which can be used to create own needed
                    uno resources. */
-        css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR;
+        css::uno::Reference< css::uno::XComponentContext > m_xContext;
 
         //---------------------------------------
         /** @short  reference to the target frame, which should be
@@ -132,7 +132,7 @@ class CloseDispatcher : public css::lang::XTypeProvider
                     That makes an implementation (e.g. of listener support)
                     much more easier .-)
 
-            @param  xSMGR
+            @param  rxContext
                     an un oservice manager, which is needed to create uno resource
                     internaly.
 
@@ -142,9 +142,9 @@ class CloseDispatcher : public css::lang::XTypeProvider
             @param  sTarget
                     help us to find the right target for this close operation.
          */
-        CloseDispatcher(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR  ,
-                        const css::uno::Reference< css::frame::XFrame >&              xFrame ,
-                        const OUString&                                        sTarget);
+        CloseDispatcher(const css::uno::Reference< css::uno::XComponentContext >& rxContext  ,
+                        const css::uno::Reference< css::frame::XFrame >&          xFrame ,
+                        const OUString&                                           sTarget);
 
         //---------------------------------------
         /** @short  does nothing real. */
diff --git a/framework/inc/dispatch/dispatchinformationprovider.hxx b/framework/inc/dispatch/dispatchinformationprovider.hxx
index f39c680..cac9572 100644
--- a/framework/inc/dispatch/dispatchinformationprovider.hxx
+++ b/framework/inc/dispatch/dispatchinformationprovider.hxx
@@ -48,15 +48,15 @@ class DispatchInformationProvider : public  css::frame::XDispatchInformationProv
     // member
     private:
 
-        css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR;
+        css::uno::Reference< css::uno::XComponentContext > m_xContext;
         css::uno::WeakReference< css::frame::XFrame > m_xFrame;
 
     //_______________________
     // interface
     public:
 
-        DispatchInformationProvider(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR ,
-                                    const css::uno::Reference< css::frame::XFrame >&              xFrame);
+        DispatchInformationProvider(const css::uno::Reference< css::uno::XComponentContext >& xContext ,
+                                    const css::uno::Reference< css::frame::XFrame >&          xFrame);
 
         virtual ~DispatchInformationProvider();
 
diff --git a/framework/inc/dispatch/dispatchprovider.hxx b/framework/inc/dispatch/dispatchprovider.hxx
index 484e0fa..777463b 100644
--- a/framework/inc/dispatch/dispatchprovider.hxx
+++ b/framework/inc/dispatch/dispatchprovider.hxx
@@ -90,7 +90,7 @@ class DispatchProvider  :   // interfaces
     /* member */
     private:
         /// reference to global service manager to create new services
-        css::uno::Reference< css::lang::XMultiServiceFactory > m_xFactory;
+        css::uno::Reference< css::uno::XComponentContext > m_xContext;
         /// weakreference to owner frame (Don't use a hard reference. Owner can't delete us then!)
         css::uno::WeakReference< css::frame::XFrame > m_xFrame;
         /// different dispatcher to handle special dispatch calls, protocols or URLs (they will be created on demand.)
@@ -103,7 +103,7 @@ class DispatchProvider  :   // interfaces
         FWK_DECLARE_XINTERFACE
         FWK_DECLARE_XTYPEPROVIDER
 
-        DispatchProvider( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory ,
+        DispatchProvider( const css::uno::Reference< css::uno::XComponentContext >&     xContext ,
                           const css::uno::Reference< css::frame::XFrame >&              xFrame   );
 
         virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL                       queryDispatch  ( const css::util::URL&                                       aURL             ,
diff --git a/framework/inc/helper/oframes.hxx b/framework/inc/helper/oframes.hxx
index 04078b0..844a2f7 100644
--- a/framework/inc/helper/oframes.hxx
+++ b/framework/inc/helper/oframes.hxx
@@ -77,16 +77,14 @@ class OFrames   :   private ThreadHelpBase      ,   // Must be the first of base
 
             @seealso    -
 
-            @param      "xFactory"          , reference to factory which has created ouer owner(!). We can use these to create new uno-services.
-            @param      "xOwner"            , reference to ouer owner. We hold a wekreference to prevent us against cross-references!
-            @param      "pFrameContainer"   , pointer to shared framecontainer of owner. It's valid only, if weakreference is valid!
+            @param      xOwner            , reference to ouer owner. We hold a wekreference to prevent us against cross-references!
+            @param      pFrameContainer   , pointer to shared framecontainer of owner. It's valid only, if weakreference is valid!
             @return     -
 
             @onerror    -
         *//*-*****************************************************************************************************/
 
-         OFrames(   const   css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory        ,
-                    const   css::uno::Reference< css::frame::XFrame >&              xOwner          ,
+         OFrames(   const   css::uno::Reference< css::frame::XFrame >&              xOwner          ,
                             FrameContainer*                                         pFrameContainer );
 
         //---------------------------------------------------------------------------------------------------------
@@ -297,8 +295,7 @@ class OFrames   :   private ThreadHelpBase      ,   // Must be the first of base
 
     private:
 
-        static sal_Bool impldbg_checkParameter_OFramesCtor  (   const   css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory        ,
-                                                                const   css::uno::Reference< css::frame::XFrame >&              xOwner          ,
+        static sal_Bool impldbg_checkParameter_OFramesCtor  (   const   css::uno::Reference< css::frame::XFrame >&              xOwner          ,
                                                                         FrameContainer*                                         pFrameContainer );
         static sal_Bool impldbg_checkParameter_append       (   const   css::uno::Reference< css::frame::XFrame >&              xFrame          );
         static sal_Bool impldbg_checkParameter_remove       (   const   css::uno::Reference< css::frame::XFrame >&              xFrame          );
@@ -313,7 +310,6 @@ class OFrames   :   private ThreadHelpBase      ,   // Must be the first of base
 
     private:
 
-        css::uno::Reference< css::lang::XMultiServiceFactory >      m_xFactory                      ;   /// reference to global servicemanager
         css::uno::WeakReference< css::frame::XFrame >               m_xOwner                        ;   /// reference to owner of this instance (Hold no hard reference!)
         FrameContainer*                                             m_pFrameContainer               ;   /// with owner shared list to hold all direct children of an XFramesSupplier
         sal_Bool                                                    m_bRecursiveSearchProtection    ;   /// flag to protect against recursive searches of frames at parents
diff --git a/framework/inc/services/frame.hxx b/framework/inc/services/frame.hxx
index 492c398..1dc011e 100644
--- a/framework/inc/services/frame.hxx
+++ b/framework/inc/services/frame.hxx
@@ -129,8 +129,8 @@ class Frame :   // interfaces
         //---------------------------------------------------------------------------------------------------------
         //  constructor / destructor
         //---------------------------------------------------------------------------------------------------------
-                  Frame( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory );
-        virtual ~Frame(                                                                         );
+                  Frame( const css::uno::Reference< css::uno::XComponentContext >& xContext );
+        virtual ~Frame(                                                                     );
 
         //---------------------------------------------------------------------------------------------------------
         //  XInterface, XTypeProvider, XServiceInfo
@@ -365,7 +365,7 @@ class Frame :   // interfaces
 
     private:
 
-        static sal_Bool implcp_ctor                                (   const   css::uno::Reference< css::lang::XMultiServiceFactory >&             xFactory            );
+        static sal_Bool implcp_ctor                                (   const   css::uno::Reference< css::uno::XComponentContext >&                 xContext            );
         static sal_Bool implcp_setActiveFrame                      (   const   css::uno::Reference< css::frame::XFrame >&                          xFrame              );
         static sal_Bool implcp_addFrameActionListener              (   const   css::uno::Reference< css::frame::XFrameActionListener >&            xListener           );
         static sal_Bool implcp_removeFrameActionListener           (   const   css::uno::Reference< css::frame::XFrameActionListener >&            xListener           );
@@ -385,7 +385,7 @@ class Frame :   // interfaces
     //*************************************************************************************************************
     private:
 
-        css::uno::Reference< css::lang::XMultiServiceFactory >                  m_xFactory                          ;   /// reference to factory, which has create this instance
+        css::uno::Reference< css::uno::XComponentContext >                      m_xContext                          ;   /// reference to factory, which has create this instance
         css::uno::Reference< css::task::XStatusIndicatorFactory >               m_xIndicatorFactoryHelper           ;   /// reference to factory helper to create status indicator objects
         css::uno::WeakReference< css::task::XStatusIndicator >                  m_xIndicatorInterception            ;   /// points to an external set progress, which should be used instead of the internal one.
         css::uno::Reference< css::frame::XDispatchProvider >                    m_xDispatchHelper                   ;   /// helper for XDispatch/Provider and interception interfaces
@@ -416,10 +416,10 @@ class Frame :   // interfaces
 
         FrameContainer                                                          m_aChildFrameContainer              ;   /// array of child frames
 
-        inline css::uno::Reference< css::lang::XMultiServiceFactory > impl_getFactory()
+        inline css::uno::Reference< css::uno::XComponentContext > impl_getComponentContext()
         {
             ReadGuard aReadLock( m_aLock );
-            return m_xFactory;
+            return m_xContext;
         }
 
         inline OUString impl_getName()
diff --git a/framework/source/classes/droptargetlistener.cxx b/framework/source/classes/droptargetlistener.cxx
index 66e272b..1b00c54 100644
--- a/framework/source/classes/droptargetlistener.cxx
+++ b/framework/source/classes/droptargetlistener.cxx
@@ -41,10 +41,10 @@
 namespace framework
 {
 
-DropTargetListener::DropTargetListener( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory,
-                                        const css::uno::Reference< css::frame::XFrame >&              xFrame  )
+DropTargetListener::DropTargetListener( const css::uno::Reference< css::uno::XComponentContext >& xContext,
+                                        const css::uno::Reference< css::frame::XFrame >&          xFrame  )
         : ThreadHelpBase  ( &Application::GetSolarMutex() )
-        , m_xFactory      ( xFactory                      )
+        , m_xContext      ( xContext                      )
         , m_xTargetFrame  ( xFrame                        )
         , m_pFormats      ( new DataFlavorExVector        )
 {
@@ -54,8 +54,8 @@ DropTargetListener::DropTargetListener( const css::uno::Reference< css::lang::XM
 
 DropTargetListener::~DropTargetListener()
 {
-    m_xTargetFrame = css::uno::WeakReference< css::frame::XFrame >();
-    m_xFactory     = css::uno::Reference< css::lang::XMultiServiceFactory >();
+    m_xTargetFrame.clear();
+    m_xContext.clear();
     delete m_pFormats;
     m_pFormats = NULL;
 }
@@ -64,8 +64,8 @@ DropTargetListener::~DropTargetListener()
 
 void SAL_CALL DropTargetListener::disposing( const css::lang::EventObject& ) throw( css::uno::RuntimeException )
 {
-    m_xTargetFrame = css::uno::WeakReference< css::frame::XFrame >();
-    m_xFactory     = css::uno::Reference< css::lang::XMultiServiceFactory >();
+    m_xTargetFrame.clear();
+    m_xContext.clear();
 }
 
 // -----------------------------------------------------------------------------
@@ -212,7 +212,7 @@ void DropTargetListener::implts_OpenFile( const String& rFilePath )
     /* SAFE { */
     ReadGuard aReadLock(m_aLock);
     css::uno::Reference< css::frame::XFrame >         xTargetFrame( m_xTargetFrame.get(), css::uno::UNO_QUERY );
-    css::uno::Reference< css::util::XURLTransformer > xParser     ( css::util::URLTransformer::create(::comphelper::getComponentContext(m_xFactory)) );
+    css::uno::Reference< css::util::XURLTransformer > xParser     ( css::util::URLTransformer::create(m_xContext) );
     aReadLock.unlock();
     /* } SAFE */
     if (xTargetFrame.is() && xParser.is())
diff --git a/framework/source/classes/taskcreator.cxx b/framework/source/classes/taskcreator.cxx
index f9fb99f..69f33bb 100644
--- a/framework/source/classes/taskcreator.cxx
+++ b/framework/source/classes/taskcreator.cxx
@@ -37,12 +37,12 @@ namespace framework{
     @descr      We need a valid uno service manager to create or instanciate new services.
                 All other information to create frames or tasks come in on right interface methods.
 
-    @param      xSMGR
+    @param      xContext
                     points to the valid uno service manager
 *//*-*****************************************************************************************************/
-TaskCreator::TaskCreator( const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR )
+TaskCreator::TaskCreator( const css::uno::Reference< css::uno::XComponentContext >& xContext )
     : ThreadHelpBase(       )
-    , m_xSMGR       ( xSMGR )
+    , m_xContext    ( xContext )
 {
 }
 
@@ -52,7 +52,7 @@ TaskCreator::TaskCreator( const css::uno::Reference< css::lang::XMultiServiceFac
 *//*-*****************************************************************************************************/
 TaskCreator::~TaskCreator()
 {
-    m_xSMGR.clear();
+    m_xContext.clear();
 }
 
 /*-****************************************************************************************************//**
@@ -63,7 +63,7 @@ css::uno::Reference< css::frame::XFrame > TaskCreator::createTask( const OUStrin
 {
     /* 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 */
 
@@ -78,7 +78,7 @@ css::uno::Reference< css::frame::XFrame > TaskCreator::createTask( const OUStrin
            )
         {
             ::comphelper::ConfigurationHelper::readDirectKey(
-                comphelper::getComponentContext(xSMGR),
+                xContext,
                 "org.openoffice.Office.TabBrowse",
                 "TaskCreatorService",
                 "ImplementationName",
@@ -86,7 +86,7 @@ css::uno::Reference< css::frame::XFrame > TaskCreator::createTask( const OUStrin
         }
 
         xCreator = css::uno::Reference< css::lang::XSingleServiceFactory >(
-                    xSMGR->createInstance(sCreator), css::uno::UNO_QUERY_THROW);
+                    xContext->getServiceManager()->createInstanceWithContext(sCreator, xContext), css::uno::UNO_QUERY_THROW);
     }
     catch(const css::uno::Exception&)
     {}
@@ -97,13 +97,13 @@ css::uno::Reference< css::frame::XFrame > TaskCreator::createTask( const OUStrin
     // library then these class here ... Why we should not be able to create it ?
     if ( ! xCreator.is())
         xCreator = css::uno::Reference< css::lang::XSingleServiceFactory >(
-                    xSMGR->createInstance(IMPLEMENTATIONNAME_FWK_TASKCREATOR), css::uno::UNO_QUERY_THROW);
+                    xContext->getServiceManager()->createInstanceWithContext(IMPLEMENTATIONNAME_FWK_TASKCREATOR, xContext), css::uno::UNO_QUERY_THROW);
 
     css::uno::Sequence< css::uno::Any > lArgs(5);
     css::beans::NamedValue              aArg    ;
 
     aArg.Name    = OUString(ARGUMENT_PARENTFRAME);
-    aArg.Value <<= css::uno::Reference< css::frame::XFrame >( css::frame::Desktop::create( comphelper::getComponentContext(xSMGR) ), css::uno::UNO_QUERY_THROW);
+    aArg.Value <<= css::uno::Reference< css::frame::XFrame >( css::frame::Desktop::create( xContext ), css::uno::UNO_QUERY_THROW);
     lArgs[0]   <<= aArg;
 
     aArg.Name    = OUString(ARGUMENT_CREATETOPWINDOW);
diff --git a/framework/source/dispatch/closedispatcher.cxx b/framework/source/dispatch/closedispatcher.cxx
index 1fa0c57..2ff7916 100644
--- a/framework/source/dispatch/closedispatcher.cxx
+++ b/framework/source/dispatch/closedispatcher.cxx
@@ -72,12 +72,12 @@ DEFINE_XTYPEPROVIDER_4(CloseDispatcher                         ,
                        css::frame::XDispatch                   )
 
 //-----------------------------------------------
-CloseDispatcher::CloseDispatcher(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR  ,
-                                 const css::uno::Reference< css::frame::XFrame >&              xFrame ,
-                                 const OUString&                                        sTarget)
+CloseDispatcher::CloseDispatcher(const css::uno::Reference< css::uno::XComponentContext >& rxContext ,
+                                 const css::uno::Reference< css::frame::XFrame >&          xFrame ,
+                                 const OUString&                                           sTarget)
     : ThreadHelpBase     (&Application::GetSolarMutex()                   )
     , ::cppu::OWeakObject(                                                )
-    , m_xSMGR            (xSMGR                                           )
+    , m_xContext         (rxContext                                       )
     , m_aAsyncCallback   (LINK( this, CloseDispatcher, impl_asyncCallback))
     , m_lStatusListener  (m_aLock.getShareableOslMutex()                  )
     , m_pSysWindow(NULL)
@@ -282,7 +282,7 @@ IMPL_LINK_NOARG(CloseDispatcher, impl_asyncCallback)
 
     // BTW: Make some copies, which are needed later ...
     EOperation                                                  eOperation  = m_eOperation;
-    css::uno::Reference< css::lang::XMultiServiceFactory >      xSMGR       = m_xSMGR;
+    css::uno::Reference< css::uno::XComponentContext >          xContext    = m_xContext;
     css::uno::Reference< css::frame::XFrame >                   xCloseFrame (m_xCloseFrame.get(), css::uno::UNO_QUERY);
     css::uno::Reference< css::frame::XDispatchResultListener >  xListener   = m_xResultListener;
 
@@ -301,7 +301,7 @@ IMPL_LINK_NOARG(CloseDispatcher, impl_asyncCallback)
     // Analyze the environment a first time.
     // If we found some special cases, we can
     // make some decisions erliar!
-    css::uno::Reference< css::frame::XFramesSupplier > xDesktop( css::frame::Desktop::create(comphelper::getComponentContext(xSMGR)), css::uno::UNO_QUERY_THROW);
+    css::uno::Reference< css::frame::XFramesSupplier > xDesktop( css::frame::Desktop::create(xContext), css::uno::UNO_QUERY_THROW);
     FrameListAnalyzer aCheck1(xDesktop, xCloseFrame, FrameListAnalyzer::E_HELP | FrameListAnalyzer::E_BACKINGCOMPONENT);
 
     // a) If the curent frame (where the close dispatch was requested for) does not have
@@ -465,11 +465,11 @@ sal_Bool CloseDispatcher::implts_prepareFrameForClosing(const css::uno::Referenc
     {
         // 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_THROW);
+        css::uno::Reference< css::frame::XFramesSupplier > xDesktop( css::frame::Desktop::create( xContext ), css::uno::UNO_QUERY_THROW);
         FrameListAnalyzer aCheck(xDesktop, xFrame, FrameListAnalyzer::E_ALL);
 
         sal_Int32 c = aCheck.m_lModelFrames.getLength();
@@ -533,8 +533,8 @@ sal_Bool CloseDispatcher::implts_establishBackingMode()
 {
     // SAFE -> ----------------------------------
     ReadGuard aReadLock(m_aLock);
-    css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR  = m_xSMGR;
-    css::uno::Reference< css::frame::XFrame >              xFrame (m_xCloseFrame.get(), css::uno::UNO_QUERY);
+    css::uno::Reference< css::uno::XComponentContext > xContext  = m_xContext;
+    css::uno::Reference< css::frame::XFrame >          xFrame (m_xCloseFrame.get(), css::uno::UNO_QUERY);
     aReadLock.unlock();
     // <- SAFE ----------------------------------
 
@@ -548,7 +548,7 @@ sal_Bool CloseDispatcher::implts_establishBackingMode()
     css::uno::Reference< css::awt::XWindow > xContainerWindow = xFrame->getContainerWindow();
 
     css::uno::Reference< css::frame::XController > xStartModule = css::frame::StartModule::createWithParentWindow(
-                        comphelper::getComponentContext(xSMGR), xContainerWindow);
+                        xContext, xContainerWindow);
 
     // Attention: You MUST(!) call setComponent() before you call attachFrame().
     css::uno::Reference< css::awt::XWindow > xBackingWin(xStartModule, css::uno::UNO_QUERY);
@@ -564,11 +564,11 @@ sal_Bool CloseDispatcher::implts_terminateApplication()
 {
     // 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 );
 
     return xDesktop->terminate();
 }
diff --git a/framework/source/dispatch/dispatchinformationprovider.cxx b/framework/source/dispatch/dispatchinformationprovider.cxx
index 5e2435a..a40c746 100644
--- a/framework/source/dispatch/dispatchinformationprovider.cxx
+++ b/framework/source/dispatch/dispatchinformationprovider.cxx
@@ -35,10 +35,10 @@ DEFINE_XINTERFACE_1(DispatchInformationProvider                               ,
                     DIRECT_INTERFACE(css::frame::XDispatchInformationProvider))
 
 //_________________________________________________________________________________________________________________
-DispatchInformationProvider::DispatchInformationProvider(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR ,
-                                                         const css::uno::Reference< css::frame::XFrame >&              xFrame)
+DispatchInformationProvider::DispatchInformationProvider(const css::uno::Reference< css::uno::XComponentContext >& xContext ,
+                                                         const css::uno::Reference< css::frame::XFrame >&          xFrame)
     : ThreadHelpBase(&Application::GetSolarMutex())
-    , m_xSMGR       (xSMGR                        )
+    , m_xContext    (xContext                     )
     , m_xFrame      (xFrame                       )
 {
 }
@@ -135,21 +135,22 @@ css::uno::Sequence< css::uno::Reference< css::frame::XDispatchInformationProvide
 {
     // SAFE -> ----------------------------------
     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);
+    css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
+    css::uno::Reference< css::frame::XFrame >          xFrame(m_xFrame.get(), css::uno::UNO_QUERY);
     aReadLock.unlock();
     // <- SAFE ----------------------------------
 
     if (!xFrame.is())
         return css::uno::Sequence< css::uno::Reference< css::frame::XDispatchInformationProvider > >();
 
-    CloseDispatcher* pCloser = new CloseDispatcher(xSMGR, xFrame, OUString("_self")); // explicit "_self" ... not "" ... see implementation of close dispatcher itself!
+    CloseDispatcher* pCloser = new CloseDispatcher(xContext, xFrame, OUString("_self")); // explicit "_self" ... not "" ... see implementation of close dispatcher itself!
     css::uno::Reference< css::uno::XInterface > xCloser(static_cast< css::frame::XDispatch* >(pCloser), css::uno::UNO_QUERY);
 
     css::uno::Reference< css::frame::XDispatchInformationProvider > xCloseDispatch(xCloser                                                      , css::uno::UNO_QUERY);
     css::uno::Reference< css::frame::XDispatchInformationProvider > xController   (xFrame->getController()                                      , css::uno::UNO_QUERY);
-    css::uno::Reference< css::frame::XDispatchInformationProvider > xAppDispatcher(xSMGR->createInstance(IMPLEMENTATIONNAME_APPDISPATCHPROVIDER), css::uno::UNO_QUERY);
-
+    css::uno::Reference< css::frame::XDispatchInformationProvider > xAppDispatcher(
+             css::uno::Reference<css::lang::XMultiServiceFactory>(xContext->getServiceManager(), css::uno::UNO_QUERY_THROW)
+                 ->createInstance(IMPLEMENTATIONNAME_APPDISPATCHPROVIDER), css::uno::UNO_QUERY);
     css::uno::Sequence< css::uno::Reference< css::frame::XDispatchInformationProvider > > lProvider(3);
     lProvider[0] = xController   ;
     lProvider[1] = xCloseDispatch;
diff --git a/framework/source/dispatch/dispatchprovider.cxx b/framework/source/dispatch/dispatchprovider.cxx
index 962eadb..73bbf07 100644
--- a/framework/source/dispatch/dispatchprovider.cxx
+++ b/framework/source/dispatch/dispatchprovider.cxx
@@ -72,18 +72,18 @@ DEFINE_XTYPEPROVIDER_2( DispatchProvider             ,
 
     @seealso    using at owner
 
-    @param      xFactory
+    @param      rxContext
                     reference to servicemanager to create new services.
     @param      xFrame
                     reference to our owner frame.
 */
-DispatchProvider::DispatchProvider( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory  ,
+DispatchProvider::DispatchProvider( const css::uno::Reference< css::uno::XComponentContext >& rxContext  ,
                                     const css::uno::Reference< css::frame::XFrame >&              xFrame    )
         //  Init baseclasses first
         : ThreadHelpBase( &Application::GetSolarMutex() )
         , OWeakObject   (                               )
         // Init member
-        , m_xFactory    ( xFactory                      )
+        , m_xContext    ( rxContext                     )
         , m_xFrame      ( xFrame                        )
 {
 }
@@ -514,7 +514,8 @@ css::uno::Reference< css::frame::XDispatch > DispatchProvider::implts_searchProt
         try
         {
             xHandler = css::uno::Reference< css::frame::XDispatchProvider >(
-                            m_xFactory->createInstance(aHandler.m_sUNOName),
+                            css::uno::Reference<css::lang::XMultiServiceFactory>(m_xContext->getServiceManager(), css::uno::UNO_QUERY_THROW)
+                               ->createInstance(aHandler.m_sUNOName),
                             css::uno::UNO_QUERY);
         }
         catch(const css::uno::Exception&) {}
@@ -583,7 +584,7 @@ css::uno::Reference< css::frame::XDispatch > DispatchProvider::implts_getOrCreat
 
     /* SAFE { */
     ReadGuard aReadLock( m_aLock );
-    css::uno::Reference< css::lang::XMultiServiceFactory > xFactory = m_xFactory;
+    css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
     aReadLock.unlock();
     /* } SAFE */
 
@@ -597,7 +598,7 @@ css::uno::Reference< css::frame::XDispatch > DispatchProvider::implts_getOrCreat
                     WriteGuard aWriteLock( m_aLock );
                     if ( ! m_xMenuDispatcher.is() )
                     {
-                        MenuDispatcher* pDispatcher = new MenuDispatcher( comphelper::getComponentContext(xFactory), xOwner );
+                        MenuDispatcher* pDispatcher = new MenuDispatcher( xContext, xOwner );
                         m_xMenuDispatcher = css::uno::Reference< css::frame::XDispatch >( static_cast< ::cppu::OWeakObject* >(pDispatcher), css::uno::UNO_QUERY );
                     }
                     xDispatchHelper = m_xMenuDispatcher;
@@ -608,7 +609,7 @@ css::uno::Reference< css::frame::XDispatch > DispatchProvider::implts_getOrCreat
 
         case E_CREATEDISPATCHER :
                 {
-                    LoadDispatcher* pDispatcher = new LoadDispatcher(xFactory, xOwner, sTarget, nSearchFlags);
+                    LoadDispatcher* pDispatcher = new LoadDispatcher(xContext, xOwner, sTarget, nSearchFlags);
                     xDispatchHelper = css::uno::Reference< css::frame::XDispatch >( static_cast< ::cppu::OWeakObject* >(pDispatcher), css::uno::UNO_QUERY );
                 }
                 break;
@@ -618,7 +619,7 @@ css::uno::Reference< css::frame::XDispatch > DispatchProvider::implts_getOrCreat
                     css::uno::Reference< css::frame::XFrame > xDesktop( xOwner, css::uno::UNO_QUERY );
                     if (xDesktop.is())
                     {
-                        LoadDispatcher* pDispatcher = new LoadDispatcher(xFactory, xOwner, SPECIALTARGET_BLANK, 0);
+                        LoadDispatcher* pDispatcher = new LoadDispatcher(xContext, xOwner, SPECIALTARGET_BLANK, 0);
                         xDispatchHelper = css::uno::Reference< css::frame::XDispatch >( static_cast< ::cppu::OWeakObject* >(pDispatcher), css::uno::UNO_QUERY );
                     }
                 }
@@ -629,7 +630,7 @@ css::uno::Reference< css::frame::XDispatch > DispatchProvider::implts_getOrCreat
                     css::uno::Reference< css::frame::XFrame > xDesktop( xOwner, css::uno::UNO_QUERY );
                     if (xDesktop.is())
                     {
-                        LoadDispatcher* pDispatcher = new LoadDispatcher(xFactory, xOwner, SPECIALTARGET_DEFAULT, 0);
+                        LoadDispatcher* pDispatcher = new LoadDispatcher(xContext, xOwner, SPECIALTARGET_DEFAULT, 0);
                         xDispatchHelper = css::uno::Reference< css::frame::XDispatch >( static_cast< ::cppu::OWeakObject* >(pDispatcher), css::uno::UNO_QUERY );
                     }
                 }
@@ -637,21 +638,21 @@ css::uno::Reference< css::frame::XDispatch > DispatchProvider::implts_getOrCreat
 
         case E_SELFDISPATCHER :
                 {
-                    LoadDispatcher* pDispatcher = new LoadDispatcher(xFactory, xOwner, SPECIALTARGET_SELF, 0);
+                    LoadDispatcher* pDispatcher = new LoadDispatcher(xContext, xOwner, SPECIALTARGET_SELF, 0);
                     xDispatchHelper = css::uno::Reference< css::frame::XDispatch >( static_cast< ::cppu::OWeakObject* >(pDispatcher), css::uno::UNO_QUERY );
                 }
                 break;
 
         case E_CLOSEDISPATCHER :
                 {
-                    CloseDispatcher* pDispatcher = new CloseDispatcher( xFactory, xOwner, sTarget );
+                    CloseDispatcher* pDispatcher = new CloseDispatcher( xContext, xOwner, sTarget );
                     xDispatchHelper = css::uno::Reference< css::frame::XDispatch >( static_cast< ::cppu::OWeakObject* >(pDispatcher), css::uno::UNO_QUERY );
                 }
                 break;
 
         case E_STARTMODULEDISPATCHER :
                 {
-                    StartModuleDispatcher* pDispatcher = new StartModuleDispatcher( comphelper::getComponentContext(xFactory), xOwner, sTarget );
+                    StartModuleDispatcher* pDispatcher = new StartModuleDispatcher( xContext, xOwner, sTarget );
                     xDispatchHelper = css::uno::Reference< css::frame::XDispatch >( static_cast< ::cppu::OWeakObject* >(pDispatcher), css::uno::UNO_QUERY );
                 }
                 break;
diff --git a/framework/source/dispatch/loaddispatcher.cxx b/framework/source/dispatch/loaddispatcher.cxx
index d84d822..6c52301 100644
--- a/framework/source/dispatch/loaddispatcher.cxx
+++ b/framework/source/dispatch/loaddispatcher.cxx
@@ -25,22 +25,22 @@
 
 namespace framework{
 
-LoadDispatcher::LoadDispatcher(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR       ,
-                               const css::uno::Reference< css::frame::XFrame >&              xOwnerFrame ,
+LoadDispatcher::LoadDispatcher(const css::uno::Reference< css::uno::XComponentContext >& xContext       ,
+                               const css::uno::Reference< css::frame::XFrame >&          xOwnerFrame ,
                                const OUString                                         sTargetName ,
                                      sal_Int32                                               nSearchFlags)
     : ThreadHelpBase(            )
-    , m_xSMGR       (xSMGR       )
+    , m_xContext    (xContext    )
     , m_xOwnerFrame (xOwnerFrame )
     , m_sTarget     (sTargetName )
     , m_nSearchFlags(nSearchFlags)
-    , m_aLoader     (xSMGR       )
+    , m_aLoader     (xContext    )
 {
 }
 
 LoadDispatcher::~LoadDispatcher()
 {
-    m_xSMGR.clear();
+    m_xContext.clear();
 }
 
 void SAL_CALL LoadDispatcher::dispatchWithNotification(const css::util::URL&                                             aURL      ,
diff --git a/framework/source/dispatch/windowcommanddispatch.cxx b/framework/source/dispatch/windowcommanddispatch.cxx
index 3edef48..4e260c5 100644
--- a/framework/source/dispatch/windowcommanddispatch.cxx
+++ b/framework/source/dispatch/windowcommanddispatch.cxx
@@ -40,10 +40,10 @@
 namespace framework{
 
 //-----------------------------------------------
-WindowCommandDispatch::WindowCommandDispatch(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR ,
+WindowCommandDispatch::WindowCommandDispatch(const css::uno::Reference< css::uno::XComponentContext >& xContext ,
                          const css::uno::Reference< css::frame::XFrame >&              xFrame)
     : ThreadHelpBase(                            )
-    , m_xSMGR       (xSMGR                       )
+    , m_xContext    (xContext                    )
     , m_xFrame      (xFrame                      )
     , m_xWindow     (xFrame->getContainerWindow())
 {
@@ -54,7 +54,7 @@ WindowCommandDispatch::WindowCommandDispatch(const css::uno::Reference< css::lan
 WindowCommandDispatch::~WindowCommandDispatch()
 {
     impl_stopListening();
-    m_xSMGR.clear();
+    m_xContext.clear();
 }
 
 //-----------------------------------------------
@@ -156,7 +156,7 @@ void WindowCommandDispatch::impl_dispatchCommand(const OUString& sCommand)
         // SYNCHRONIZED ->
         ReadGuard aReadLock(m_aLock);
         css::uno::Reference< css::frame::XDispatchProvider >   xProvider(m_xFrame.get(), css::uno::UNO_QUERY_THROW);
-        css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR    = m_xSMGR;
+        css::uno::Reference< css::uno::XComponentContext >     xContext    = m_xContext;
         aReadLock.unlock();
         // <- SYNCHRONIZED
 
@@ -164,7 +164,7 @@ void WindowCommandDispatch::impl_dispatchCommand(const OUString& sCommand)
         if ( ! xProvider.is())
             return;
 
-        css::uno::Reference< css::util::XURLTransformer > xParser(css::util::URLTransformer::create(::comphelper::getComponentContext(xSMGR)));
+        css::uno::Reference< css::util::XURLTransformer > xParser(css::util::URLTransformer::create(xContext));
         css::util::URL aCommand;
         aCommand.Complete = sCommand;
         xParser->parseStrict(aCommand);
diff --git a/framework/source/fwi/classes/propertysethelper.cxx b/framework/source/fwi/classes/propertysethelper.cxx
index 7c23fc2..7ef56a6 100644
--- a/framework/source/fwi/classes/propertysethelper.cxx
+++ b/framework/source/fwi/classes/propertysethelper.cxx
@@ -27,12 +27,10 @@ namespace framework{
 
 
 //-----------------------------------------------------------------------------
-PropertySetHelper::PropertySetHelper(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR                       ,
-                                           LockHelper*                                             pExternalLock               ,
+PropertySetHelper::PropertySetHelper(      LockHelper*                                             pExternalLock               ,
                                            TransactionManager*                                     pExternalTransactionManager ,
                                            sal_Bool                                                bReleaseLockOnCall          )
-    : m_xSMGR                (xSMGR                                )
-    , m_lSimpleChangeListener(pExternalLock->getShareableOslMutex())
+    : m_lSimpleChangeListener(pExternalLock->getShareableOslMutex())
     , m_lVetoChangeListener  (pExternalLock->getShareableOslMutex())
     , m_bReleaseLockOnCall   (bReleaseLockOnCall                   )
     , m_rLock                (*pExternalLock                       )
diff --git a/framework/source/helper/oframes.cxx b/framework/source/helper/oframes.cxx
index 9ab93b5..64421ce 100644
--- a/framework/source/helper/oframes.cxx
+++ b/framework/source/helper/oframes.cxx
@@ -40,20 +40,18 @@ using namespace ::std                           ;
 //*****************************************************************************************************************
 //  constructor
 //*****************************************************************************************************************
-OFrames::OFrames(   const   css::uno::Reference< XMultiServiceFactory >&    xFactory        ,
-                    const   css::uno::Reference< XFrame >&              xOwner          ,
+OFrames::OFrames( const   css::uno::Reference< XFrame >&              xOwner          ,
                             FrameContainer*                     pFrameContainer )
         //  Init baseclasses first
         :   ThreadHelpBase              ( &Application::GetSolarMutex() )
         // Init member
-        ,   m_xFactory                  ( xFactory                      )
         ,   m_xOwner                    ( xOwner                        )
         ,   m_pFrameContainer           ( pFrameContainer               )
         ,   m_bRecursiveSearchProtection( sal_False                     )
 {
     // Safe impossible cases
     // Method is not defined for ALL incoming parameters!
-    LOG_ASSERT( impldbg_checkParameter_OFramesCtor( xFactory, xOwner, pFrameContainer ), "OFrames::OFrames()\nInvalid parameter detected!\n" )
+    LOG_ASSERT( impldbg_checkParameter_OFramesCtor( xOwner, pFrameContainer ), "OFrames::OFrames()\nInvalid parameter detected!\n" )
 }
 
 //*****************************************************************************************************************
@@ -395,17 +393,14 @@ void OFrames::impl_appendSequence(          Sequence< css::uno::Reference< XFram
 // An instance of this class can only work with valid initialization.
 // We share the mutex with ouer owner class, need a valid factory to instanciate new services and
 // use the access to ouer owner for some operations.
-sal_Bool OFrames::impldbg_checkParameter_OFramesCtor(   const   css::uno::Reference< XMultiServiceFactory >&    xFactory        ,
-                                                        const   css::uno::Reference< XFrame >&              xOwner          ,
+sal_Bool OFrames::impldbg_checkParameter_OFramesCtor(   const   css::uno::Reference< XFrame >&              xOwner          ,
                                                                 FrameContainer*                     pFrameContainer )
 {
     // Set default return value.
     sal_Bool bOK = sal_True;
     // Check parameter.
     if  (
-            ( &xFactory         ==  NULL        )   ||
             ( &xOwner           ==  NULL        )   ||
-            ( xFactory.is()     ==  sal_False   )   ||
             ( xOwner.is()       ==  sal_False   )   ||
             ( pFrameContainer   ==  NULL        )
         )
diff --git a/framework/source/inc/dispatch/loaddispatcher.hxx b/framework/source/inc/dispatch/loaddispatcher.hxx
index c4f8665..51e06de 100644
--- a/framework/source/inc/dispatch/loaddispatcher.hxx
+++ b/framework/source/inc/dispatch/loaddispatcher.hxx
@@ -45,7 +45,7 @@ class LoadDispatcher : private ThreadHelpBase
     private:
 
         /** @short  can be used to create own needed services on demand. */
-        css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR;
+        css::uno::Reference< css::uno::XComponentContext > m_xContext;
 
         /** @short  TODO document me */
         css::uno::WeakReference< css::frame::XFrame > m_xOwnerFrame;
@@ -70,7 +70,7 @@ class LoadDispatcher : private ThreadHelpBase
                     That means: It can be used to load any further requested content into tzhe here(!)
                     specified target frame.
 
-            @param  xSMGR
+            @param  xContext
                     will be used to create own needed services on demand.
 
             @param  xOwnerFrame
@@ -83,8 +83,8 @@ class LoadDispatcher : private ThreadHelpBase
             @param  nSearchFlags
                     used in case sTargetFrame isnt a special one.
          */
-        LoadDispatcher(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR       ,
-                       const css::uno::Reference< css::frame::XFrame >&              xOwnerFrame ,
+        LoadDispatcher(const css::uno::Reference< css::uno::XComponentContext >& xContext,
+                       const css::uno::Reference< css::frame::XFrame >&          xOwnerFrame ,
                        const OUString                                         sTargetName ,
                              sal_Int32                                               nSearchFlags);
 
diff --git a/framework/source/inc/dispatch/windowcommanddispatch.hxx b/framework/source/inc/dispatch/windowcommanddispatch.hxx
index 9624e9c..64fc5e4 100644
--- a/framework/source/inc/dispatch/windowcommanddispatch.hxx
+++ b/framework/source/inc/dispatch/windowcommanddispatch.hxx
@@ -48,7 +48,7 @@ class WindowCommandDispatch : private ThreadHelpBase
     private:
 
         /// can be used to create own needed services on demand.
-        css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR;
+        css::uno::Reference< css::uno::XComponentContext > m_xContext;
 
         /// knows the frame, where we dispatch our commands as weak reference
         css::uno::WeakReference< css::frame::XFrame > m_xFrame;
@@ -69,13 +69,13 @@ class WindowCommandDispatch : private ThreadHelpBase
                     Means: 1 MACDispatch object is bound to 1 Frame/Window pair in which context
                     the detected commands will be executed.
 
-            @param  xSMGR
+            @param  xContext
                     will be used to create own needed services on demand.
 
             @param  xFrame
                     used as for new detected commands.
          */
-        WindowCommandDispatch(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR ,
+        WindowCommandDispatch(const css::uno::Reference< css::uno::XComponentContext >&     xContext ,
                               const css::uno::Reference< css::frame::XFrame >&              xFrame);
 
         //_______________________________________
diff --git a/framework/source/inc/loadenv/loadenv.hxx b/framework/source/inc/loadenv/loadenv.hxx
index f8c7819..dc62622 100644
--- a/framework/source/inc/loadenv/loadenv.hxx
+++ b/framework/source/inc/loadenv/loadenv.hxx
@@ -110,7 +110,7 @@ private:
     /** @short  reference to an uno service manager, which must be used
                 to created on needed services on demand.
      */
-    css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR;
+    css::uno::Reference< css::uno::XComponentContext > m_xContext;
 
     /** @short  points to the frame, which uses this LoadEnv object
                 and must be used to start target search there.
@@ -200,7 +200,7 @@ public:
 
     /** @short  initialize a new instance of this load environment.
 
-        @param  xSMGR
+        @param  xContext
                 reference to an uno service manager, which can be used internaly
                 to create on needed services on demand.
 
@@ -209,7 +209,7 @@ public:
         @throw  A RuntimeException in case any internal process indicates, that
                 the whole runtime cant be used any longer.
      */
-    LoadEnv(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR)
+    LoadEnv(const css::uno::Reference< css::uno::XComponentContext >& xContext)
         throw(LoadEnvException, css::uno::RuntimeException);
 
     /** @short  deinitialize an instance of this class in the right way.
@@ -217,7 +217,7 @@ public:
     ~LoadEnv();
 
     static css::uno::Reference< css::lang::XComponent > loadComponentFromURL(const css::uno::Reference< css::frame::XComponentLoader >&    xLoader,
-                                                                             const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR  ,
+                                                                             const css::uno::Reference< css::uno::XComponentContext >&     xContext,
                                                                              const OUString&                                        sURL   ,
                                                                              const OUString&                                        sTarget,
                                                                                    sal_Int32                                               nFlags ,
diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx
index 6796fd2..b8a5840 100644
--- a/framework/source/loadenv/loadenv.cxx
+++ b/framework/source/loadenv/loadenv.cxx
@@ -129,10 +129,10 @@ class LoadEnvListener : private ThreadHelpBase
 };
 
 
-LoadEnv::LoadEnv(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR)
+LoadEnv::LoadEnv(const css::uno::Reference< css::uno::XComponentContext >& xContext)
     throw(LoadEnvException, css::uno::RuntimeException)
     : ThreadHelpBase(     )
-    , m_xSMGR       (xSMGR)
+    , m_xContext    (xContext)
     , m_pQuietInteraction( 0 )
 {
 }
@@ -144,7 +144,7 @@ LoadEnv::~LoadEnv()
 
 
 css::uno::Reference< css::lang::XComponent > LoadEnv::loadComponentFromURL(const css::uno::Reference< css::frame::XComponentLoader >&    xLoader,
-                                                                           const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR  ,
+                                                                           const css::uno::Reference< css::uno::XComponentContext >&     xContext  ,
                                                                            const OUString&                                        sURL   ,
                                                                            const OUString&                                        sTarget,
                                                                                  sal_Int32                                               nFlags ,
@@ -157,7 +157,7 @@ css::uno::Reference< css::lang::XComponent > LoadEnv::loadComponentFromURL(const
 
     try
     {
-        LoadEnv aEnv(xSMGR);
+        LoadEnv aEnv(xContext);
 
         aEnv.initializeLoading(sURL,
                                lArgs,
@@ -268,7 +268,7 @@ void LoadEnv::initializeLoading(const OUString&
 
     // parse it - because some following code require that
     m_aURL.Complete = sURL;
-    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));
     xParser->parseStrict(m_aURL);
 
     // BTW: Split URL and JumpMark ...
@@ -294,7 +294,7 @@ void LoadEnv::initializeLoading(const OUString&
         ( m_lMediaDescriptor.getUnpackedValueOrDefault( ::comphelper::MediaDescriptor::PROP_PREVIEW(), sal_False ) == sal_False      );
 
     initializeUIDefaults(
-        comphelper::getComponentContext(m_xSMGR),
+        m_xContext,
         m_lMediaDescriptor,
         bUIMode,
         &m_pQuietInteraction
@@ -791,7 +791,7 @@ void LoadEnv::impl_detectTypeAndFilter()
     // we can't use as an in/out parameter here. Copy it before and dont forget to
     // update structure afterwards again!
     css::uno::Sequence< css::beans::PropertyValue >        lDescriptor = m_lMediaDescriptor.getAsConstPropertyValueList();
-    css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR       = m_xSMGR;
+    css::uno::Reference< css::uno::XComponentContext >     xContext = m_xContext;
 
     aReadLock.unlock();
     // <- SAFE
@@ -808,7 +808,7 @@ void LoadEnv::impl_detectTypeAndFilter()
         return;
     }
 
-    css::uno::Reference< css::document::XTypeDetection > xDetect(xSMGR->createInstance(SERVICENAME_TYPEDETECTION), css::uno::UNO_QUERY);
+    css::uno::Reference< css::document::XTypeDetection > xDetect( xContext->getServiceManager()->createInstanceWithContext(SERVICENAME_TYPEDETECTION, xContext), css::uno::UNO_QUERY);
     if (xDetect.is())
         sType = xDetect->queryTypeByDescriptor(lDescriptor, sal_True); /*TODO should deep detection be able for enable/disable it from outside? */
 
@@ -869,7 +869,7 @@ void LoadEnv::impl_detectTypeAndFilter()
     sal_Bool bIsOwnTemplate = sal_False;
     if (!sFilter.isEmpty())
     {
-        css::uno::Reference< css::container::XNameAccess > xFilterCont(xSMGR->createInstance(SERVICENAME_FILTERFACTORY), css::uno::UNO_QUERY_THROW);
+        css::uno::Reference< css::container::XNameAccess > xFilterCont(xContext->getServiceManager()->createInstanceWithContext(SERVICENAME_FILTERFACTORY, xContext), css::uno::UNO_QUERY_THROW);
         try
         {
             ::comphelper::SequenceAsHashMap lFilterProps(xFilterCont->getByName(sFilter));
@@ -910,7 +910,8 @@ sal_Bool LoadEnv::impl_handleContent()
     css::util::URL aURL = m_aURL;
 
     // get necessary container to query for a handler object
-    css::uno::Reference< css::lang::XMultiServiceFactory > xFactory(m_xSMGR->createInstance(SERVICENAME_CONTENTHANDLERFACTORY), css::uno::UNO_QUERY);
+    css::uno::Reference< css::lang::XMultiServiceFactory > xFactory(m_xContext->getServiceManager()->createInstanceWithContext(SERVICENAME_CONTENTHANDLERFACTORY, m_xContext), css::uno::UNO_QUERY);
+
     css::uno::Reference< css::container::XContainerQuery > xQuery  (xFactory                                                  , css::uno::UNO_QUERY);
 
     aReadLock.unlock();
@@ -965,7 +966,7 @@ sal_Bool LoadEnv::impl_furtherDocsAllowed()
 {
     // 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
 
@@ -974,7 +975,7 @@ sal_Bool LoadEnv::impl_furtherDocsAllowed()
     try
     {
         css::uno::Any aVal = ::comphelper::ConfigurationHelper::readDirectKey(
-                                comphelper::getComponentContext(xSMGR),
+                                xContext,
                                 OUString("org.openoffice.Office.Common/"),
                                 OUString("Misc"),
                                 OUString("MaxOpenDocuments"),
@@ -990,7 +991,7 @@ sal_Bool LoadEnv::impl_furtherDocsAllowed()
             aVal >>= nMaxOpenDocuments;
 
             css::uno::Reference< css::frame::XFramesSupplier > xDesktop(
-                css::frame::Desktop::create( comphelper::getComponentContext(xSMGR)),
+                css::frame::Desktop::create(xContext),
                 css::uno::UNO_QUERY_THROW);
 
             FrameListAnalyzer aAnalyzer(xDesktop,
@@ -1193,7 +1194,7 @@ css::uno::Reference< css::uno::XInterface > LoadEnv::impl_searchLoader()
     {
         try
         {
-            return m_xSMGR->createInstance(IMPLEMENTATIONNAME_GENERICFRAMELOADER);
+            return m_xContext->getServiceManager()->createInstanceWithContext(IMPLEMENTATIONNAME_GENERICFRAMELOADER, m_xContext);
         }
         catch(const css::uno::RuntimeException&)
             { throw; }
@@ -1210,7 +1211,7 @@ css::uno::Reference< css::uno::XInterface > LoadEnv::impl_searchLoader()
         throw LoadEnvException(LoadEnvException::ID_INVALID_MEDIADESCRIPTOR);
 
     // try to locate any interested frame loader
-    css::uno::Reference< css::lang::XMultiServiceFactory > xLoaderFactory(m_xSMGR->createInstance(SERVICENAME_FRAMELOADERFACTORY), css::uno::UNO_QUERY);
+    css::uno::Reference< css::lang::XMultiServiceFactory > xLoaderFactory(m_xContext->getServiceManager()->createInstanceWithContext(SERVICENAME_FRAMELOADERFACTORY, m_xContext), css::uno::UNO_QUERY);
     css::uno::Reference< css::container::XContainerQuery > xQuery        (xLoaderFactory                                         , css::uno::UNO_QUERY);
 
     aReadLock.unlock();
@@ -1261,14 +1262,14 @@ void LoadEnv::impl_jumpToMark(const css::uno::Reference< css::frame::XFrame >& x
 
     // 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::util::URL aCmd;
     aCmd.Complete = OUString(".uno:JumpToMark");
 
-    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(xContext));
     xParser->parseStrict(aCmd);
 
     css::uno::Reference< css::frame::XDispatch > xDispatcher = xProvider->queryDispatch(aCmd, SPECIALTARGET_SELF, 0);
@@ -1313,7 +1314,7 @@ css::uno::Reference< css::frame::XFrame > LoadEnv::impl_searchAlreadyLoaded()
 
     // otherwise - iterate through the tasks of the desktop container
     // to find out, which of them might contains the requested document
-    css::uno::Reference< css::frame::XDesktop2 >  xSupplier = css::frame::Desktop::create( comphelper::getComponentContext(m_xSMGR) );
+    css::uno::Reference< css::frame::XDesktop2 >  xSupplier = css::frame::Desktop::create( m_xContext );
     css::uno::Reference< css::container::XIndexAccess > xTaskList(xSupplier->getFrames()                      , css::uno::UNO_QUERY);
 
     if (!xTaskList.is())
@@ -1454,7 +1455,7 @@ css::uno::Reference< css::frame::XFrame > LoadEnv::impl_searchRecycleTarget()
     if (m_lMediaDescriptor.getUnpackedValueOrDefault(::comphelper::MediaDescriptor::PROP_HIDDEN(), sal_False) == sal_True)
         return css::uno::Reference< css::frame::XFrame >();
 
-    css::uno::Reference< css::frame::XFramesSupplier > xSupplier( css::frame::Desktop::create( comphelper::getComponentContext(m_xSMGR) ), css::uno::UNO_QUERY);
+    css::uno::Reference< css::frame::XFramesSupplier > xSupplier( css::frame::Desktop::create( m_xContext ), css::uno::UNO_QUERY);
     FrameListAnalyzer aTasksAnalyzer(xSupplier, css::uno::Reference< css::frame::XFrame >(), FrameListAnalyzer::E_BACKINGCOMPONENT);
     if (aTasksAnalyzer.m_xBackingComponent.is())
     {
@@ -1696,7 +1697,7 @@ void LoadEnv::impl_makeFrameWindowVisible(const css::uno::Reference< css::awt::X
 {
     // SAFE -> ----------------------------------
     ReadGuard aReadLock(m_aLock);
-    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 ----------------------------------
 
@@ -1712,7 +1713,7 @@ void LoadEnv::impl_makeFrameWindowVisible(const css::uno::Reference< css::awt::X
         {
             css::uno::Any const a =
                 ::comphelper::ConfigurationHelper::readDirectKey(
-                  comphelper::getComponentContext(xSMGR),
+                  xContext,
                   OUString("org.openoffice.Office.Common/View"),
                   OUString("NewDocumentHandling"),
                   OUString("ForceFocusAndToFront"),
@@ -1776,7 +1777,7 @@ void LoadEnv::impl_applyPersistentWindowState(const css::uno::Reference< css::aw
     if (sFilter.isEmpty())
         return;
 
-    css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR;
+    css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
 
     aReadLock.unlock();
     // <- SAFE
@@ -1785,14 +1786,14 @@ void LoadEnv::impl_applyPersistentWindowState(const css::uno::Reference< css::aw
     {
         // retrieve the module name from the filter configuration
         css::uno::Reference< css::container::XNameAccess > xFilterCfg(
-            xSMGR->createInstance(SERVICENAME_FILTERFACTORY),
+            xContext->getServiceManager()->createInstanceWithContext(SERVICENAME_FILTERFACTORY, xContext),
             css::uno::UNO_QUERY_THROW);
         ::comphelper::SequenceAsHashMap lProps (xFilterCfg->getByName(sFilter));
         OUString                 sModule = lProps.getUnpackedValueOrDefault(FILTER_PROPNAME_DOCUMENTSERVICE, OUString());
 
         // get access to the configuration of this office module
         css::uno::Reference< css::container::XNameAccess > xModuleCfg(::comphelper::ConfigurationHelper::openConfig(
-                                                                        comphelper::getComponentContext(xSMGR),
+                                                                        xContext,
                                                                         PACKAGE_SETUP_MODULES,
                                                                         ::comphelper::ConfigurationHelper::E_READONLY),
                                                                       css::uno::UNO_QUERY_THROW);
diff --git a/framework/source/services/backingcomp.cxx b/framework/source/services/backingcomp.cxx
index 88515c0..b7c1c4e 100644
--- a/framework/source/services/backingcomp.cxx
+++ b/framework/source/services/backingcomp.cxx
@@ -459,7 +459,7 @@ 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(m_xSMGR, m_xFrame);
+    ::framework::DropTargetListener* pDropListener = new ::framework::DropTargetListener( comphelper::getComponentContext(m_xSMGR), 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) );
diff --git a/framework/source/services/desktop.cxx b/framework/source/services/desktop.cxx
index 6e8edbe..50004f3 100644
--- a/framework/source/services/desktop.cxx
+++ b/framework/source/services/desktop.cxx
@@ -137,14 +137,14 @@ DEFINE_INIT_SERVICE                     (   Desktop,
                                                 // We hold member as reference ... not as pointer too!
                                                 // Attention: We share our frame container with this helper. Container is threadsafe himself ... So I think we can do that.
                                                 // But look on dispose() for right order of deinitialization.
-                                                OFrames* pFramesHelper = new OFrames( m_xFactory, this, &m_aChildTaskContainer );
+                                                OFrames* pFramesHelper = new OFrames( this, &m_aChildTaskContainer );
                                                 m_xFramesHelper = css::uno::Reference< css::frame::XFrames >( static_cast< ::cppu::OWeakObject* >(pFramesHelper), css::uno::UNO_QUERY );
 
                                                 //-------------------------------------------------------------------------------------------------------------
                                                 // Initialize a new dispatchhelper-object to handle dispatches.
                                                 // We use these helper as slave for our interceptor helper ... not directly!
                                                 // But he is event listener on THIS instance!
-                                                DispatchProvider* pDispatchHelper = new DispatchProvider( m_xFactory, this );
+                                                DispatchProvider* pDispatchHelper = new DispatchProvider( comphelper::getComponentContext(m_xFactory), this );
                                                 css::uno::Reference< css::frame::XDispatchProvider > xDispatchProvider( static_cast< ::cppu::OWeakObject* >(pDispatchHelper), css::uno::UNO_QUERY );
 
                                                 //-------------------------------------------------------------------------------------------------------------
@@ -648,7 +648,7 @@ css::uno::Reference< css::lang::XComponent > SAL_CALL Desktop::loadComponentFrom
     aReadLock.unlock();
 
     RTL_LOGFILE_PRODUCT_CONTEXT( aLog2, "PERFORMANCE - Desktop::loadComponentFromURL()" );
-    return LoadEnv::loadComponentFromURL(xThis, xSMGR, sURL, sTargetFrameName, nSearchFlags, lArguments);
+    return LoadEnv::loadComponentFromURL(xThis, comphelper::getComponentContext(xSMGR), sURL, sTargetFrameName, nSearchFlags, lArguments);
 }
 
 /*-************************************************************************************************************//**
@@ -1050,7 +1050,7 @@ css::uno::Reference< css::frame::XFrame > SAL_CALL Desktop::findFrame( const OUS
     //-----------------------------------------------------------------------------------------------------
     if ( sTargetFrameName==SPECIALTARGET_BLANK )
     {
-        TaskCreator aCreator(xFactory);
+        TaskCreator aCreator( comphelper::getComponentContext(xFactory) );
         xTarget = aCreator.createTask(sTargetFrameName,sal_False);
     }
 
@@ -1148,7 +1148,7 @@ css::uno::Reference< css::frame::XFrame > SAL_CALL Desktop::findFrame( const OUS
             (nSearchFlags & css::frame::FrameSearchFlag::CREATE)
            )
         {
-            TaskCreator aCreator(xFactory);
+            TaskCreator aCreator( comphelper::getComponentContext(xFactory) );
             xTarget = aCreator.createTask(sTargetFrameName,sal_False);
         }
     }
diff --git a/framework/source/services/frame.cxx b/framework/source/services/frame.cxx
index 3fff17d..6dbdc2a 100644
--- a/framework/source/services/frame.cxx
+++ b/framework/source/services/frame.cxx
@@ -146,7 +146,7 @@ DEFINE_XTYPEPROVIDER_21             (   Frame
                                         css::frame::XTitleChangeBroadcaster
                                     )
 
-DEFINE_XSERVICEINFO_MULTISERVICE    (   Frame                                                                   ,
+DEFINE_XSERVICEINFO_MULTISERVICE_2  (   Frame                                                                   ,
                                         ::cppu::OWeakObject                                                     ,
                                         "com.sun.star.frame.Frame"                                              ,
                                         OUString("com.sun.star.comp.framework.Frame")
@@ -165,11 +165,11 @@ DEFINE_INIT_SERVICE                 (   Frame,
                                             // Initialize a new dispatchhelper-object to handle dispatches.
                                             // We use these helper as slave for our interceptor helper ... not directly!
                                             // But he is event listener on THIS instance!
-                                            DispatchProvider* pDispatchHelper = new DispatchProvider( m_xFactory, this );
+                                            DispatchProvider* pDispatchHelper = new DispatchProvider( m_xContext, this );
                                             css::uno::Reference< css::frame::XDispatchProvider > xDispatchProvider( static_cast< ::cppu::OWeakObject* >(pDispatchHelper), css::uno::UNO_QUERY );
 
                                             //-------------------------------------------------------------------------------------------------------------
-                                            DispatchInformationProvider* pInfoHelper = new DispatchInformationProvider(m_xFactory, this);
+                                            DispatchInformationProvider* pInfoHelper = new DispatchInformationProvider(m_xContext, this);
                                             m_xDispatchInfoHelper = css::uno::Reference< css::frame::XDispatchInformationProvider >( static_cast< ::cppu::OWeakObject* >(pInfoHelper), css::uno::UNO_QUERY );
 
                                             //-------------------------------------------------------------------------------------------------------------
@@ -185,13 +185,13 @@ DEFINE_INIT_SERVICE                 (   Frame,
                                             // We hold member as reference ... not as pointer too!
                                             // Attention: We share our frame container with this helper. Container is threadsafe himself ... So I think we can do that.
                                             // But look on dispose() for right order of deinitialization.
-                                            OFrames* pFramesHelper = new OFrames( m_xFactory, this, &m_aChildFrameContainer );
+                                            OFrames* pFramesHelper = new OFrames( this, &m_aChildFrameContainer );
                                             m_xFramesHelper = css::uno::Reference< css::frame::XFrames >( static_cast< ::cppu::OWeakObject* >(pFramesHelper), css::uno::UNO_QUERY );
 
                                             //-------------------------------------------------------------------------------------------------------------
                                             // Initialize a the drop target listener.
                                             // We hold member as reference ... not as pointer too!
-                                            DropTargetListener* pDropListener = new DropTargetListener( m_xFactory, this );
+                                            DropTargetListener* pDropListener = new DropTargetListener( m_xContext, this );
                                             m_xDropTargetListener = css::uno::Reference< css::datatransfer::dnd::XDropTargetListener >( static_cast< ::cppu::OWeakObject* >(pDropListener), css::uno::UNO_QUERY );
 
                                             // Safe impossible cases
@@ -208,7 +208,7 @@ DEFINE_INIT_SERVICE                 (   Frame,
                                             //-------------------------------------------------------------------------------------------------------------
                                             // Create an initial layout manager
                                             // Create layout manager and connect it to the newly created frame
-                                            m_xLayoutManager = css::uno::Reference< css::frame::XLayoutManager >(m_xFactory->createInstance(SERVICENAME_LAYOUTMANAGER), css::uno::UNO_QUERY);
+                                            m_xLayoutManager.set(m_xContext->getServiceManager()->createInstanceWithContext(SERVICENAME_LAYOUTMANAGER, m_xContext), css::uno::UNO_QUERY);
 
                                             //-------------------------------------------------------------------------------------------------------------
                                             // set information about all supported properties at the base class helper PropertySetHelper
@@ -231,22 +231,21 @@ DEFINE_INIT_SERVICE                 (   Frame,
 
     @seealso    method DEFINE_INIT_SERVICE()
 
-    @param      "xFactory" is the multi service manager, which create this instance.
-                The value must be different from NULL!
+    @param      xContext is the multi service manager, which creates this instance.
+                    The value must be different from NULL!
     @return     -
 
     @onerror    ASSERT in debug version or nothing in relaese version.
 *//*-*****************************************************************************************************/
-Frame::Frame( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory )
+Frame::Frame( const css::uno::Reference< css::uno::XComponentContext >& xContext )
         :   ThreadHelpBase              ( &Application::GetSolarMutex()                     )
         ,   TransactionBase             (                                                   )
-        ,   PropertySetHelper           ( xFactory,
-                                          &m_aLock,
+        ,   PropertySetHelper           ( &m_aLock,
                                           &m_aTransactionManager,
                                           sal_False) // sal_False => dont release shared mutex on calling us!
         ,   ::cppu::OWeakObject         (                                                   )
         //  init member
-        ,   m_xFactory                  ( xFactory                                          )
+        ,   m_xContext                  ( xContext                                          )
         ,   m_aListenerContainer        ( m_aLock.getShareableOslMutex()                    )
         ,   m_xParent                   (                                                   )
         ,   m_xContainerWindow          (                                                   )
@@ -264,7 +263,7 @@ Frame::Frame( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFac
         ,   m_aChildFrameContainer      (                                                   )
 {
     // Check incoming parameter to avoid against wrong initialization.
-    LOG_ASSERT2( implcp_ctor( xFactory ), "Frame::Frame()", "Invalid parameter detected!" )
+    LOG_ASSERT2( implcp_ctor( xContext ), "Frame::Frame()", "Invalid parameter detected!" )
 
     /* Please have a look on "@attentions" of description before! */
 }
@@ -322,10 +321,10 @@ css::uno::Reference< css::lang::XComponent > SAL_CALL Frame::loadComponentFromUR
 
     ReadGuard aReadLock(m_aLock);
     css::uno::Reference< css::frame::XComponentLoader > xThis(static_cast< css::frame::XComponentLoader* >(this), css::uno::UNO_QUERY);
-    css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xFactory;
+    css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
     aReadLock.unlock();
 
-    return LoadEnv::loadComponentFromURL(xThis, xSMGR, sURL, sTargetFrameName, nSearchFlags, lArguments);
+    return LoadEnv::loadComponentFromURL(xThis, xContext, sURL, sTargetFrameName, nSearchFlags, lArguments);
 }
 
 /*-****************************************************************************************************//**
@@ -554,8 +553,8 @@ void SAL_CALL Frame::initialize( const css::uno::Reference< css::awt::XWindow >&
     if (pWindow && pWindow->IsVisible())
         m_bIsHidden = sal_False;
 
-    css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR          = m_xFactory;
-    css::uno::Reference< css::frame::XLayoutManager >     xLayoutManager = m_xLayoutManager;
+    css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
+    css::uno::Reference< css::frame::XLayoutManager >  xLayoutManager = m_xLayoutManager;
 
     // Release lock ... because we call some impl methods, which are threadsafe by himself.
     // If we hold this lock - we will produce our own deadlock!
@@ -568,7 +567,7 @@ void SAL_CALL Frame::initialize( const css::uno::Reference< css::awt::XWindow >&
     // create progress helper
     css::uno::Reference< css::frame::XFrame >                 xThis            (static_cast< css::frame::XFrame* >(this)                        , css::uno::UNO_QUERY_THROW);
     css::uno::Reference< css::task::XStatusIndicatorFactory > xIndicatorFactory =
-        css::task::StatusIndicatorFactory::createWithFrame(comphelper::getComponentContext(xSMGR), xThis, sal_False/*DisableReschedule*/, sal_True/*AllowParentShow*/ );
+        css::task::StatusIndicatorFactory::createWithFrame(xContext, xThis, sal_False/*DisableReschedule*/, sal_True/*AllowParentShow*/ );
 
     // SAFE -> ----------------------------------
     aWriteLock.lock();
@@ -582,10 +581,10 @@ void SAL_CALL Frame::initialize( const css::uno::Reference< css::awt::XWindow >&
 
     impl_enablePropertySet();
 
-    m_pWindowCommandDispatch = new WindowCommandDispatch(xSMGR, this);
+    m_pWindowCommandDispatch = new WindowCommandDispatch(xContext, this);
 
     // Initialize title functionality
-    TitleHelper* pTitleHelper = new TitleHelper( comphelper::getComponentContext(xSMGR) );
+    TitleHelper* pTitleHelper = new TitleHelper( xContext );
     m_xTitleHelper = css::uno::Reference< css::frame::XTitle >(static_cast< ::cppu::OWeakObject* >(pTitleHelper), css::uno::UNO_QUERY_THROW);
     pTitleHelper->setOwner(xThis);
 }
@@ -769,7 +768,7 @@ css::uno::Reference< css::frame::XFrame > SAL_CALL Frame::findFrame( const OUStr
     /* SAFE { */
     ReadGuard aReadLock( m_aLock );
     css::uno::Reference< css::frame::XFrame >              xParent      ( m_xParent, css::uno::UNO_QUERY );
-    css::uno::Reference< css::lang::XMultiServiceFactory > xFactory     = m_xFactory;
+    css::uno::Reference< css::uno::XComponentContext >     xContext = m_xContext;
     sal_Bool                                               bIsTopFrame  = m_bIsFrameTop;
     sal_Bool                                               bIsTopWindow = WindowHelper::isTopWindow(m_xContainerWindow);
     aReadLock.unlock();
@@ -782,7 +781,7 @@ css::uno::Reference< css::frame::XFrame > SAL_CALL Frame::findFrame( const OUStr
     //-----------------------------------------------------------------------------------------------------
     if ( sTargetFrameName==SPECIALTARGET_BLANK )
     {
-        TaskCreator aCreator(xFactory);
+        TaskCreator aCreator(xContext);
         xTarget = aCreator.createTask(sTargetFrameName,sal_False);
     }
 
@@ -989,7 +988,7 @@ css::uno::Reference< css::frame::XFrame > SAL_CALL Frame::findFrame( const OUStr
             (nSearchFlags & css::frame::FrameSearchFlag::CREATE)
            )
         {
-            TaskCreator aCreator(xFactory);
+            TaskCreator aCreator(xContext);
             xTarget = aCreator.createTask(sTargetFrameName,sal_False);
         }
     }
@@ -1936,7 +1935,7 @@ void SAL_CALL Frame::dispose() throw( css::uno::RuntimeException )
     // Release some other references.
     // This calls should be easy ... I hope it :-)
     m_xDispatchHelper.clear();
-    m_xFactory.clear();

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list