[Libreoffice-commits] core.git: 26 commits - basctl/source basic/source comphelper/inc comphelper/source connectivity/inc connectivity/source cui/source dbaccess/source desktop/inc desktop/source editeng/source embeddedobj/source extensions/source fileaccess/source filter/source forms/source framework/inc framework/source i18npool/source io/source jvmaccess/source linguistic/source offapi/com offapi/type_reference offapi/UnoApi_offapi.mk oox/inc oox/source package/inc package/source reportdesign/source scripting/source sc/source sdext/source sd/source sfx2/source shell/source starmath/source stoc/source svtools/inc svtools/source svx/source sw/source ucb/source udkapi/com udkapi/UnoApi_udkapi.mk unotools/source vcl/source xmlhelp/source xmloff/inc xmloff/source xmlscript/source

Noel Grandin noel at peralex.com
Sun Feb 10 22:57:21 PST 2013


 basctl/source/basicide/scriptdocument.cxx                             |    8 
 basic/source/classes/sbxmod.cxx                                       |   11 
 basic/source/uno/namecont.cxx                                         |   10 
 comphelper/inc/comphelper/storagehelper.hxx                           |    5 
 comphelper/source/misc/storagehelper.cxx                              |    9 
 comphelper/source/misc/synchronousdispatch.cxx                        |    9 
 comphelper/source/officeinstdir/officeinstallationdirectories.cxx     |   38 -
 connectivity/inc/connectivity/CommonTools.hxx                         |    6 
 connectivity/source/commontools/CommonTools.cxx                       |   17 
 connectivity/source/drivers/jdbc/JConnection.cxx                      |    5 
 connectivity/source/drivers/jdbc/Object.cxx                           |   10 
 connectivity/source/inc/java/lang/Object.hxx                          |    9 
 connectivity/source/inc/java/sql/Connection.hxx                       |    1 
 cui/source/dialogs/hangulhanjadlg.cxx                                 |   43 -
 cui/source/options/treeopt.cxx                                        |   17 
 dbaccess/source/core/dataaccess/databasedocument.cxx                  |   13 
 dbaccess/source/core/recovery/dbdocrecovery.cxx                       |   16 
 dbaccess/source/core/recovery/storagetextstream.cxx                   |   18 
 dbaccess/source/filter/xml/xmlExport.cxx                              |   23 
 dbaccess/source/filter/xml/xmlExport.hxx                              |    2 
 dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx                   |    2 
 dbaccess/source/filter/xml/xmlTable.cxx                               |    2 
 dbaccess/source/filter/xml/xmlfilter.cxx                              |   22 
 dbaccess/source/filter/xml/xmlfilter.hxx                              |    1 
 dbaccess/source/ui/dlg/ConnectionPage.cxx                             |    2 
 dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx                     |    4 
 dbaccess/source/ui/dlg/detailpages.cxx                                |    2 
 desktop/inc/app.hxx                                                   |    2 
 desktop/source/app/app.cxx                                            |   41 -
 desktop/source/app/appfirststart.cxx                                  |    6 
 desktop/source/app/appinit.cxx                                        |   14 
 desktop/source/deployment/misc/dp_descriptioninfoset.cxx              |   10 
 desktop/source/deployment/registry/component/dp_component.cxx         |    8 
 desktop/source/deployment/registry/dp_backenddb.cxx                   |   14 
 desktop/source/migration/migration.cxx                                |   22 
 desktop/source/migration/migration_impl.hxx                           |    4 
 desktop/source/migration/services/oo3extensionmigration.cxx           |    7 
 editeng/source/editeng/eerdll.cxx                                     |   11 
 editeng/source/misc/SvXMLAutoCorrectExport.cxx                        |    8 
 editeng/source/misc/SvXMLAutoCorrectExport.hxx                        |    4 
 editeng/source/misc/svxacorr.cxx                                      |    8 
 editeng/source/xml/xmltxtexp.cxx                                      |   16 
 embeddedobj/source/commonembedding/persistence.cxx                    |    4 
 extensions/source/bibliography/bibbeam.cxx                            |   10 
 extensions/source/bibliography/datman.cxx                             |   12 
 extensions/source/bibliography/general.cxx                            |    6 
 extensions/source/bibliography/general.hxx                            |    3 
 extensions/source/propctrlr/eventhandler.cxx                          |    6 
 extensions/source/update/check/updateprotocol.cxx                     |    6 
 extensions/source/update/feed/updatefeed.cxx                          |   12 
 fileaccess/source/FileAccess.cxx                                      |   22 
 filter/source/graphicfilter/icgm/actimpr.cxx                          |   21 
 filter/source/graphicfilter/icgm/outact.hxx                           |    2 
 filter/source/svg/svgexport.cxx                                       |   10 
 filter/source/svg/svgfilter.hxx                                       |    2 
 filter/source/xsltfilter/XSLTFilter.cxx                               |    8 
 forms/source/component/Filter.cxx                                     |  114 ++-
 forms/source/component/Filter.hxx                                     |    1 
 forms/source/component/ImageControl.cxx                               |    2 
 forms/source/component/imgprod.cxx                                    |    2 
 forms/source/xforms/computedexpression.cxx                            |   31 
 forms/source/xforms/model_ui.cxx                                      |   13 
 forms/source/xforms/submission.cxx                                    |    5 
 forms/source/xforms/submission.hxx                                    |    2 
 forms/source/xforms/submission/serialization_app_xml.cxx              |   18 
 forms/source/xforms/submission/serialization_app_xml.hxx              |    4 
 forms/source/xforms/submission/serialization_urlencoded.cxx           |    3 
 forms/source/xforms/submission/serialization_urlencoded.hxx           |    2 
 forms/source/xforms/unohelper.cxx                                     |   11 
 forms/source/xforms/unohelper.hxx                                     |    4 
 forms/source/xforms/xpathlib/extension.cxx                            |    7 
 framework/inc/helper/mischelper.hxx                                   |    4 
 framework/inc/services/sessionlistener.hxx                            |    2 
 framework/source/accelerators/presethandler.cxx                       |    2 
 framework/source/accelerators/storageholder.cxx                       |   11 
 framework/source/classes/fwktabwindow.cxx                             |    8 
 framework/source/fwe/classes/addonsoptions.cxx                        |   12 
 framework/source/fwi/helper/mischelper.cxx                            |    6 
 framework/source/inc/accelerators/presethandler.hxx                   |    4 
 framework/source/inc/accelerators/storageholder.hxx                   |   10 
 framework/source/loadenv/loadenv.cxx                                  |   18 
 framework/source/services/license.cxx                                 |    6 
 framework/source/uielement/imagebuttontoolbarcontroller.cxx           |    6 
 framework/source/uielement/langselectionmenucontroller.cxx            |    2 
 framework/source/uielement/langselectionstatusbarcontroller.cxx       |    2 
 i18npool/source/textconversion/textconversion_ko.cxx                  |    7 
 i18npool/source/textconversion/textconversion_zh.cxx                  |    6 
 io/source/TextInputStream/TextInputStream.cxx                         |    7 
 io/source/TextOutputStream/TextOutputStream.cxx                       |    7 
 jvmaccess/source/classpath.cxx                                        |   13 
 linguistic/source/convdicxml.hxx                                      |    2 
 offapi/UnoApi_offapi.mk                                               |   22 
 offapi/com/sun/star/awt/DialogProvider.idl                            |   13 
 offapi/com/sun/star/document/XMLBasicExporter.idl                     |   23 
 offapi/com/sun/star/document/XMLOasisBasicExporter.idl                |   23 
 offapi/com/sun/star/document/XXMLBasicExporter.idl                    |   52 +
 offapi/com/sun/star/form/control/FilterControl.idl                    |   53 +
 offapi/com/sun/star/form/runtime/FormController.idl                   |    5 
 offapi/com/sun/star/linguistic2/ConversionDictionaryList.idl          |    7 
 offapi/com/sun/star/xml/xpath/XPathAPI.idl                            |    5 
 offapi/com/sun/star/xml/xpath/XPathExtension.idl                      |   10 
 offapi/type_reference/types.rdb                                       |binary
 oox/inc/oox/dump/dumperbase.hxx                                       |    8 
 oox/inc/oox/helper/textinputstream.hxx                                |    6 
 oox/inc/oox/vml/vmlinputstream.hxx                                    |    4 
 oox/source/dump/dumperbase.cxx                                        |   14 
 oox/source/helper/textinputstream.cxx                                 |   12 
 oox/source/vml/vmlinputstream.cxx                                     |    2 
 package/inc/ZipPackage.hxx                                            |    5 
 package/inc/ZipPackageFolder.hxx                                      |    6 
 package/inc/ZipPackageStream.hxx                                      |    7 
 package/source/manifest/ManifestReader.cxx                            |    8 
 package/source/manifest/ManifestReader.hxx                            |    9 
 package/source/manifest/ManifestWriter.cxx                            |    8 
 package/source/manifest/ManifestWriter.hxx                            |    9 
 package/source/xstor/owriteablestream.cxx                             |   63 -
 package/source/xstor/owriteablestream.hxx                             |    6 
 package/source/xstor/selfterminatefilestream.cxx                      |   11 
 package/source/xstor/selfterminatefilestream.hxx                      |    2 
 package/source/xstor/switchpersistencestream.cxx                      |   22 
 package/source/xstor/switchpersistencestream.hxx                      |    6 
 package/source/xstor/xfactory.cxx                                     |   12 
 package/source/xstor/xfactory.hxx                                     |    8 
 package/source/xstor/xstorage.cxx                                     |   93 +-
 package/source/xstor/xstorage.hxx                                     |   15 
 package/source/zippackage/ZipPackage.cxx                              |   46 -
 package/source/zippackage/ZipPackageFolder.cxx                        |    8 
 package/source/zippackage/ZipPackageStream.cxx                        |   25 
 reportdesign/source/filter/xml/xmlExport.cxx                          |   16 
 reportdesign/source/filter/xml/xmlExport.hxx                          |    2 
 sc/source/filter/xml/xmlexprt.cxx                                     |   24 
 sc/source/filter/xml/xmlexprt.hxx                                     |    3 
 scripting/source/basprov/basprov.cxx                                  |   11 
 scripting/source/dlgprov/dlgprov.cxx                                  |    8 
 scripting/source/stringresource/stringresource.cxx                    |  323 ++++------
 sd/source/core/CustomAnimationPreset.cxx                              |    7 
 sd/source/core/TransitionPreset.cxx                                   |    7 
 sdext/source/minimizer/configurationaccess.cxx                        |   10 
 sfx2/source/doc/SfxDocumentMetaData.cxx                               |   12 
 sfx2/source/doc/docfile.cxx                                           |    6 
 sfx2/source/doc/doctemplates.cxx                                      |   13 
 sfx2/source/doc/objmisc.cxx                                           |   11 
 shell/source/unix/exec/shellexec.cxx                                  |   16 
 starmath/source/mathmlexport.cxx                                      |   16 
 starmath/source/mathmlexport.hxx                                      |    2 
 stoc/source/javavm/javavm.cxx                                         |   19 
 svtools/inc/svtools/imageresourceaccess.hxx                           |    6 
 svtools/source/misc/imageresourceaccess.cxx                           |    8 
 svx/source/form/fmservs.cxx                                           |    2 
 svx/source/form/fmvwimp.cxx                                           |    9 
 svx/source/form/formcontroller.cxx                                    |   17 
 svx/source/form/legacyformcontroller.cxx                              |   11 
 svx/source/inc/fmservs.hxx                                            |    1 
 svx/source/inc/xmlxtexp.hxx                                           |    2 
 svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx |   86 +-
 svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.hxx |    3 
 svx/source/xml/xmlxtexp.cxx                                           |   12 
 sw/source/core/inc/SwXMLBlockExport.hxx                               |    4 
 sw/source/core/swg/SwXMLBlockExport.cxx                               |    8 
 sw/source/core/swg/SwXMLTextBlocks1.cxx                               |   30 
 sw/source/filter/xml/xmlexp.cxx                                       |   24 
 sw/source/filter/xml/xmlexp.hxx                                       |    2 
 sw/source/filter/xml/xmliteme.cxx                                     |    3 
 sw/source/filter/xml/xmlitemi.cxx                                     |    3 
 sw/source/ui/app/swmodule.cxx                                         |   10 
 ucb/source/ucp/expand/ucpexpand.cxx                                   |    9 
 udkapi/UnoApi_udkapi.mk                                               |   18 
 udkapi/com/sun/star/io/TextInputStream.idl                            |   15 
 udkapi/com/sun/star/io/TextOutputStream.idl                           |   14 
 udkapi/com/sun/star/io/XTextInputStream2.idl                          |   48 +
 udkapi/com/sun/star/io/XTextOutputStream2.idl                         |   48 +
 udkapi/com/sun/star/java/JavaVirtualMachine.idl                       |   17 
 udkapi/com/sun/star/util/MacroExpander.idl                            |    4 
 udkapi/com/sun/star/util/theMacroExpander.idl                         |    7 
 unotools/source/config/lingucfg.cxx                                   |   15 
 unotools/source/config/moduleoptions.cxx                              |   16 
 unotools/source/config/pathoptions.cxx                                |   24 
 unotools/source/i18n/calendarwrapper.cxx                              |    1 
 unotools/source/i18n/instance.hxx                                     |   60 -
 unotools/source/i18n/localedatawrapper.cxx                            |    1 
 unotools/source/i18n/transliterationwrapper.cxx                       |    1 
 vcl/source/window/syschild.cxx                                        |    7 
 xmlhelp/source/cxxhelp/provider/databases.cxx                         |    7 
 xmlhelp/source/treeview/tvread.cxx                                    |   28 
 xmloff/inc/MetaExportComponent.hxx                                    |    4 
 xmloff/inc/SchXMLExport.hxx                                           |    2 
 xmloff/inc/xmloff/xmlexp.hxx                                          |   30 
 xmloff/inc/xmloff/xmluconv.hxx                                        |    5 
 xmloff/inc/xmlversion.hxx                                             |    2 
 xmloff/source/chart/SchXMLExport.cxx                                  |   21 
 xmloff/source/core/xmlexp.cxx                                         |  153 +---
 xmloff/source/core/xmlimp.cxx                                         |    2 
 xmloff/source/core/xmluconv.cxx                                       |   70 --
 xmloff/source/draw/sdxmlexp.cxx                                       |    7 
 xmloff/source/draw/sdxmlexp_impl.hxx                                  |    3 
 xmloff/source/draw/shapeexport4.cxx                                   |    6 
 xmloff/source/forms/layerexport.cxx                                   |    2 
 xmloff/source/meta/MetaExportComponent.cxx                            |   91 +-
 xmloff/source/meta/xmlmetai.cxx                                       |    9 
 xmloff/source/meta/xmlversion.cxx                                     |    9 
 xmloff/source/style/xmlnumfe.cxx                                      |    8 
 xmloff/source/text/XMLAutoTextEventExport.cxx                         |   48 -
 xmloff/source/text/XMLAutoTextEventExport.hxx                         |    2 
 xmlscript/source/xmlflat_imexp/xmlbas_export.hxx                      |   10 
 204 files changed, 1391 insertions(+), 1766 deletions(-)

New commits:
commit eb2f8c5a63df0bfcd3cc13b2071ea2194fa425f0
Author: Noel Grandin <noel at peralex.com>
Date:   Fri Feb 1 13:51:04 2013 +0200

    fdo#46808, use linguistic2::LanguageGuessing service constructor
    
    Change-Id: I5c650a96ea99a1cf16ca8aa61f2db4986790040b

diff --git a/editeng/source/editeng/eerdll.cxx b/editeng/source/editeng/eerdll.cxx
index 740de3a..8c076ff 100644
--- a/editeng/source/editeng/eerdll.cxx
+++ b/editeng/source/editeng/eerdll.cxx
@@ -22,7 +22,7 @@
 #include <vcl/dialog.hxx>
 #include <vcl/msgbox.hxx>
 #include <vcl/svapp.hxx>
-#include <com/sun/star/linguistic2/XLanguageGuessing.hpp>
+#include <com/sun/star/linguistic2/LanguageGuessing.hpp>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <comphelper/processfactory.hxx>
 
@@ -181,14 +181,7 @@ uno::Reference< linguistic2::XLanguageGuessing > GlobalEditData::GetLanguageGues
 {
     if (!xLanguageGuesser.is())
     {
-        uno::Reference< lang::XMultiServiceFactory > xMgr ( comphelper::getProcessServiceFactory() );
-        if (xMgr.is())
-        {
-            xLanguageGuesser = uno::Reference< linguistic2::XLanguageGuessing >(
-                    xMgr->createInstance(
-                        rtl::OUString( "com.sun.star.linguistic2.LanguageGuessing" ) ),
-                        uno::UNO_QUERY );
-        }
+        xLanguageGuesser = linguistic2::LanguageGuessing::create( comphelper::getProcessComponentContext() );
     }
     return xLanguageGuesser;
 }
diff --git a/framework/inc/helper/mischelper.hxx b/framework/inc/helper/mischelper.hxx
index b559de7..f74f69a 100644
--- a/framework/inc/helper/mischelper.hxx
+++ b/framework/inc/helper/mischelper.hxx
@@ -92,10 +92,10 @@ inline bool IsScriptTypeMatchingToLanguage( sal_Int16 nScriptType, LanguageType
 class FWI_DLLPUBLIC LanguageGuessingHelper
 {
     mutable ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XLanguageGuessing >    m_xLanguageGuesser;
-    ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
+    ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
 
 public:
-    LanguageGuessingHelper(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _xServiceManager) : m_xServiceManager(_xServiceManager){}
+    LanguageGuessingHelper(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _xContext) : m_xContext(_xContext){}
 
     ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XLanguageGuessing >  GetGuesser() const;
 };
diff --git a/framework/source/fwi/helper/mischelper.cxx b/framework/source/fwi/helper/mischelper.cxx
index cc22e5b..5245808 100644
--- a/framework/source/fwi/helper/mischelper.cxx
+++ b/framework/source/fwi/helper/mischelper.cxx
@@ -23,6 +23,7 @@
 #include <com/sun/star/frame/ModuleManager.hpp>
 #include <com/sun/star/frame/UICommandDescription.hpp>
 #include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/linguistic2/LanguageGuessing.hpp>
 
 #include <tools/debug.hxx>
 #include <vcl/settings.hxx>
@@ -53,10 +54,7 @@ uno::Reference< linguistic2::XLanguageGuessing > LanguageGuessingHelper::GetGues
     {
         try
         {
-            m_xLanguageGuesser = uno::Reference< linguistic2::XLanguageGuessing >(
-                    m_xServiceManager->createInstance(
-                        rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.linguistic2.LanguageGuessing")) ),
-                        uno::UNO_QUERY );
+            m_xLanguageGuesser = linguistic2::LanguageGuessing::create( m_xContext );
         }
         catch (const uno::Exception &)
         {
diff --git a/framework/source/uielement/langselectionmenucontroller.cxx b/framework/source/uielement/langselectionmenucontroller.cxx
index c3e96b0..c6ad1bf 100644
--- a/framework/source/uielement/langselectionmenucontroller.cxx
+++ b/framework/source/uielement/langselectionmenucontroller.cxx
@@ -80,7 +80,7 @@ DEFINE_INIT_SERVICE                     (   LanguageSelectionMenuController, {}
 LanguageSelectionMenuController::LanguageSelectionMenuController( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager ) :
     svt::PopupMenuControllerBase( xServiceManager ),
     m_bShowMenu( sal_True ),
-    m_aLangGuessHelper( xServiceManager )
+    m_aLangGuessHelper( comphelper::getComponentContext(xServiceManager) )
 {
 }
 
diff --git a/framework/source/uielement/langselectionstatusbarcontroller.cxx b/framework/source/uielement/langselectionstatusbarcontroller.cxx
index ebb83c0..83e60fd 100644
--- a/framework/source/uielement/langselectionstatusbarcontroller.cxx
+++ b/framework/source/uielement/langselectionstatusbarcontroller.cxx
@@ -90,7 +90,7 @@ LangSelectionStatusbarController::LangSelectionStatusbarController( const uno::R
     svt::StatusbarController( xServiceManager, uno::Reference< frame::XFrame >(), OUString(), 0 ),
     m_bShowMenu( sal_True ),
     m_nScriptType( LS_SCRIPT_LATIN | LS_SCRIPT_ASIAN | LS_SCRIPT_COMPLEX ),
-    m_aLangGuessHelper( xServiceManager )
+    m_aLangGuessHelper( comphelper::getComponentContext(xServiceManager) )
 {
 }
 
diff --git a/sw/source/ui/app/swmodule.cxx b/sw/source/ui/app/swmodule.cxx
index 9d4bc1d..8d2c626 100644
--- a/sw/source/ui/app/swmodule.cxx
+++ b/sw/source/ui/app/swmodule.cxx
@@ -54,6 +54,7 @@
 #include <svx/modctrl.hxx>
 #include <com/sun/star/scanner/XScannerManager2.hpp>
 #include <com/sun/star/container/XSet.hpp>
+#include <com/sun/star/linguistic2/LanguageGuessing.hpp>
 #include <comphelper/processfactory.hxx>
 #include <docsh.hxx>
 #include <swmodule.hxx>
@@ -227,14 +228,7 @@ uno::Reference< linguistic2::XLanguageGuessing > SwModule::GetLanguageGuesser()
 {
     if (!m_xLanguageGuesser.is())
     {
-        uno::Reference< lang::XMultiServiceFactory > xMgr ( comphelper::getProcessServiceFactory() );
-        if (xMgr.is())
-        {
-            m_xLanguageGuesser = uno::Reference< linguistic2::XLanguageGuessing >(
-                    xMgr->createInstance(
-                        rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.linguistic2.LanguageGuessing"))),
-                        uno::UNO_QUERY );
-        }
+        m_xLanguageGuesser = linguistic2::LanguageGuessing::create( comphelper::getProcessComponentContext() );
     }
     return m_xLanguageGuesser;
 }
commit 0cd4caa547a75316c6b3f2992dd66b2294c6f1ae
Author: Noel Grandin <noel at peralex.com>
Date:   Fri Feb 1 13:28:32 2013 +0200

    fdo#46808, convert code in desktop module to XComponentContext
    
    Change-Id: I79a22f52ebe59f8f89291d4e6e78bd37817cd047

diff --git a/comphelper/source/misc/synchronousdispatch.cxx b/comphelper/source/misc/synchronousdispatch.cxx
index bb0d28a..71d7a93 100644
--- a/comphelper/source/misc/synchronousdispatch.cxx
+++ b/comphelper/source/misc/synchronousdispatch.cxx
@@ -22,7 +22,7 @@
 #include "com/sun/star/frame/XSynchronousDispatch.hpp"
 #include "com/sun/star/lang/XComponent.hpp"
 #include "com/sun/star/lang/XMultiServiceFactory.hpp"
-#include "com/sun/star/util/XURLTransformer.hpp"
+#include "com/sun/star/util/URLTransformer.hpp"
 
 #include "comphelper/synchronousdispatch.hxx"
 #include "comphelper/processfactory.hxx"
@@ -48,11 +48,8 @@ uno::Reference< lang::XComponent > SynchronousDispatch::dispatch(
 {
     util::URL aURL;
     aURL.Complete = sURL;
-    uno::Reference < util::XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance(
-                                                                   "com.sun.star.util.URLTransformer"),
-                                                     uno::UNO_QUERY );
-    if ( xTrans.is() )
-        xTrans->parseStrict( aURL );
+    uno::Reference < util::XURLTransformer > xTrans = util::URLTransformer::create( ::comphelper::getProcessComponentContext() );
+    xTrans->parseStrict( aURL );
 
     uno::Reference < frame::XDispatch > xDispatcher;
     uno::Reference < frame::XDispatchProvider > xProvider( xStartPoint, uno::UNO_QUERY );
diff --git a/desktop/inc/app.hxx b/desktop/inc/app.hxx
index 8fd1b58..2f44f73 100644
--- a/desktop/inc/app.hxx
+++ b/desktop/inc/app.hxx
@@ -148,7 +148,7 @@ class Desktop : public Application
         bool                    InitializeConfiguration();
         void                    FlushConfiguration();
         static sal_Bool         shouldLaunchQuickstart();
-        sal_Bool                InitializeQuickstartMode( com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rSMgr );
+        sal_Bool                InitializeQuickstartMode( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext );
 
         void                    HandleBootstrapPathErrors( ::utl::Bootstrap::Status, const ::rtl::OUString& aMsg );
         void                    StartSetup( const ::rtl::OUString& aParameters );
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 6a355dc..70060ed 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1113,10 +1113,10 @@ sal_Bool impl_callRecoveryUI(sal_Bool bEmergencySave     ,
     static ::rtl::OUString COMMAND_RECOVERY("vnd.sun.star.autorecovery:/doAutoRecovery");
     static ::rtl::OUString COMMAND_CRASHREPORT("vnd.sun.star.autorecovery:/doCrashReport");
 
-    css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory();
+    css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
 
     Reference< css::frame::XSynchronousDispatch > xRecoveryUI(
-        xSMGR->createInstance(SERVICENAME_RECOVERYUI),
+        xContext->getServiceManager()->createInstanceWithContext(SERVICENAME_RECOVERYUI, xContext),
         css::uno::UNO_QUERY_THROW);
 
     Reference< css::util::XURLTransformer > xURLParser =
@@ -1428,7 +1428,6 @@ int Desktop::Main()
     utl::Bootstrap::reloadData();
     SetSplashScreenProgress(20);
 
-    Reference< XMultiServiceFactory > xSMgr = ::comphelper::getProcessServiceFactory();
     Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
 
     Reference< XRestartManager > xRestartManager( OfficeRestartManager::get(xContext) );
@@ -1633,7 +1632,7 @@ int Desktop::Main()
 
         if ( !bTerminateRequested && !rCmdLineArgs.IsInvisible() &&
              !rCmdLineArgs.IsNoQuickstart() )
-            InitializeQuickstartMode( xSMgr );
+            InitializeQuickstartMode( xContext );
 
         RTL_LOGFILE_CONTEXT( aLog2, "desktop (cd100003) createInstance com.sun.star.frame.Desktop" );
         try
@@ -1859,7 +1858,7 @@ sal_Bool Desktop::shouldLaunchQuickstart()
 }
 
 
-sal_Bool Desktop::InitializeQuickstartMode( Reference< XMultiServiceFactory >& rSMgr )
+sal_Bool Desktop::InitializeQuickstartMode( const Reference< XComponentContext >& rxContext )
 {
     try
     {
@@ -1883,9 +1882,9 @@ sal_Bool Desktop::InitializeQuickstartMode( Reference< XMultiServiceFactory >& r
         {
             Sequence< Any > aSeq( 1 );
             aSeq[0] <<= bQuickstart;
-            Reference < XComponent > xQuickstart( rSMgr->createInstanceWithArguments(
-                                                rtl::OUString( "com.sun.star.office.Quickstart" ), aSeq ),
-                                                UNO_QUERY );
+            Reference < XComponent > xQuickstart(
+                    rxContext->getServiceManager()->createInstanceWithArgumentsAndContext("com.sun.star.office.Quickstart", aSeq, rxContext),
+                    UNO_QUERY );
         }
         return sal_True;
     }
@@ -2060,7 +2059,6 @@ void Desktop::PreloadModuleData( const CommandLineArgs& rArgs )
 
 void Desktop::PreloadConfigurationData()
 {
-    Reference< XMultiServiceFactory > rFactory = ::comphelper::getProcessServiceFactory();
     Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
     Reference< XNameAccess > xNameAccess = css::frame::UICommandDescription::create(xContext);
 
@@ -2181,8 +2179,9 @@ void Desktop::PreloadConfigurationData()
 
     // preload filter configuration
     Sequence< OUString > aSeq;
-    xNameAccess = Reference< XNameAccess >( rFactory->createInstance(
-                    rtl::OUString( "com.sun.star.document.FilterFactory" )), UNO_QUERY );
+    xNameAccess = Reference< XNameAccess >(
+                    xContext->getServiceManager()->createInstanceWithContext("com.sun.star.document.FilterFactory", xContext),
+                    UNO_QUERY );
     if ( xNameAccess.is() )
     {
         try
@@ -2195,8 +2194,9 @@ void Desktop::PreloadConfigurationData()
     }
 
     // preload type detection configuration
-    xNameAccess = Reference< XNameAccess >( rFactory->createInstance(
-                    rtl::OUString( "com.sun.star.document.TypeDetection" )), UNO_QUERY );
+    xNameAccess = Reference< XNameAccess >(
+                    xContext->getServiceManager()->createInstanceWithContext("com.sun.star.document.TypeDetection", xContext),
+                    UNO_QUERY );
     if ( xNameAccess.is() )
     {
         try
@@ -2700,8 +2700,8 @@ void Desktop::HandleAppEvent( const ApplicationEvent& rAppEvent )
             Sequence< Any > aSeq( 1 );
             aSeq[0] <<= bQuickstart;
 
-            Reference < XInitialization > xQuickstart( ::comphelper::getProcessServiceFactory()->createInstance(
-                                                           rtl::OUString( "com.sun.star.office.Quickstart" )),
+            Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
+            Reference < XInitialization > xQuickstart( xContext->getServiceManager()->createInstanceWithContext("com.sun.star.office.Quickstart", xContext),
                                                        UNO_QUERY );
             if ( xQuickstart.is() )
                 xQuickstart->initialize( aSeq );
@@ -2787,9 +2787,10 @@ void Desktop::OpenSplashScreen()
         Sequence< Any > aSeq( 2 );
         aSeq[0] <<= bVisible;
         aSeq[1] <<= aAppName;
+        css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
         m_rSplashScreen = Reference<XStatusIndicator>(
-            comphelper::getProcessServiceFactory()->createInstanceWithArguments(
-            aSplashService, aSeq), UNO_QUERY);
+            xContext->getServiceManager()->createInstanceWithArgumentsAndContext(aSplashService, aSeq, xContext),
+            UNO_QUERY);
 
         if(m_rSplashScreen.is())
                 m_rSplashScreen->start(OUString("SplashScreen"), 100);
@@ -2907,8 +2908,10 @@ void Desktop::CheckFirstRun( )
                 aSeq[0] <<= bQuickstart;
                 aSeq[1] <<= bAutostart;
 
-                Reference < XInitialization > xQuickstart( ::comphelper::getProcessServiceFactory()->createInstance(
-                                                               OUString::createFromAscii( "com.sun.star.office.Quickstart" )),UNO_QUERY );
+                css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
+                Reference < XInitialization > xQuickstart(
+                                                xContext->getServiceManager()->createInstanceWithContext("com.sun.star.office.Quickstart", xContext),
+                                                UNO_QUERY );
                 if ( xQuickstart.is() )
                     xQuickstart->initialize( aSeq );
                 RegCloseKey( hKey );
diff --git a/desktop/source/app/appfirststart.cxx b/desktop/source/app/appfirststart.cxx
index 1af0ac9..471f77b 100644
--- a/desktop/source/app/appfirststart.cxx
+++ b/desktop/source/app/appfirststart.cxx
@@ -70,8 +70,10 @@ void Desktop::DoRestartActionsIfNecessary( sal_Bool bQuickStart )
                 sal_Bool bQuickstart = shouldLaunchQuickstart();
                 aSeq[0] <<= bQuickstart;
 
-                Reference < XInitialization > xQuickstart( ::comphelper::getProcessServiceFactory()->createInstance(
-                    OUString( "com.sun.star.office.Quickstart"  ) ),UNO_QUERY_THROW );
+                css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
+                Reference < XInitialization > xQuickstart(
+                    xContext->getServiceManager()->createInstanceWithContext("com.sun.star.office.Quickstart", xContext),
+                    UNO_QUERY_THROW );
                 xQuickstart->initialize( aSeq );
             }
         }
diff --git a/desktop/source/app/appinit.cxx b/desktop/source/app/appinit.cxx
index 9e6a5c1..cbb7a32 100644
--- a/desktop/source/app/appinit.cxx
+++ b/desktop/source/app/appinit.cxx
@@ -89,12 +89,11 @@ static void configureUcb()
     OUString aDesktopEnvironment;
     if ((aValue >>= aDesktopEnvironment) && aDesktopEnvironment == "GNOME")
     {
-        UniversalContentBroker::create(
-            comphelper::getProcessComponentContext())->
-            registerContentProvider(
+        Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
+        UniversalContentBroker::create(xContext)
+            ->registerContentProvider(
                 Reference<XContentProvider>(
-                    comphelper::getProcessServiceFactory()->createInstance(
-                        "com.sun.star.ucb.GnomeVFSContentProvider"),
+                    xContext->getServiceManager()->createInstanceWithContext("com.sun.star.ucb.GnomeVFSContentProvider", xContext),
                     UNO_QUERY_THROW),
                 ".*", false);
     }
@@ -174,9 +173,10 @@ void Desktop::createAcceptor(const OUString& aAcceptString)
         Sequence< Any > aSeq( 2 );
         aSeq[0] <<= aAcceptString;
         aSeq[1] <<= bAccept;
+        Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
         Reference<XInitialization> rAcceptor(
-            ::comphelper::getProcessServiceFactory()->createInstance(
-            OUString("com.sun.star.office.Acceptor" )), UNO_QUERY );
+            xContext->getServiceManager()->createInstanceWithContext("com.sun.star.office.Acceptor", xContext),
+            UNO_QUERY );
         if ( rAcceptor.is() )
         {
             try
diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx
index 6301fdc..61c57c1 100644
--- a/desktop/source/migration/migration.cxx
+++ b/desktop/source/migration/migration.cxx
@@ -207,7 +207,7 @@ bool MigrationImpl::initializeMigration()
 
 void Migration::migrateSettingsIfNecessary()
 {
-    MigrationImpl aImpl( comphelper::getProcessServiceFactory() );
+    MigrationImpl aImpl;
 
     if (! aImpl.initializeMigration() )
         return;
@@ -227,9 +227,8 @@ void Migration::migrateSettingsIfNecessary()
     (void)bResult;
 }
 
-MigrationImpl::MigrationImpl(const uno::Reference< XMultiServiceFactory >& xFactory)
+MigrationImpl::MigrationImpl()
     : m_vrVersions(new strings_v)
-    , m_xFactory(xFactory)
 {
 }
 
@@ -265,10 +264,10 @@ sal_Bool MigrationImpl::doMigration()
             lArgs[0] <<= aOldCfgDataPath + vModulesInfo[i].sModuleShortName;
             lArgs[1] <<= embed::ElementModes::READ;
 
-            uno::Reference< lang::XSingleServiceFactory > xStorageFactory(
-                     embed::FileSystemStorageFactory::create(comphelper::getComponentContext(m_xFactory)));
+            uno::Reference< uno::XComponentContext > xContext(comphelper::getProcessComponentContext());
+            uno::Reference< lang::XSingleServiceFactory > xStorageFactory(embed::FileSystemStorageFactory::create(xContext));
             uno::Reference< embed::XStorage >             xModules(xStorageFactory->createInstanceWithArguments(lArgs), uno::UNO_QUERY);
-            uno::Reference< ui::XUIConfigurationManager > xOldCfgManager( m_xFactory->createInstance("com.sun.star.ui.UIConfigurationManager"), uno::UNO_QUERY );
+            uno::Reference< ui::XUIConfigurationManager > xOldCfgManager(xContext->getServiceManager()->createInstanceWithContext("com.sun.star.ui.UIConfigurationManager", xContext), uno::UNO_QUERY );
             uno::Reference< ui::XUIConfigurationStorage > xOldCfgStorage( xOldCfgManager, uno::UNO_QUERY );
             uno::Reference< ui::XUIConfigurationPersistence > xOldCfgPersistence( xOldCfgManager, uno::UNO_QUERY );
 
@@ -336,8 +335,7 @@ sal_Bool MigrationImpl::doMigration()
 void MigrationImpl::refresh()
 {
     uno::Reference< XRefreshable >(
-        configuration::theDefaultProvider::get(
-            comphelper::getComponentContext(m_xFactory)),
+        configuration::theDefaultProvider::get(comphelper::getProcessComponentContext()),
         uno::UNO_QUERY_THROW)->refresh();
 }
 
@@ -952,6 +950,7 @@ void MigrationImpl::runServices()
     // and execute the migration job
     uno::Reference< XJob > xMigrationJob;
 
+    uno::Reference< uno::XComponentContext > xContext(comphelper::getProcessComponentContext());
     migrations_v::const_iterator i_mig  = m_vrMigrations->begin();
     while (i_mig != m_vrMigrations->end())
     {
@@ -969,8 +968,9 @@ void MigrationImpl::runServices()
                 seqArguments[2] = uno::makeAny(NamedValue("ExtensionBlackList",
                     uno::makeAny( seqExtBlackList )));
 
-                xMigrationJob = uno::Reference< XJob >(m_xFactory->createInstanceWithArguments(
-                    i_mig->service, seqArguments), uno::UNO_QUERY_THROW);
+                xMigrationJob = uno::Reference< XJob >(
+                    xContext->getServiceManager()->createInstanceWithArgumentsAndContext(i_mig->service, seqArguments, xContext),
+                    uno::UNO_QUERY_THROW);
 
                 xMigrationJob->execute(uno::Sequence< NamedValue >());
 
@@ -1007,7 +1007,7 @@ void MigrationImpl::runServices()
     lArgs[1] <<= embed::ElementModes::READ;
 
     uno::Reference< lang::XSingleServiceFactory > xStorageFactory(
-                     embed::FileSystemStorageFactory::create(comphelper::getComponentContext(m_xFactory)));
+                     embed::FileSystemStorageFactory::create(comphelper::getProcessComponentContext()));
     uno::Reference< embed::XStorage >             xModules;
 
     xModules = uno::Reference< embed::XStorage >(xStorageFactory->createInstanceWithArguments(lArgs), uno::UNO_QUERY);
diff --git a/desktop/source/migration/migration_impl.hxx b/desktop/source/migration/migration_impl.hxx
index ef2e659..653813f 100644
--- a/desktop/source/migration/migration_impl.hxx
+++ b/desktop/source/migration/migration_impl.hxx
@@ -32,7 +32,6 @@
 
 #include <com/sun/star/uno/Reference.hxx>
 
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <com/sun/star/container/XNameAccess.hpp>
 #include <com/sun/star/container/XIndexAccess.hpp>
 #include <com/sun/star/container/XIndexContainer.hpp>
@@ -185,7 +184,6 @@ class MigrationImpl
 
 private:
     strings_vr m_vrVersions;
-    NS_UNO::Reference< NS_CSS::lang::XMultiServiceFactory > m_xFactory;
 
     migrations_available m_vMigrationsAvailable; // list of all available migrations
     migrations_vr        m_vrMigrations;         // list of all migration specs from config
@@ -232,7 +230,7 @@ private:
     bool checkMigrationCompleted();
 
 public:
-    MigrationImpl(const NS_UNO::Reference< NS_CSS::lang::XMultiServiceFactory >&);
+    MigrationImpl();
     ~MigrationImpl();
     bool initializeMigration();
     sal_Bool doMigration();
commit e7a76a0e65a185c3ac0ef041f7e6957d3f8b655b
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Jan 31 18:02:02 2013 +0200

    fdo#46808, convert form::runtime::FormController to new-style
    
    Change-Id: Ied761cbb8e23d65596a5fdc4650e1cd2c95e9245

diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx
index 93b4230..a3667b1 100644
--- a/extensions/source/bibliography/datman.cxx
+++ b/extensions/source/bibliography/datman.cxx
@@ -38,6 +38,7 @@
 #include <com/sun/star/sdb/XCompletedConnection.hpp>
 #include <com/sun/star/task/InteractionHandler.hpp>
 #include <com/sun/star/form/XLoadable.hpp>
+#include <com/sun/star/form/runtime/FormController.hpp>
 #include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
 #include <com/sun/star/form/XGridColumnFactory.hpp>
 #include <com/sun/star/io/XDataInputStream.hpp>
@@ -1641,9 +1642,8 @@ uno::Reference< form::runtime::XFormController > BibDataManager::GetFormControll
 {
     if(!m_xFormCtrl.is())
     {
-        Reference< lang::XMultiServiceFactory > xMgr = comphelper::getProcessServiceFactory();
-        m_xFormCtrl = uno::Reference< form::runtime::XFormController > (
-            xMgr->createInstance("com.sun.star.form.runtime.FormController"), UNO_QUERY);
+        Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext();
+        m_xFormCtrl = form::runtime::FormController::create(xContext);
         m_xFormCtrl->setModel(uno::Reference< awt::XTabControllerModel > (getForm(), UNO_QUERY));
         m_xFormDispatch = uno::Reference< frame::XDispatch > ( m_xFormCtrl, UNO_QUERY);
     }
diff --git a/extensions/source/propctrlr/eventhandler.cxx b/extensions/source/propctrlr/eventhandler.cxx
index 73a6016..7e8a020 100644
--- a/extensions/source/propctrlr/eventhandler.cxx
+++ b/extensions/source/propctrlr/eventhandler.cxx
@@ -41,7 +41,7 @@
 #include <com/sun/star/container/XNameReplace.hpp>
 #include <com/sun/star/form/FormComponentType.hpp>
 #include <com/sun/star/form/XForm.hpp>
-#include <com/sun/star/form/runtime/XFormController.hpp>
+#include <com/sun/star/form/runtime/FormController.hpp>
 #include <com/sun/star/inspection/PropertyControlType.hpp>
 #include <com/sun/star/lang/NullPointerException.hpp>
 #include <com/sun/star/script/XEventAttacherManager.hpp>
@@ -107,6 +107,7 @@ namespace pcr
     using ::com::sun::star::container::XNameContainer;
     using ::com::sun::star::awt::XTabControllerModel;
     using ::com::sun::star::form::XForm;
+    using ::com::sun::star::form::runtime::FormController;
     using ::com::sun::star::form::runtime::XFormController;
     using ::com::sun::star::beans::UnknownPropertyException;
     using ::com::sun::star::uno::makeAny;
@@ -1110,8 +1111,7 @@ namespace pcr
         if ( xComponentAsForm.is() )
         {
             Reference< XTabControllerModel > xComponentAsTCModel( m_xComponent, UNO_QUERY_THROW );
-            Reference< XFormController > xController(
-                m_aContext.createComponent( "com.sun.star.form.runtime.FormController" ), UNO_QUERY_THROW );
+            Reference< XFormController > xController = FormController::create( m_aContext.getUNOContext() );
             xController->setModel( xComponentAsTCModel );
 
             xReturn = xController;
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index 1ef0fec..9687764 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -136,6 +136,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/form/inspe
 	DefaultFormComponentInspectorModel \
 ))
 $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/form/runtime,\
+	FormController \
 	FormOperations \
 ))
 $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/frame,\
@@ -841,9 +842,6 @@ $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/form/in
 	XMLFormsPropertyHandler \
 	XSDValidationPropertyHandler \
 ))
-$(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/form/runtime,\
-	FormController \
-))
 $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/form/validation,\
 	ValidatableBindableControlModel \
 	ValidatableControlModel \
diff --git a/offapi/com/sun/star/form/runtime/FormController.idl b/offapi/com/sun/star/form/runtime/FormController.idl
index 1f92344..48eaa6f 100644
--- a/offapi/com/sun/star/form/runtime/FormController.idl
+++ b/offapi/com/sun/star/form/runtime/FormController.idl
@@ -29,10 +29,7 @@ module com { module sun { module star { module form { module runtime {
 /** specifies a component controlling the interaction between the user and multiple
     form controls belonging to a single form.
  */
-service FormController
-{
-    interface XFormController;
-};
+service FormController : XFormController;
 
 
 }; }; }; }; };
diff --git a/svx/source/form/fmservs.cxx b/svx/source/form/fmservs.cxx
index 0564317..e230a3f 100644
--- a/svx/source/form/fmservs.cxx
+++ b/svx/source/form/fmservs.cxx
@@ -79,7 +79,7 @@ namespace svxform
 
         // ------------------------------------------------------------------------
         // FormController
-        REGISTER_SERVICE( FormController, FM_FORM_CONTROLLER );
+        REGISTER_SERVICE( FormController, OUString( "com.sun.star.form.runtime.FormController" ) );
         REGISTER_SERVICE( LegacyFormController, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.FormController" ) ) );
 
         // ------------------------------------------------------------------------
diff --git a/svx/source/form/fmvwimp.cxx b/svx/source/form/fmvwimp.cxx
index 8643daa..938c69e 100644
--- a/svx/source/form/fmvwimp.cxx
+++ b/svx/source/form/fmvwimp.cxx
@@ -59,6 +59,7 @@
 #include <com/sun/star/form/XReset.hpp>
 #include <com/sun/star/form/binding/XBindableValue.hpp>
 #include <com/sun/star/form/binding/XValueBinding.hpp>
+#include <com/sun/star/form/runtime/FormController.hpp>
 #include <com/sun/star/form/submission/XSubmissionSupplier.hpp>
 #include <com/sun/star/awt/XTabControllerModel.hpp>
 #include <com/sun/star/awt/XControlContainer.hpp>
@@ -110,6 +111,7 @@ using namespace ::svxform;
     using ::com::sun::star::lang::XComponent;
     using ::com::sun::star::container::XIndexAccess;
     using ::com::sun::star::form::XForm;
+    using ::com::sun::star::form::runtime::FormController;
     using ::com::sun::star::form::runtime::XFormController;
     using ::com::sun::star::script::XEventAttacherManager;
     using ::com::sun::star::awt::XTabControllerModel;
@@ -340,12 +342,7 @@ void FormViewPageWindowAdapter::setController(const Reference< XForm > & xForm,
     Reference< XTabControllerModel >  xTabOrder(xForm, UNO_QUERY);
 
     // create a form controller
-    Reference< XFormController > xController( m_aContext.createComponent( FM_FORM_CONTROLLER ), UNO_QUERY );
-    if ( !xController.is() )
-    {
-        ShowServiceNotAvailableError( m_pWindow, FM_FORM_CONTROLLER, sal_True );
-        return;
-    }
+    Reference< XFormController > xController( FormController::create(m_aContext.getUNOContext()) );
 
     Reference< XInteractionHandler > xHandler;
     if ( _rxParentController.is() )
diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx
index 8de5697..05f5d3f 100644
--- a/svx/source/form/formcontroller.cxx
+++ b/svx/source/form/formcontroller.cxx
@@ -739,7 +739,7 @@ Sequence< ::rtl::OUString> FormController::getSupportedServiceNames_Static(void)
     if (!aServices.getLength())
     {
         aServices.realloc(2);
-        aServices.getArray()[0] = FM_FORM_CONTROLLER;
+        aServices.getArray()[0] = OUString( "com.sun.star.form.runtime.FormController"  );
         aServices.getArray()[1] = ::rtl::OUString("com.sun.star.awt.control.TabController");
     }
     return aServices;
diff --git a/svx/source/form/legacyformcontroller.cxx b/svx/source/form/legacyformcontroller.cxx
index 2ce4678..b3f0641 100644
--- a/svx/source/form/legacyformcontroller.cxx
+++ b/svx/source/form/legacyformcontroller.cxx
@@ -21,11 +21,12 @@
 #include "fmservs.hxx"
 
 #include <com/sun/star/form/XFormController.hpp>
-#include <com/sun/star/form/runtime/XFormController.hpp>
+#include <com/sun/star/form/runtime/FormController.hpp>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <com/sun/star/lang/XServiceInfo.hpp>
 
 #include <cppuhelper/implbase2.hxx>
+#include <comphelper/processfactory.hxx>
 
 //........................................................................
 namespace svxform
@@ -44,11 +45,13 @@ namespace svxform
     using ::com::sun::star::uno::makeAny;
     using ::com::sun::star::uno::Sequence;
     using ::com::sun::star::uno::Type;
+    using ::com::sun::star::uno::XComponentContext;
     using ::com::sun::star::lang::XMultiServiceFactory;
     using ::com::sun::star::awt::XControl;
     using ::com::sun::star::awt::XTabControllerModel;
     using ::com::sun::star::awt::XControlContainer;
     using ::com::sun::star::lang::XServiceInfo;
+    using ::com::sun::star::form::runtime::FormController;
     /** === end UNO using === **/
 
     using namespace ::com::sun::star;
@@ -70,12 +73,12 @@ namespace svxform
     public:
         static Reference< XInterface > Create( const Reference< XMultiServiceFactory >& _rxFactory )
         {
-            return *( new LegacyFormController( _rxFactory ) );
+            return *( new LegacyFormController( comphelper::getComponentContext(_rxFactory) ) );
         }
 
     protected:
-        LegacyFormController( const Reference< XMultiServiceFactory >& _rxFactory )
-            :m_xDelegator( _rxFactory->createInstance( FM_FORM_CONTROLLER ), UNO_QUERY_THROW )
+        LegacyFormController( const Reference< XComponentContext >& _rxContext )
+            :m_xDelegator( FormController::create(_rxContext) )
         {
         }
 
diff --git a/svx/source/inc/fmservs.hxx b/svx/source/inc/fmservs.hxx
index 61ad6dc..62705b6 100644
--- a/svx/source/inc/fmservs.hxx
+++ b/svx/source/inc/fmservs.hxx
@@ -45,7 +45,6 @@
 #define FM_COMPONENT_IMAGECONTROL       rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.ImageControl" ) )
 #define FM_CONTROL_GRID                 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.control.Grid" ) )
 #define FM_CONTROL_GRIDCONTROL          rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.control.GridControl" ) )
-#define FM_FORM_CONTROLLER              rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.runtime.FormController" ) )
 #define SRV_SDB_CONNECTION              rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sdb.Connection" ) )
 #define FM_SUN_COMPONENT_FORM           rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.Form" ) )
 #define FM_SUN_COMPONENT_TEXTFIELD      rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.TextField" ) )
commit 5d0b2b011ff2f141db452ffef84c3a77efbd6e7b
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Jan 31 17:49:22 2013 +0200

    fdo#46808, convert comphelper::OStorageHelper to XComponentContext
    
    And drop the optional parameter on CreatePackageEncryptionData
    because no-one is using it.
    
    Change-Id: Ia83ebfc099dd121273d2c39431d015b3bc0abd81

diff --git a/comphelper/inc/comphelper/storagehelper.hxx b/comphelper/inc/comphelper/storagehelper.hxx
index 5bbbebe..b3351aa 100644
--- a/comphelper/inc/comphelper/storagehelper.hxx
+++ b/comphelper/inc/comphelper/storagehelper.hxx
@@ -23,7 +23,6 @@
 
 #include <com/sun/star/uno/Sequence.hxx>
 #include <com/sun/star/uno/Reference.hxx>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <com/sun/star/embed/ElementModes.hpp>
 #include "comphelper/comphelperdllapi.h"
 
@@ -173,9 +172,7 @@ public:
 
     static ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >
         CreatePackageEncryptionData(
-            const ::rtl::OUString& aPassword,
-            const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xSF
-                = ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >() );
+            const ::rtl::OUString& aPassword );
 
     static sal_Bool IsValidZipEntryFileName( const ::rtl::OUString& aName, sal_Bool bSlashAllowed );
     static sal_Bool IsValidZipEntryFileName( const sal_Unicode *pChar, sal_Int32 nLength, sal_Bool bSlashAllowed );
diff --git a/comphelper/source/misc/storagehelper.cxx b/comphelper/source/misc/storagehelper.cxx
index 4fc2302..9b4cb09 100644
--- a/comphelper/source/misc/storagehelper.cxx
+++ b/comphelper/source/misc/storagehelper.cxx
@@ -29,6 +29,7 @@
 #include <com/sun/star/beans/PropertyValue.hpp>
 #include <com/sun/star/beans/NamedValue.hpp>
 #include <com/sun/star/beans/IllegalTypeException.hpp>
+#include <com/sun/star/xml/crypto/NSSInitializer.hpp>
 #include <com/sun/star/xml/crypto/XDigestContext.hpp>
 #include <com/sun/star/xml/crypto/XDigestContextSupplier.hpp>
 #include <com/sun/star/xml/crypto/DigestID.hpp>
@@ -376,7 +377,7 @@ uno::Reference< embed::XStorage > OStorageHelper::GetStorageOfFormatFromStream(
 }
 
 // ----------------------------------------------------------------------
-uno::Sequence< beans::NamedValue > OStorageHelper::CreatePackageEncryptionData( const ::rtl::OUString& aPassword, const uno::Reference< lang::XMultiServiceFactory >& xSF )
+uno::Sequence< beans::NamedValue > OStorageHelper::CreatePackageEncryptionData( const ::rtl::OUString& aPassword )
 {
     // TODO/LATER: Should not the method be part of DocPasswordHelper?
     uno::Sequence< beans::NamedValue > aEncryptionData;
@@ -386,11 +387,9 @@ uno::Sequence< beans::NamedValue > OStorageHelper::CreatePackageEncryptionData(
         // generate SHA256 start key
         try
         {
-            uno::Reference< lang::XMultiServiceFactory > xFactory = xSF.is() ? xSF : ::comphelper::getProcessServiceFactory();
-            if ( !xFactory.is() )
-                throw uno::RuntimeException();
+            uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
 
-            uno::Reference< xml::crypto::XDigestContextSupplier > xDigestContextSupplier( xFactory->createInstance( OUString( "com.sun.star.xml.crypto.NSSInitializer" ) ), uno::UNO_QUERY_THROW );
+            uno::Reference< xml::crypto::XNSSInitializer > xDigestContextSupplier = xml::crypto::NSSInitializer::create(xContext);
             uno::Reference< xml::crypto::XDigestContext > xDigestContext( xDigestContextSupplier->getDigestContext( xml::crypto::DigestID::SHA256, uno::Sequence< beans::NamedValue >() ), uno::UNO_SET_THROW );
 
             ::rtl::OString aUTF8Password( ::rtl::OUStringToOString( aPassword, RTL_TEXTENCODING_UTF8 ) );
commit a9934b36fea86646586f10daaa310d7173ede795
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Jan 31 17:19:17 2013 +0200

    fdo#46808, some simple conversions to XComponentContext
    
    Change-Id: I68e90fde0645d4d1d518d22620d4c28ae91139d4

diff --git a/extensions/source/bibliography/bibbeam.cxx b/extensions/source/bibliography/bibbeam.cxx
index 4eaf83a..3a168a7 100644
--- a/extensions/source/bibliography/bibbeam.cxx
+++ b/extensions/source/bibliography/bibbeam.cxx
@@ -137,9 +137,9 @@ namespace bib
 
         if( m_xControlContainer.is())
         {
-            uno::Reference< lang::XMultiServiceFactory >  xMgr = comphelper::getProcessServiceFactory();
+            uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext();
 
-            if ( m_xGridModel.is() && xMgr.is())
+            if ( m_xGridModel.is())
             {
                 uno::Reference< XPropertySet >  xPropSet( m_xGridModel, UNO_QUERY );
 
@@ -149,10 +149,8 @@ namespace bib
                     rtl::OUString aControlName;
                     aAny >>= aControlName;
 
-                    m_xControl = Reference< awt::XControl > (xMgr->createInstance( aControlName ), UNO_QUERY );
-                    DBG_ASSERT( m_xControl.is(), "no GridControl created" );
-                    if ( m_xControl.is() )
-                        m_xControl->setModel( m_xGridModel );
+                    m_xControl = Reference< awt::XControl > ( xContext->getServiceManager()->createInstanceWithContext(aControlName, xContext), UNO_QUERY_THROW );
+                    m_xControl->setModel( m_xGridModel );
                 }
 
                 if ( m_xControl.is() )
diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx
index 298fe29..93b4230 100644
--- a/extensions/source/bibliography/datman.cxx
+++ b/extensions/source/bibliography/datman.cxx
@@ -564,8 +564,6 @@ DBChangeDialog_Impl::DBChangeDialog_Impl(Window* pParent, BibDataManager* pMan )
     aSelectionLB.SetDoubleClickHdl( LINK(this, DBChangeDialog_Impl, DoubleClickHdl));
     try
     {
-        Reference< XMultiServiceFactory >  xMgr = comphelper::getProcessServiceFactory();
-
         ::Size aSize = aSelectionHB.GetSizePixel();
         long nTabs[2];
         nTabs[0] = 1;// Number of Tabs
@@ -1403,8 +1401,8 @@ Reference< awt::XControlModel > BibDataManager::loadControlModel(
             else
                 aInstanceName += getControlName(nFormatKey);
 
-            Reference< XMultiServiceFactory >  xMgr = comphelper::getProcessServiceFactory();
-            Reference< XInterface >  xObject = xMgr->createInstance(aInstanceName);
+            Reference< XComponentContext >  xContext = comphelper::getProcessComponentContext();
+            Reference< XInterface >  xObject = xContext->getServiceManager()->createInstanceWithContext(aInstanceName, xContext);
             xModel=Reference< awt::XControlModel > ( xObject, UNO_QUERY );
             Reference< XPropertySet >  xPropSet( xModel, UNO_QUERY );
             Any aFieldName; aFieldName <<= aName;
diff --git a/extensions/source/bibliography/general.cxx b/extensions/source/bibliography/general.cxx
index dea0a28..7b9a4a4 100644
--- a/extensions/source/bibliography/general.cxx
+++ b/extensions/source/bibliography/general.cxx
@@ -279,7 +279,6 @@ BibGeneralPage::BibGeneralPage(Window* pParent, BibDataManager* pMan):
 
     xCtrlContnr = VCLUnoHelper::CreateControlContainer(&aControlParentWin);
 
-    xMgr = comphelper::getProcessServiceFactory();
     // the control should be a bit smaller than the fixed text
     Size aControlSize(aIdentifierFT.GetSizePixel());
     aControlSize.Width() = aControlSize.Width() * 8 / 10;
@@ -464,7 +463,7 @@ uno::Reference< awt::XControlModel >  BibGeneralPage::AddXControl(
     {
         sal_Bool bTypeListBox = sTypeColumnName == rName;
         xCtrModel = pDatMan->loadControlModel(rName, bTypeListBox);
-        if ( xCtrModel.is() && xMgr.is())
+        if ( xCtrModel.is() )
         {
             uno::Reference< beans::XPropertySet >  xPropSet( xCtrModel, UNO_QUERY );
 
@@ -523,7 +522,8 @@ uno::Reference< awt::XControlModel >  BibGeneralPage::AddXControl(
 
                 }
 
-                uno::Reference< awt::XControl >  xControl(xMgr->createInstance( aControlName ), UNO_QUERY );
+                uno::Reference< XComponentContext > xContext = comphelper::getProcessComponentContext();
+                uno::Reference< awt::XControl > xControl( xContext->getServiceManager()->createInstanceWithContext(aControlName, xContext), UNO_QUERY);
                 if ( xControl.is() )
                 {
                     xControl->setModel( xCtrModel);
diff --git a/extensions/source/bibliography/general.hxx b/extensions/source/bibliography/general.hxx
index bf3a5e7..2b4a7dd 100644
--- a/extensions/source/bibliography/general.hxx
+++ b/extensions/source/bibliography/general.hxx
@@ -111,9 +111,6 @@ class BibGeneralPage: public BibGeneralPageBaseClass, public BibTabPage
     ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer >
                         xCtrlContnr;
 
-    ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
-                        xMgr;
-
     ::com::sun::star::uno::Reference< ::com::sun::star::form::XBoundComponent >
                         xCurrentBoundComponent;
 
commit 834dcf3acde06389d57bec64c2cd6cca8189c079
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Jan 31 17:08:44 2013 +0200

    fdo#46808, Convert package module to XComponentContext
    
    Change-Id: I1b322e57d27e16d177ffa87d3cd42a7d06f3dfab

diff --git a/package/inc/ZipPackage.hxx b/package/inc/ZipPackage.hxx
index c22976ec..7aeb32f 100644
--- a/package/inc/ZipPackage.hxx
+++ b/package/inc/ZipPackage.hxx
@@ -44,6 +44,7 @@ namespace com { namespace sun { namespace star {
     namespace container { class XNameContainer; }
     namespace io { class XStream; class XOutputStream; class XInputStream; class XSeekable; class XActiveDataStreamer; }
     namespace lang { class XMultiServiceFactory; }
+    namespace uno { class XComponentContext; }
     namespace task { class XInteractionHandler; }
 } } }
 enum SegmentEnum
@@ -101,7 +102,7 @@ protected:
     ::com::sun::star::uno::Reference < com::sun::star::io::XStream > m_xStream;
     ::com::sun::star::uno::Reference < com::sun::star::io::XInputStream > m_xContentStream;
     ::com::sun::star::uno::Reference < com::sun::star::io::XSeekable > m_xContentSeek;
-    const ::com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > m_xFactory;
+    const ::com::sun::star::uno::Reference < com::sun::star::uno::XComponentContext > m_xContext;
 
     ZipPackageFolder *m_pRootFolder;
     ZipFile          *m_pZipFile;
@@ -122,7 +123,7 @@ protected:
             const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xTempStream );
 
 public:
-    ZipPackage( const ::com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > &xNewFactory );
+    ZipPackage( const ::com::sun::star::uno::Reference < com::sun::star::uno::XComponentContext > &xContext );
     virtual ~ZipPackage( void );
     ZipFile& getZipFile() { return *m_pZipFile;}
     sal_Int32 getFormat() const { return m_nFormat; }
diff --git a/package/inc/ZipPackageFolder.hxx b/package/inc/ZipPackageFolder.hxx
index 92ad935..a99813c 100644
--- a/package/inc/ZipPackageFolder.hxx
+++ b/package/inc/ZipPackageFolder.hxx
@@ -49,16 +49,14 @@ class ZipPackageFolder : public cppu::ImplInheritanceHelper2
     ::com::sun::star::container::XEnumerationAccess
 >
 {
-protected:
+private:
     ContentHash maContents;
-    const ::com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > m_xFactory;
     sal_Int32 m_nFormat;
     ::rtl::OUString m_sVersion;
 
 public:
 
-    ZipPackageFolder( const ::com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory >& xFactory,
-                      sal_Int32 nFormat,
+    ZipPackageFolder( sal_Int32 nFormat,
                       sal_Bool bAllowRemoveOnInsert );
     virtual ~ZipPackageFolder();
 
diff --git a/package/inc/ZipPackageStream.hxx b/package/inc/ZipPackageStream.hxx
index a9943c1..70e8e13 100644
--- a/package/inc/ZipPackageStream.hxx
+++ b/package/inc/ZipPackageStream.hxx
@@ -23,6 +23,7 @@
 #include <com/sun/star/io/XSeekable.hpp>
 #include <com/sun/star/beans/NamedValue.hpp>
 #include <com/sun/star/packages/XDataSinkEncrSupport.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
 #include <ZipPackageEntry.hxx>
 #include <rtl/ref.hxx>
 #include <cppuhelper/implbase2.hxx>
@@ -45,9 +46,9 @@ class ZipPackageStream : public cppu::ImplInheritanceHelper2
     ::com::sun::star::packages::XDataSinkEncrSupport
 >
 {
-protected:
+private:
     com::sun::star::uno::Reference < com::sun::star::io::XInputStream > xStream;
-    const ::com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > m_xFactory;
+    const ::com::sun::star::uno::Reference < com::sun::star::uno::XComponentContext > m_xContext;
     ZipPackage          &rZipPackage;
     sal_Bool            bToBeCompressed, bToBeEncrypted, bHaveOwnKey, bIsEncrypted;
 
@@ -140,7 +141,7 @@ public:
     void CloseOwnStreamIfAny();
 
     ZipPackageStream ( ZipPackage & rNewPackage,
-                        const ::com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory >& xFactory,
+                        const ::com::sun::star::uno::Reference < com::sun::star::uno::XComponentContext >& xContext,
                         sal_Bool bAllowRemoveOnInsert );
     virtual ~ZipPackageStream( void );
 
diff --git a/package/source/manifest/ManifestReader.cxx b/package/source/manifest/ManifestReader.cxx
index 8631058..bba764a 100644
--- a/package/source/manifest/ManifestReader.cxx
+++ b/package/source/manifest/ManifestReader.cxx
@@ -39,8 +39,8 @@ using namespace ::com::sun::star::xml::sax;
 using namespace ::com::sun::star::packages::manifest;
 using ::rtl::OUString;
 
-ManifestReader::ManifestReader( const Reference < XMultiServiceFactory > & xNewFactory )
-: xFactory ( xNewFactory )
+ManifestReader::ManifestReader( const Reference < XComponentContext > & xContext )
+: m_xContext ( xContext )
 {
 }
 ManifestReader::~ManifestReader()
@@ -50,7 +50,7 @@ Sequence< Sequence< PropertyValue > > SAL_CALL ManifestReader::readManifestSeque
     throw (::com::sun::star::uno::RuntimeException)
 {
     Sequence < Sequence < PropertyValue > > aManifestSequence;
-    Reference < XParser > xParser  = Parser::create(comphelper::getComponentContext(xFactory));
+    Reference < XParser > xParser  = Parser::create(m_xContext);
     try
     {
         vector < Sequence < PropertyValue > > aManVector;
@@ -83,7 +83,7 @@ Sequence< Sequence< PropertyValue > > SAL_CALL ManifestReader::readManifestSeque
 
 Reference < XInterface > SAL_CALL ManifestReader_createInstance( Reference< XMultiServiceFactory > const & rServiceFactory )
 {
-    return *new ManifestReader( rServiceFactory );
+    return *new ManifestReader( comphelper::getComponentContext(rServiceFactory) );
 }
 OUString ManifestReader::static_getImplementationName()
 {
diff --git a/package/source/manifest/ManifestReader.hxx b/package/source/manifest/ManifestReader.hxx
index 7020791..d422f9a 100644
--- a/package/source/manifest/ManifestReader.hxx
+++ b/package/source/manifest/ManifestReader.hxx
@@ -25,7 +25,8 @@
 #include <com/sun/star/lang/XServiceInfo.hpp>
 
 namespace com { namespace sun { namespace star {
-    namespace lang { class XMultiServiceFactory; class XSingleServiceFactory; }
+    namespace lang { class XSingleServiceFactory; }
+    namespace uno { class XComponentContext; }
 } } }
 
 class ManifestReader: public ::cppu::WeakImplHelper2
@@ -34,10 +35,10 @@ class ManifestReader: public ::cppu::WeakImplHelper2
     ::com::sun::star::lang::XServiceInfo
 >
 {
-protected:
-    ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory;
+private:
+    ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
 public:
-    ManifestReader( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & xNewFactory );
+    ManifestReader( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > & xContext );
     virtual ~ManifestReader();
 
     // XManifestReader
diff --git a/package/source/manifest/ManifestWriter.cxx b/package/source/manifest/ManifestWriter.cxx
index 72ea5aa..f6a0c0b 100644
--- a/package/source/manifest/ManifestWriter.cxx
+++ b/package/source/manifest/ManifestWriter.cxx
@@ -40,8 +40,8 @@ using namespace ::com::sun::star::packages;
 using namespace ::com::sun::star::xml::sax;
 using namespace ::com::sun::star::packages::manifest;
 
-ManifestWriter::ManifestWriter( const Reference < XMultiServiceFactory > & xNewFactory )
-: xFactory ( xNewFactory )
+ManifestWriter::ManifestWriter( const Reference < XComponentContext > & xContext )
+: m_xContext ( xContext )
 {
 }
 ManifestWriter::~ManifestWriter()
@@ -52,7 +52,7 @@ ManifestWriter::~ManifestWriter()
 void SAL_CALL ManifestWriter::writeManifestSequence( const Reference< XOutputStream >& rStream, const Sequence< Sequence< PropertyValue > >& rSequence )
         throw (RuntimeException)
 {
-    Reference < XWriter > xSource = Writer::create( comphelper::getComponentContext(xFactory) );
+    Reference < XWriter > xSource = Writer::create( m_xContext );
     xSource->setOutputStream ( rStream );
     try {
         Reference < XDocumentHandler > xHandler ( xSource, UNO_QUERY );
@@ -67,7 +67,7 @@ void SAL_CALL ManifestWriter::writeManifestSequence( const Reference< XOutputStr
 // Component methods
 Reference < XInterface > SAL_CALL ManifestWriter_createInstance( Reference< XMultiServiceFactory > const & rServiceFactory )
 {
-    return *new ManifestWriter( rServiceFactory );
+    return *new ManifestWriter( comphelper::getComponentContext(rServiceFactory) );
 }
 
 OUString ManifestWriter::static_getImplementationName()
diff --git a/package/source/manifest/ManifestWriter.hxx b/package/source/manifest/ManifestWriter.hxx
index 7c91531..8453d92 100644
--- a/package/source/manifest/ManifestWriter.hxx
+++ b/package/source/manifest/ManifestWriter.hxx
@@ -25,7 +25,8 @@
 #include <com/sun/star/lang/XServiceInfo.hpp>
 
 namespace com { namespace sun { namespace star {
-    namespace lang { class XMultiServiceFactory; class XSingleServiceFactory; }
+    namespace lang { class XSingleServiceFactory; }
+    namespace uno { class XComponentContext;  }
 } } }
 
 class ManifestWriter: public ::cppu::WeakImplHelper2
@@ -34,10 +35,10 @@ class ManifestWriter: public ::cppu::WeakImplHelper2
     ::com::sun::star::lang::XServiceInfo
 >
 {
-protected:
-    ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory;
+private:
+    ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
 public:
-    ManifestWriter( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & xNewFactory );
+    ManifestWriter( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > & xContext );
     virtual ~ManifestWriter();
 
     // XManifestWriter
diff --git a/package/source/xstor/owriteablestream.cxx b/package/source/xstor/owriteablestream.cxx
index 73a7198..fc9a5f3 100644
--- a/package/source/xstor/owriteablestream.cxx
+++ b/package/source/xstor/owriteablestream.cxx
@@ -229,12 +229,12 @@ sal_Bool KillFile( const ::rtl::OUString& aURL, const uno::Reference< uno::XComp
 const sal_Int32 n_ConstBufferSize = 32000;
 
 //-----------------------------------------------
-::rtl::OUString GetNewTempFileURL( const uno::Reference< lang::XMultiServiceFactory > xFactory )
+::rtl::OUString GetNewTempFileURL( const uno::Reference< uno::XComponentContext > xContext )
 {
     ::rtl::OUString aTempURL;
 
     uno::Reference < beans::XPropertySet > xTempFile(
-            io::TempFile::create(comphelper::getComponentContext(xFactory)),
+            io::TempFile::create(xContext),
             uno::UNO_QUERY_THROW );
 
     try {
@@ -255,12 +255,11 @@ const sal_Int32 n_ConstBufferSize = 32000;
 }
 
 //-----------------------------------------------
-uno::Reference< io::XStream > CreateMemoryStream( const uno::Reference< lang::XMultiServiceFactory >& xFactory )
+uno::Reference< io::XStream > CreateMemoryStream( const uno::Reference< uno::XComponentContext >& xContext )
 {
-    if ( !xFactory.is() )
-        throw uno::RuntimeException();
-
-    return uno::Reference< io::XStream >( xFactory->createInstance ("com.sun.star.comp.MemoryStream"), uno::UNO_QUERY_THROW);
+    return uno::Reference< io::XStream >(
+        xContext->getServiceManager()->createInstanceWithContext("com.sun.star.comp.MemoryStream", xContext),
+        uno::UNO_QUERY_THROW);
 }
 
 } // anonymous namespace
@@ -270,7 +269,7 @@ uno::Reference< io::XStream > CreateMemoryStream( const uno::Reference< lang::XM
 OWriteStream_Impl::OWriteStream_Impl( OStorage_Impl* pParent,
                                       const uno::Reference< packages::XDataSinkEncrSupport >& xPackageStream,
                                       const uno::Reference< lang::XSingleServiceFactory >& xPackage,
-                                      const uno::Reference< lang::XMultiServiceFactory >& xFactory,
+                                      const uno::Reference< uno::XComponentContext >& xContext,
                                       sal_Bool bForceEncrypted,
                                       sal_Int32 nStorageType,
                                       sal_Bool bDefaultCompress,
@@ -279,7 +278,7 @@ OWriteStream_Impl::OWriteStream_Impl( OStorage_Impl* pParent,
 , m_bHasDataToFlush( sal_False )
 , m_bFlushed( sal_False )
 , m_xPackageStream( xPackageStream )
-, m_xFactory( xFactory )
+, m_xContext( xContext )
 , m_pParent( pParent )
 , m_bForceEncrypted( bForceEncrypted )
 , m_bUseCommonEncryption( !bForceEncrypted && nStorageType == embed::StorageFormats::PACKAGE )
@@ -295,7 +294,7 @@ OWriteStream_Impl::OWriteStream_Impl( OStorage_Impl* pParent,
 {
     OSL_ENSURE( xPackageStream.is(), "No package stream is provided!\n" );
     OSL_ENSURE( xPackage.is(), "No package component is provided!\n" );
-    OSL_ENSURE( m_xFactory.is(), "No package stream is provided!\n" );
+    OSL_ENSURE( m_xContext.is(), "No package stream is provided!\n" );
     OSL_ENSURE( pParent, "No parent storage is provided!\n" );
     OSL_ENSURE( m_nStorageType == embed::StorageFormats::OFOPXML || !m_xOrigRelInfoStream.is(), "The Relations info makes sence only for OFOPXML format!\n" );
 }
@@ -533,20 +532,11 @@ void OWriteStream_Impl::DisposeWrappers()
 }
 
 //-----------------------------------------------
-uno::Reference< lang::XMultiServiceFactory > OWriteStream_Impl::GetServiceFactory()
-{
-    if ( m_xFactory.is() )
-        return m_xFactory;
-
-    return ::comphelper::getProcessServiceFactory();
-}
-
-//-----------------------------------------------
 ::rtl::OUString OWriteStream_Impl::GetFilledTempFileIfNo( const uno::Reference< io::XInputStream >& xStream )
 {
     if ( !m_aTempURL.getLength() )
     {
-        ::rtl::OUString aTempURL = GetNewTempFileURL( GetServiceFactory() );
+        ::rtl::OUString aTempURL = GetNewTempFileURL( m_xContext );
 
         try {
             if ( !aTempURL.isEmpty() && xStream.is() )
@@ -601,7 +591,7 @@ uno::Reference< lang::XMultiServiceFactory > OWriteStream_Impl::GetServiceFactor
         if ( !xOrigStream.is() )
         {
             // in case of new inserted package stream it is possible that input stream still was not set
-            uno::Reference< io::XStream > xCacheStream = CreateMemoryStream( GetServiceFactory() );
+            uno::Reference< io::XStream > xCacheStream = CreateMemoryStream( m_xContext );
             OSL_ENSURE( xCacheStream.is(), "If the stream can not be created an exception must be thrown!\n" );
             m_xCacheSeek.set( xCacheStream, uno::UNO_QUERY_THROW );
             m_xCacheStream = xCacheStream;
@@ -616,7 +606,7 @@ uno::Reference< lang::XMultiServiceFactory > OWriteStream_Impl::GetServiceFactor
 
             if ( nRead <= MAX_STORCACHE_SIZE )
             {
-                uno::Reference< io::XStream > xCacheStream = CreateMemoryStream( GetServiceFactory() );
+                uno::Reference< io::XStream > xCacheStream = CreateMemoryStream( m_xContext );
                 OSL_ENSURE( xCacheStream.is(), "If the stream can not be created an exception must be thrown!\n" );
 
                 if ( nRead )
@@ -630,7 +620,7 @@ uno::Reference< lang::XMultiServiceFactory > OWriteStream_Impl::GetServiceFactor
             }
             else if ( m_aTempURL.isEmpty() )
             {
-                m_aTempURL = GetNewTempFileURL( GetServiceFactory() );
+                m_aTempURL = GetNewTempFileURL( m_xContext );
 
                 try {
                     if ( !m_aTempURL.isEmpty() )
@@ -875,7 +865,7 @@ void OWriteStream_Impl::Commit()
         uno::Reference< io::XInputStream > xInStream;
         try
         {
-            xInStream.set( static_cast< io::XInputStream* >( new OSelfTerminateFileStream( GetServiceFactory(), m_aTempURL ) ), uno::UNO_QUERY );
+            xInStream.set( static_cast< io::XInputStream* >( new OSelfTerminateFileStream( m_xContext, m_aTempURL ) ), uno::UNO_QUERY );
         }
         catch( const uno::Exception& )
         {
@@ -1077,7 +1067,7 @@ void OWriteStream_Impl::ReadRelInfoIfNecessary()
                 m_aOrigRelInfo = ::comphelper::OFOPXMLHelper::ReadRelationsInfoSequence(
                                         m_xOrigRelInfoStream,
                                         "_rels/*.rels",
-                                        comphelper::getComponentContext(m_xFactory) );
+                                        m_xContext );
 
             // in case of success the stream must be thrown away, that means that the OrigRelInfo is initialized
             // the reason for this is that the original stream might not be seekable ( at the same time the new
@@ -1103,7 +1093,7 @@ void OWriteStream_Impl::ReadRelInfoIfNecessary()
                 m_aNewRelInfo = ::comphelper::OFOPXMLHelper::ReadRelationsInfoSequence(
                                         m_xNewRelInfoStream,
                                         "_rels/*.rels",
-                                        comphelper::getComponentContext(m_xFactory) );
+                                        m_xContext );
 
             m_nRelInfoStatus = RELINFO_CHANGED_STREAM_READ;
         }
@@ -1411,7 +1401,7 @@ uno::Reference< io::XStream > OWriteStream_Impl::GetStream_Impl( sal_Int32 nStre
             if ( m_pParent )
                 m_pParent->m_bIsModified = sal_True;
 
-            xStream = CreateMemoryStream( GetServiceFactory() );
+            xStream = CreateMemoryStream( m_xContext );
             m_xCacheSeek.set( xStream, uno::UNO_QUERY_THROW );
             m_xCacheStream = xStream;
         }
@@ -1505,7 +1495,7 @@ void OWriteStream_Impl::CreateReadonlyCopyBasedOnData( const uno::Reference< io:
     uno::Reference < io::XStream > xTempFile;
     if ( !xTargetStream.is() )
         xTempFile = uno::Reference < io::XStream >(
-            io::TempFile::create(comphelper::getComponentContext(m_xFactory)),
+            io::TempFile::create(m_xContext),
             uno::UNO_QUERY );
     else
         xTempFile = xTargetStream;
@@ -1687,7 +1677,7 @@ void OWriteStream_Impl::CommitStreamRelInfo( const uno::Reference< embed::XStora
                     if ( !xOutStream.is() )
                         throw uno::RuntimeException();
 
-                    ::comphelper::OFOPXMLHelper::WriteRelationsInfoSequence( xOutStream, m_aNewRelInfo, comphelper::getComponentContext(m_xFactory) );
+                    ::comphelper::OFOPXMLHelper::WriteRelationsInfoSequence( xOutStream, m_aNewRelInfo, m_xContext );
 
                     // set the mediatype
                     uno::Reference< beans::XPropertySet > xPropSet( xRelsStream, uno::UNO_QUERY_THROW );
diff --git a/package/source/xstor/owriteablestream.hxx b/package/source/xstor/owriteablestream.hxx
index a1bc7d1..896739a 100644
--- a/package/source/xstor/owriteablestream.hxx
+++ b/package/source/xstor/owriteablestream.hxx
@@ -113,7 +113,7 @@ struct OWriteStream_Impl : public PreCreationStruct
     ::com::sun::star::uno::Reference< ::com::sun::star::packages::XDataSinkEncrSupport > m_xPackageStream;
     ::com::sun::star::uno::Reference< ::com::sun::star::logging::XSimpleLogRing >  m_xLogRing;
 
-    ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory;
+    ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
 
     OStorage_Impl* m_pParent;
 
@@ -145,8 +145,6 @@ struct OWriteStream_Impl : public PreCreationStruct
 
 
 private:
-    ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > GetServiceFactory();
-
     ::rtl::OUString GetFilledTempFileIfNo( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xStream );
     ::rtl::OUString FillTempGetFileName();
     ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >       GetTempFileAsStream();
@@ -167,7 +165,7 @@ public:
                 OStorage_Impl* pParent,
                 const ::com::sun::star::uno::Reference< ::com::sun::star::packages::XDataSinkEncrSupport >& xPackageStream,
                 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory >& xPackage,
-                const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory,
+                const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext,
                 sal_Bool bForceEncrypted,
                 sal_Int32 nStorageType,
                 sal_Bool bDefaultCompress,
diff --git a/package/source/xstor/selfterminatefilestream.cxx b/package/source/xstor/selfterminatefilestream.cxx
index f47e95b..7f3cb23 100644
--- a/package/source/xstor/selfterminatefilestream.cxx
+++ b/package/source/xstor/selfterminatefilestream.cxx
@@ -26,18 +26,17 @@
 using namespace ::com::sun::star;
 
 //-----------------------------------------------
-OSelfTerminateFileStream::OSelfTerminateFileStream( const uno::Reference< lang::XMultiServiceFactory > xFactory, const ::rtl::OUString& aURL )
+OSelfTerminateFileStream::OSelfTerminateFileStream( const uno::Reference< uno::XComponentContext > xContext, const ::rtl::OUString& aURL )
 : m_aURL( aURL )
 {
-    uno::Reference< lang::XMultiServiceFactory > xOwnFactory = xFactory;
-    if ( !xOwnFactory.is() )
-        xOwnFactory.set( ::comphelper::getProcessServiceFactory(), uno::UNO_SET_THROW );
+    uno::Reference< uno::XComponentContext > xOwnContext = xContext;
+    if ( !xOwnContext.is() )
+        xOwnContext.set( ::comphelper::getProcessComponentContext(), uno::UNO_SET_THROW );
 
     // IMPORTANT: The implementation is based on idea that m_xFileAccess, m_xInputStream and m_xSeekable are always set
     // otherwise an exception is thrown in constructor
 
-    m_xFileAccess.set( ucb::SimpleFileAccess::create(
-                comphelper::getComponentContext(xOwnFactory) ) );
+    m_xFileAccess.set( ucb::SimpleFileAccess::create(xOwnContext) );
 
     m_xInputStream.set( m_xFileAccess->openFileRead( aURL ), uno::UNO_SET_THROW );
     m_xSeekable.set( m_xInputStream, uno::UNO_QUERY_THROW );
diff --git a/package/source/xstor/selfterminatefilestream.hxx b/package/source/xstor/selfterminatefilestream.hxx
index 85da358..ab4248b 100644
--- a/package/source/xstor/selfterminatefilestream.hxx
+++ b/package/source/xstor/selfterminatefilestream.hxx
@@ -39,7 +39,7 @@ protected:
     ::com::sun::star::uno::Reference< ::com::sun::star::io::XSeekable > m_xSeekable;
 
 public:
-    OSelfTerminateFileStream( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory, const ::rtl::OUString& aURL );
+    OSelfTerminateFileStream( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > xContext, const ::rtl::OUString& aURL );
 
     virtual ~OSelfTerminateFileStream();
 
diff --git a/package/source/xstor/switchpersistencestream.cxx b/package/source/xstor/switchpersistencestream.cxx
index 16581fa..b4700dd 100644
--- a/package/source/xstor/switchpersistencestream.cxx
+++ b/package/source/xstor/switchpersistencestream.cxx
@@ -29,8 +29,6 @@ using namespace ::com::sun::star;
 // ========================================================================
 struct SPStreamData_Impl
 {
-    uno::Reference< lang::XMultiServiceFactory > m_xFactory;
-
     sal_Bool m_bInStreamBased;
 
     // the streams below are not visible from outside so there is no need to remember position
@@ -47,7 +45,6 @@ struct SPStreamData_Impl
 
 
     SPStreamData_Impl(
-            const uno::Reference< lang::XMultiServiceFactory >& xFactory,
             sal_Bool bInStreamBased,
             const uno::Reference< io::XStream >& xOrigStream,
             const uno::Reference< io::XTruncate >& xOrigTruncate,
@@ -56,8 +53,7 @@ struct SPStreamData_Impl
             const uno::Reference< io::XOutputStream >& xOrigOutStream,
             sal_Bool bInOpen,
             sal_Bool bOutOpen )
-    : m_xFactory( xFactory )
-    , m_bInStreamBased( bInStreamBased )
+    : m_bInStreamBased( bInStreamBased )
     , m_xOrigStream( xOrigStream )
     , m_xOrigTruncate( xOrigTruncate )
     , m_xOrigSeekable( xOrigSeekable )
@@ -72,9 +68,9 @@ struct SPStreamData_Impl
 // ========================================================================
 // ------------------------------------------------------------------------
 SwitchablePersistenceStream::SwitchablePersistenceStream(
-        const uno::Reference< lang::XMultiServiceFactory >& xFactory,
+        const uno::Reference< uno::XComponentContext >& xContext,
         const uno::Reference< io::XStream >& xStream )
-: m_xFactory( xFactory )
+: m_xContext( xContext )
 , m_pStreamData( NULL )
 {
     SwitchPersistenceTo( xStream );
@@ -82,9 +78,9 @@ SwitchablePersistenceStream::SwitchablePersistenceStream(
 
 // ------------------------------------------------------------------------
 SwitchablePersistenceStream::SwitchablePersistenceStream(
-        const uno::Reference< lang::XMultiServiceFactory >& xFactory,
+        const uno::Reference< uno::XComponentContext >& xContext,
         const uno::Reference< io::XInputStream >& xInputStream )
-: m_xFactory( xFactory )
+: m_xContext( xContext )
 , m_pStreamData( NULL )
 {
     SwitchPersistenceTo( xInputStream );
@@ -126,7 +122,7 @@ void SwitchablePersistenceStream::SwitchPersistenceTo( const uno::Reference< io:
 
     CloseAll_Impl();
 
-    m_pStreamData = new SPStreamData_Impl( m_xFactory, sal_False,
+    m_pStreamData = new SPStreamData_Impl( sal_False,
                                             xStream, xNewTruncate, xNewSeekable, xNewInStream, xNewOutStream,
                                             bInOpen, bOutOpen );
 }
@@ -161,7 +157,7 @@ void SwitchablePersistenceStream::SwitchPersistenceTo( const uno::Reference< io:
 
     CloseAll_Impl();
 
-    m_pStreamData = new SPStreamData_Impl( m_xFactory, sal_True,
+    m_pStreamData = new SPStreamData_Impl( sal_True,
                                             xNewStream, xNewTruncate, xNewSeekable, xInputStream, xNewOutStream,
                                             bInOpen, bOutOpen );
 
@@ -176,7 +172,7 @@ void SwitchablePersistenceStream::CopyAndSwitchPersistenceTo( const uno::Referen
     if ( !xTargetStream.is() )
     {
         xTargetStream = uno::Reference < io::XStream >(
-            io::TempFile::create(comphelper::getComponentContext(m_xFactory)),
+            io::TempFile::create(m_xContext),
             uno::UNO_QUERY_THROW );
 
         xTargetSeek = uno::Reference< io::XSeekable >( xTargetStream, uno::UNO_QUERY_THROW );
@@ -209,7 +205,7 @@ void SwitchablePersistenceStream::CopyAndSwitchPersistenceTo( const uno::Referen
 
     CloseAll_Impl();
 
-    m_pStreamData = new SPStreamData_Impl( m_xFactory, sal_False,
+    m_pStreamData = new SPStreamData_Impl( sal_False,
                                         xTargetStream, xTargetTruncate, xTargetSeek, xTargetInStream, xTargetOutStream,
                                         bInOpen, bOutOpen );
 }
diff --git a/package/source/xstor/switchpersistencestream.hxx b/package/source/xstor/switchpersistencestream.hxx
index 92d5a1b..82d591e 100644
--- a/package/source/xstor/switchpersistencestream.hxx
+++ b/package/source/xstor/switchpersistencestream.hxx
@@ -54,7 +54,7 @@ class SwitchablePersistenceStream
 {
     ::osl::Mutex    m_aMutex;
 
-    const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory;
+    const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
 
     SPStreamData_Impl* m_pStreamData;
 
@@ -63,11 +63,11 @@ class SwitchablePersistenceStream
 public:
 
     SwitchablePersistenceStream(
-        const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory,
+        const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext,
         const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xStream );
 
     SwitchablePersistenceStream(
-        const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory,
+        const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext,
         const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInStream );
 
     ~SwitchablePersistenceStream();
diff --git a/package/source/xstor/xfactory.cxx b/package/source/xstor/xfactory.cxx
index c34155d..29a1790 100644
--- a/package/source/xstor/xfactory.cxx
+++ b/package/source/xstor/xfactory.cxx
@@ -74,7 +74,7 @@ OUString SAL_CALL OStorageFactory::impl_staticGetImplementationName()
 uno::Reference< uno::XInterface > SAL_CALL OStorageFactory::impl_staticCreateSelfInstance(
             const uno::Reference< lang::XMultiServiceFactory >& xServiceManager )
 {
-    return uno::Reference< uno::XInterface >( *new OStorageFactory( xServiceManager ) );
+    return uno::Reference< uno::XInterface >( *new OStorageFactory( comphelper::getComponentContext(xServiceManager) ) );
 }
 
 //-------------------------------------------------------------------------
@@ -84,14 +84,14 @@ uno::Reference< uno::XInterface > SAL_CALL OStorageFactory::createInstance()
 {
     // TODO: reimplement TempStream service to support XStream interface
     uno::Reference < io::XStream > xTempStream(
-                        io::TempFile::create(comphelper::getComponentContext(m_xFactory)),
+                        io::TempFile::create(m_xContext),
                         uno::UNO_QUERY_THROW );
 
     return uno::Reference< uno::XInterface >(
                 static_cast< OWeakObject* >( new OStorage(  xTempStream,
                                                             embed::ElementModes::READWRITE,
                                                             uno::Sequence< beans::PropertyValue >(),
-                                                            m_xFactory,
+                                                            m_xContext,
                                                             embed::StorageFormats::PACKAGE ) ),
                 uno::UNO_QUERY );
 }
@@ -154,7 +154,7 @@ uno::Reference< uno::XInterface > SAL_CALL OStorageFactory::createInstanceWithAr
 
         uno::Reference < ucb::XSimpleFileAccess3 > xTempAccess(
             ucb::SimpleFileAccess::create(
-                comphelper::getComponentContext(m_xFactory) ) );
+                m_xContext ) );
 
         if ( nStorageMode & embed::ElementModes::WRITE )
             xStream = xTempAccess->openFileReadWrite( aURL );
@@ -253,7 +253,7 @@ uno::Reference< uno::XInterface > SAL_CALL OStorageFactory::createInstanceWithAr
             throw io::IOException(); // TODO: this is not a package file
 
         return uno::Reference< uno::XInterface >(
-                    static_cast< OWeakObject* >( new OStorage( xInputStream, nStorageMode, aPropsToSet, m_xFactory, nStorageType ) ),
+                    static_cast< OWeakObject* >( new OStorage( xInputStream, nStorageMode, aPropsToSet, m_xContext, nStorageType ) ),
                     uno::UNO_QUERY );
     }
     else if ( xStream.is() )
@@ -273,7 +273,7 @@ uno::Reference< uno::XInterface > SAL_CALL OStorageFactory::createInstanceWithAr
             throw io::IOException(); // TODO: this is not a package file
 
         return uno::Reference< uno::XInterface >(
-                    static_cast< OWeakObject* >( new OStorage( xStream, nStorageMode, aPropsToSet, m_xFactory, nStorageType ) ),
+                    static_cast< OWeakObject* >( new OStorage( xStream, nStorageMode, aPropsToSet, m_xContext, nStorageType ) ),
                     uno::UNO_QUERY );
     }
 
diff --git a/package/source/xstor/xfactory.hxx b/package/source/xstor/xfactory.hxx
index 7d845b2..457c37b 100644
--- a/package/source/xstor/xfactory.hxx
+++ b/package/source/xstor/xfactory.hxx
@@ -30,13 +30,13 @@
 class OStorageFactory : public ::cppu::WeakImplHelper2< ::com::sun::star::lang::XSingleServiceFactory,
                                                 ::com::sun::star::lang::XServiceInfo >
 {
-    ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory;
+    ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
 
 public:
-    OStorageFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory )
-    : m_xFactory( xFactory )
+    OStorageFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext )
+    : m_xContext( xContext )
     {
-        OSL_ENSURE( xFactory.is(), "No service manager is provided!\n" );
+        OSL_ENSURE( xContext.is(), "No service manager is provided!\n" );
     }
 
     static ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx
index 8c98b87..aa65875 100644
--- a/package/source/xstor/xstorage.cxx
+++ b/package/source/xstor/xstorage.cxx
@@ -92,7 +92,7 @@ struct StorInternalData_Impl
 };
 
 //=========================================================
-::rtl::OUString GetNewTempFileURL( const uno::Reference< lang::XMultiServiceFactory > xFactory );
+::rtl::OUString GetNewTempFileURL( const uno::Reference< uno::XComponentContext > xContext );
 
 // static
 void OStorage_Impl::completeStorageStreamCopy_Impl(
@@ -142,12 +142,11 @@ void OStorage_Impl::completeStorageStreamCopy_Impl(
 }
 
 uno::Reference< io::XInputStream > GetSeekableTempCopy( uno::Reference< io::XInputStream > xInStream,
-                                                        uno::Reference< lang::XMultiServiceFactory > xFactory )
+                                                        uno::Reference< uno::XComponentContext > xContext )
 {
-    uno::Reference < io::XOutputStream > xTempOut(
-                        io::TempFile::create(comphelper::getComponentContext(xFactory)),
-                        uno::UNO_QUERY );
-    uno::Reference < io::XInputStream > xTempIn( xTempOut, uno::UNO_QUERY );
+    uno::Reference < io::XTempFile > xTempFile = io::TempFile::create(xContext);
+    uno::Reference < io::XOutputStream > xTempOut = xTempFile->getOutputStream();
+    uno::Reference < io::XInputStream > xTempIn = xTempFile->getInputStream();
 
     if ( !xTempOut.is() || !xTempIn.is() )
         throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() );
@@ -190,7 +189,7 @@ SotElement_Impl::~SotElement_Impl()
 OStorage_Impl::OStorage_Impl(   uno::Reference< io::XInputStream > xInputStream,
                                 sal_Int32 nMode,
                                 uno::Sequence< beans::PropertyValue > xProperties,
-                                uno::Reference< lang::XMultiServiceFactory > xFactory,
+                                uno::Reference< uno::XComponentContext > xContext,
                                 sal_Int32 nStorageType )
 : m_rMutexRef( new SotMutexHolder )
 , m_pAntiImpl( NULL )
@@ -200,7 +199,7 @@ OStorage_Impl::OStorage_Impl(   uno::Reference< io::XInputStream > xInputStream,
 , m_bCommited( sal_False )
 , m_bIsRoot( sal_True )
 , m_bListCreated( sal_False )
-, m_xFactory( xFactory )
+, m_xContext( xContext )
 , m_xProperties( xProperties )
 , m_bHasCommonEncryptionData( sal_False )
 , m_pParent( NULL )
@@ -215,7 +214,7 @@ OStorage_Impl::OStorage_Impl(   uno::Reference< io::XInputStream > xInputStream,
     // all the checks done below by assertion statements must be done by factory
     OSL_ENSURE( xInputStream.is(), "No input stream is provided!\n" );
 
-    m_pSwitchStream = (SwitchablePersistenceStream*) new SwitchablePersistenceStream( xFactory, xInputStream );
+    m_pSwitchStream = (SwitchablePersistenceStream*) new SwitchablePersistenceStream( xContext, xInputStream );
     m_xInputStream = m_pSwitchStream->getInputStream();
 
     if ( m_nStorageMode & embed::ElementModes::WRITE )
@@ -230,7 +229,7 @@ OStorage_Impl::OStorage_Impl(   uno::Reference< io::XInputStream > xInputStream,
 OStorage_Impl::OStorage_Impl(   uno::Reference< io::XStream > xStream,
                                 sal_Int32 nMode,
                                 uno::Sequence< beans::PropertyValue > xProperties,
-                                uno::Reference< lang::XMultiServiceFactory > xFactory,
+                                uno::Reference< uno::XComponentContext > xContext,
                                 sal_Int32 nStorageType )
 : m_rMutexRef( new SotMutexHolder )
 , m_pAntiImpl( NULL )
@@ -240,7 +239,7 @@ OStorage_Impl::OStorage_Impl(   uno::Reference< io::XStream > xStream,
 , m_bCommited( sal_False )
 , m_bIsRoot( sal_True )
 , m_bListCreated( sal_False )
-, m_xFactory( xFactory )
+, m_xContext( xContext )
 , m_xProperties( xProperties )
 , m_bHasCommonEncryptionData( sal_False )
 , m_pParent( NULL )
@@ -257,12 +256,12 @@ OStorage_Impl::OStorage_Impl(   uno::Reference< io::XStream > xStream,
 
     if ( m_nStorageMode & embed::ElementModes::WRITE )
     {
-        m_pSwitchStream = (SwitchablePersistenceStream*) new SwitchablePersistenceStream( xFactory, xStream );
+        m_pSwitchStream = (SwitchablePersistenceStream*) new SwitchablePersistenceStream( xContext, xStream );
         m_xStream = static_cast< io::XStream* >( m_pSwitchStream );
     }
     else
     {
-        m_pSwitchStream = (SwitchablePersistenceStream*) new SwitchablePersistenceStream( xFactory,
+        m_pSwitchStream = (SwitchablePersistenceStream*) new SwitchablePersistenceStream( xContext,
                                                                                           xStream->getInputStream() );
         m_xInputStream = m_pSwitchStream->getInputStream();
     }
@@ -273,7 +272,7 @@ OStorage_Impl::OStorage_Impl(   OStorage_Impl* pParent,
                                 sal_Int32 nMode,
                                 uno::Reference< container::XNameContainer > xPackageFolder,
                                 uno::Reference< lang::XSingleServiceFactory > xPackage,
-                                uno::Reference< lang::XMultiServiceFactory > xFactory,
+                                uno::Reference< uno::XComponentContext > xContext,
                                 sal_Int32 nStorageType )
 : m_rMutexRef( new SotMutexHolder )
 , m_pAntiImpl( NULL )
@@ -285,7 +284,7 @@ OStorage_Impl::OStorage_Impl(   OStorage_Impl* pParent,
 , m_bListCreated( sal_False )
 , m_xPackageFolder( xPackageFolder )
 , m_xPackage( xPackage )
-, m_xFactory( xFactory )
+, m_xContext( xContext )
 , m_bHasCommonEncryptionData( sal_False )
 , m_pParent( pParent ) // can be empty in case of temporary readonly substorages and relation storage
 , m_bControlMediaType( sal_False )
@@ -515,9 +514,8 @@ void OStorage_Impl::OpenOwnPackage()
             }
 
             m_xPackage = uno::Reference< lang::XSingleServiceFactory > (
-                                        GetServiceFactory()->createInstanceWithArguments(
-                                            "com.sun.star.packages.comp.ZipPackage",
-                                            aArguments ),
+                                        GetComponentContext()->getServiceManager()->createInstanceWithArgumentsAndContext(
+                                            "com.sun.star.packages.comp.ZipPackage", aArguments, GetComponentContext()),
                                         uno::UNO_QUERY );
         }
 
@@ -537,12 +535,12 @@ void OStorage_Impl::OpenOwnPackage()
 }
 
 //-----------------------------------------------
-uno::Reference< lang::XMultiServiceFactory > OStorage_Impl::GetServiceFactory()
+uno::Reference< uno::XComponentContext > OStorage_Impl::GetComponentContext()
 {
-    if ( m_xFactory.is() )
-        return m_xFactory;
+    if ( m_xContext.is() )
+        return m_xContext;
 
-    return ::comphelper::getProcessServiceFactory();
+    return ::comphelper::getProcessComponentContext();
 }
 
 //-----------------------------------------------
@@ -594,7 +592,7 @@ void OStorage_Impl::ReadRelInfoIfNecessary()
             m_aRelInfo = ::comphelper::OFOPXMLHelper::ReadRelationsInfoSequence(
                                     xRelInfoStream,
                                     "_rels/.rels",
-                                    comphelper::getComponentContext(m_xFactory) );
+                                    m_xContext );
 
         m_nRelInfoStatus = RELINFO_READ;
     }
@@ -607,7 +605,7 @@ void OStorage_Impl::ReadRelInfoIfNecessary()
                 m_aRelInfo = ::comphelper::OFOPXMLHelper::ReadRelationsInfoSequence(
                                         m_xNewRelInfoStream,
                                         "_rels/.rels",
-                                        comphelper::getComponentContext(m_xFactory) );
+                                        m_xContext );
 
             m_nRelInfoStatus = RELINFO_CHANGED_STREAM_READ;
         }
@@ -1024,7 +1022,7 @@ void OStorage_Impl::CopyLastCommitTo( const uno::Reference< embed::XStorage >& x
                                 embed::ElementModes::READ,
                                 m_xPackageFolder,
                                 m_xPackage,
-                                m_xFactory,
+                                m_xContext,
                                 m_nStorageType);
 
     // TODO/LATER: could use direct copying
@@ -1432,7 +1430,7 @@ SotElement_Impl* OStorage_Impl::InsertStream( ::rtl::OUString aName, sal_Bool bE
 
     // the mode is not needed for storage stream internal implementation
     SotElement_Impl* pNewElement = InsertElement( aName, sal_False );
-    pNewElement->m_pStream = new OWriteStream_Impl( this, xPackageSubStream, m_xPackage, m_xFactory, bEncr, m_nStorageType, sal_True );
+    pNewElement->m_pStream = new OWriteStream_Impl( this, xPackageSubStream, m_xPackage, m_xContext, bEncr, m_nStorageType, sal_True );
 
     m_aChildrenList.push_back( pNewElement );
     m_bIsModified = sal_True;
@@ -1454,7 +1452,7 @@ SotElement_Impl* OStorage_Impl::InsertRawStream( ::rtl::OUString aName, const un
 
     uno::Reference< io::XSeekable > xSeek( xInStream, uno::UNO_QUERY );
     uno::Reference< io::XInputStream > xInStrToInsert = xSeek.is() ? xInStream :
-                                                                     GetSeekableTempCopy( xInStream, GetServiceFactory() );
+                                                                     GetSeekableTempCopy( xInStream, GetComponentContext() );
 
     uno::Sequence< uno::Any > aSeq( 1 );
     aSeq[0] <<= sal_False;
@@ -1473,7 +1471,7 @@ SotElement_Impl* OStorage_Impl::InsertRawStream( ::rtl::OUString aName, const un
 
     // the mode is not needed for storage stream internal implementation
     SotElement_Impl* pNewElement = InsertElement( aName, sal_False );
-    pNewElement->m_pStream = new OWriteStream_Impl( this, xPackageSubStream, m_xPackage, m_xFactory, sal_True, m_nStorageType, sal_False );
+    pNewElement->m_pStream = new OWriteStream_Impl( this, xPackageSubStream, m_xPackage, m_xContext, sal_True, m_nStorageType, sal_False );
     // the stream is inserted and must be treated as a commited one
     pNewElement->m_pStream->SetToBeCommited();
 
@@ -1505,7 +1503,7 @@ OStorage_Impl* OStorage_Impl::CreateNewStorageImpl( sal_Int32 nStorageMode )
         throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() );
 
     OStorage_Impl* pResult =
-            new OStorage_Impl( this, nStorageMode, xPackageSubFolder, m_xPackage, m_xFactory, m_nStorageType );
+            new OStorage_Impl( this, nStorageMode, xPackageSubFolder, m_xPackage, m_xContext, m_nStorageType );
     pResult->m_bIsModified = sal_True;
 
     return pResult;
@@ -1586,7 +1584,7 @@ void OStorage_Impl::OpenSubStorage( SotElement_Impl* pElement, sal_Int32 nStorag
         if ( !xPackageSubFolder.is() )
             throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() );
 
-        pElement->m_pStorage = new OStorage_Impl( this, nStorageMode, xPackageSubFolder, m_xPackage, m_xFactory, m_nStorageType );
+        pElement->m_pStorage = new OStorage_Impl( this, nStorageMode, xPackageSubFolder, m_xPackage, m_xContext, m_nStorageType );
     }
 }
 
@@ -1612,7 +1610,7 @@ void OStorage_Impl::OpenSubStream( SotElement_Impl* pElement )
             throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() );
 
         // the stream can never be inserted here, because inserted stream element holds the stream till commit or destruction
-        pElement->m_pStream = new OWriteStream_Impl( this, xPackageSubStream, m_xPackage, m_xFactory, sal_False, m_nStorageType, sal_False, GetRelInfoStreamForName( pElement->m_aOriginalName ) );
+        pElement->m_pStream = new OWriteStream_Impl( this, xPackageSubStream, m_xPackage, m_xContext, sal_False, m_nStorageType, sal_False, GetRelInfoStreamForName( pElement->m_aOriginalName ) );
     }
 }
 
@@ -1844,7 +1842,7 @@ void OStorage_Impl::CommitRelInfo( const uno::Reference< container::XNameContain
                     if ( !xOutStream.is() )
                         throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() );
 
-                    ::comphelper::OFOPXMLHelper::WriteRelationsInfoSequence( xOutStream, m_aRelInfo, comphelper::getComponentContext(m_xFactory) );
+                    ::comphelper::OFOPXMLHelper::WriteRelationsInfoSequence( xOutStream, m_aRelInfo, m_xContext );
 
                     // set the mediatype
                     uno::Reference< beans::XPropertySet > xPropSet( xRelsStream, uno::UNO_QUERY_THROW );
@@ -1924,9 +1922,9 @@ void OStorage_Impl::CommitRelInfo( const uno::Reference< container::XNameContain
 OStorage::OStorage( uno::Reference< io::XInputStream > xInputStream,
                     sal_Int32 nMode,
                     uno::Sequence< beans::PropertyValue > xProperties,
-                    uno::Reference< lang::XMultiServiceFactory > xFactory,
+                    uno::Reference< uno::XComponentContext > xContext,
                     sal_Int32 nStorageType )
-: m_pImpl( new OStorage_Impl( xInputStream, nMode, xProperties, xFactory, nStorageType ) )
+: m_pImpl( new OStorage_Impl( xInputStream, nMode, xProperties, xContext, nStorageType ) )
 {
     m_pImpl->m_pAntiImpl = this;
     m_pData = new StorInternalData_Impl( m_pImpl->m_rMutexRef, m_pImpl->m_bIsRoot, m_pImpl->m_nStorageType, sal_False );
@@ -1936,9 +1934,9 @@ OStorage::OStorage( uno::Reference< io::XInputStream > xInputStream,
 OStorage::OStorage( uno::Reference< io::XStream > xStream,
                     sal_Int32 nMode,
                     uno::Sequence< beans::PropertyValue > xProperties,
-                    uno::Reference< lang::XMultiServiceFactory > xFactory,
+                    uno::Reference< uno::XComponentContext > xContext,
                     sal_Int32 nStorageType )
-: m_pImpl( new OStorage_Impl( xStream, nMode, xProperties, xFactory, nStorageType ) )
+: m_pImpl( new OStorage_Impl( xStream, nMode, xProperties, xContext, nStorageType ) )
 {
     m_pImpl->m_pAntiImpl = this;
     m_pData = new StorInternalData_Impl( m_pImpl->m_rMutexRef, m_pImpl->m_bIsRoot, m_pImpl->m_nStorageType, sal_False );
@@ -3797,10 +3795,9 @@ uno::Reference< io::XInputStream > SAL_CALL OStorage::getPlainRawStreamElement(
         if ( !xRawInStream.is() )
             throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() );
 
-        uno::Reference < io::XOutputStream > xTempOut(
-                            io::TempFile::create(comphelper::getComponentContext(m_pImpl->GetServiceFactory())),
-                            uno::UNO_QUERY );
-        xTempIn = uno::Reference < io::XInputStream >( xTempOut, uno::UNO_QUERY );
+        uno::Reference < io::XTempFile > xTempFile = io::TempFile::create( m_pImpl->GetComponentContext() );
+        uno::Reference < io::XOutputStream > xTempOut = xTempFile->getOutputStream();
+        xTempIn = xTempFile->getInputStream();
         uno::Reference < io::XSeekable > xSeek( xTempOut, uno::UNO_QUERY );
 
         if ( !xTempOut.is() || !xTempIn.is() || !xSeek.is() )
@@ -3909,10 +3906,9 @@ uno::Reference< io::XInputStream > SAL_CALL OStorage::getRawEncrStreamElement(
         if ( !xRawInStream.is() )
             throw io::IOException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() );
 
-        uno::Reference < io::XOutputStream > xTempOut(
-                            io::TempFile::create(comphelper::getComponentContext(m_pImpl->GetServiceFactory())),
-                            uno::UNO_QUERY );
-        xTempIn = uno::Reference < io::XInputStream >( xTempOut, uno::UNO_QUERY );
+        uno::Reference < io::XTempFile > xTempFile = io::TempFile::create(m_pImpl->GetComponentContext());
+        uno::Reference < io::XOutputStream > xTempOut = xTempFile->getOutputStream();
+        xTempIn = xTempFile->getInputStream();
         uno::Reference < io::XSeekable > xSeek( xTempOut, uno::UNO_QUERY );
 
         if ( !xTempOut.is() || !xTempIn.is() || !xSeek.is() )
@@ -5936,8 +5932,7 @@ void SAL_CALL OStorage::attachToURL( const ::rtl::OUString& sURL,
         throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() );
 
     uno::Reference < ucb::XSimpleFileAccess3 > xAccess(
-        ucb::SimpleFileAccess::create(
-            comphelper::getComponentContext(m_pImpl->m_xFactory) ) );
+        ucb::SimpleFileAccess::create( m_pImpl->m_xContext ) );
 
     try
     {
diff --git a/package/source/xstor/xstorage.hxx b/package/source/xstor/xstorage.hxx
index e1839da..83c997c 100644
--- a/package/source/xstor/xstorage.hxx
+++ b/package/source/xstor/xstorage.hxx
@@ -39,7 +39,6 @@
 #include <com/sun/star/beans/StringPair.hpp>
 #include <com/sun/star/io/XStream.hpp>
 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <com/sun/star/lang/XTypeProvider.hpp>
 #include <com/sun/star/lang/XComponent.hpp>
 #include <com/sun/star/packages/NoEncryptionException.hpp>
@@ -140,7 +139,7 @@ struct OStorage_Impl
     ::com::sun::star::uno::Reference< ::com::sun::star::logging::XSimpleLogRing >  m_xLogRing;
 
     ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > m_xPackage;
-    ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >  m_xFactory;
+    ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >  m_xContext;
 
     // valid only for root storage
     ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > m_xInputStream; // ??? may be stored in properties
@@ -176,13 +175,13 @@ struct OStorage_Impl
     OStorage_Impl(  ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > xInputStream,
                     sal_Int32 nMode,
                     ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > xProperties,
-                    ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory,
+                    ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > xContext,
                     sal_Int32 nStorageType );
 
     OStorage_Impl(  ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > xStream,
                     sal_Int32 nMode,
                     ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > xProperties,
-                    ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory,
+                    ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > xContext,
                     sal_Int32 nStorageType );
 
     // constructor for a substorage
@@ -190,7 +189,7 @@ struct OStorage_Impl
                     sal_Int32 nMode,
                     ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > xPackageFolder,
                     ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > xPackage,
-                    ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory,
+                    ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > xContext,
                     sal_Int32 nStorageType );
 
     ~OStorage_Impl();
@@ -204,7 +203,7 @@ struct OStorage_Impl
     void ReadContents();
     void ReadRelInfoIfNecessary();
 
-    ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > GetServiceFactory();
+    ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > GetComponentContext();
     SotElementList_Impl& GetChildrenList();
     void GetStorageProperties();
 
@@ -311,13 +310,13 @@ public:
     OStorage(   ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > xInputStream,
                 sal_Int32 nMode,
                 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > xProperties,
-                ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory,
+                ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > xContext,
                 sal_Int32 nStorageType );
 
     OStorage(   ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > xStream,
                 sal_Int32 nMode,
                 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > xProperties,
-                ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory,
+                ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > xContext,
                 sal_Int32 nStorageType );
 
     OStorage(   OStorage_Impl* pImpl, sal_Bool bReadOnlyWrap );
diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx
index 89b3f2f..da90248 100644
--- a/package/source/zippackage/ZipPackage.cxx
+++ b/package/source/zippackage/ZipPackage.cxx
@@ -140,7 +140,7 @@ class DummyInputStream : public ::cppu::WeakImplHelper1< XInputStream >
 
 //===========================================================================
 
-ZipPackage::ZipPackage ( const uno::Reference < XMultiServiceFactory > &xNewFactory )
+ZipPackage::ZipPackage ( const uno::Reference < XComponentContext > &xContext )
 : m_aMutexHolder( new SotMutexHolder )
 , m_nStartKeyGenerationID( xml::crypto::DigestID::SHA1 )
 , m_nChecksumDigestID( xml::crypto::DigestID::SHA1_1K )
@@ -153,11 +153,11 @@ ZipPackage::ZipPackage ( const uno::Reference < XMultiServiceFactory > &xNewFact
 , m_nFormat( embed::StorageFormats::PACKAGE ) // package is the default format
 , m_bAllowRemoveOnInsert( sal_True )
 , m_eMode ( e_IMode_None )
-, m_xFactory( xNewFactory )
+, m_xContext( xContext )
 , m_pRootFolder( NULL )
 , m_pZipFile( NULL )
 {
-    m_xRootFolder = m_pRootFolder = new ZipPackageFolder( m_xFactory, m_nFormat, m_bAllowRemoveOnInsert );
+    m_xRootFolder = m_pRootFolder = new ZipPackageFolder( m_nFormat, m_bAllowRemoveOnInsert );
 }
 
 ZipPackage::~ZipPackage( void )
@@ -176,7 +176,7 @@ sal_Bool ZipPackage::isLocalFile() const
     OUString aSystemPath;
     uno::Reference< XUniversalContentBroker > xUcb(
         UniversalContentBroker::create(
-            comphelper::getComponentContext( m_xFactory ) ) );
+            m_xContext ) );
     try
     {
         aSystemPath = getSystemPathFromFileURL( xUcb, m_aURL );
@@ -211,7 +211,7 @@ void ZipPackage::parseManifest()
                     uno::Reference < XActiveDataSink > xSink ( xTunnel, UNO_QUERY );
                     if ( xSink.is() )
                     {
-                        uno::Reference < XManifestReader > xReader = ManifestReader::create( comphelper::getComponentContext( m_xFactory ) );
+                        uno::Reference < XManifestReader > xReader = ManifestReader::create( m_xContext );
 
                         const OUString sPropFullPath ("FullPath");

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list