[Libreoffice-commits] core.git: 12 commits - basctl/source basic/source connectivity/source cui/source dbaccess/source desktop/source extensions/source filter/source forms/source framework/inc framework/source include/connectivity include/sfx2 include/svx offapi/com offapi/type_reference offapi/UnoApi_offapi.mk sd/source sfx2/source sfx2/util svx/source sw/qa vcl/source

Noel Grandin noel at peralex.com
Mon Jun 3 01:00:33 PDT 2013


 basctl/source/basicide/baside3.cxx                        |   10 
 basctl/source/basicide/basides3.cxx                       |    8 
 basctl/source/basicide/moduldlg.cxx                       |    8 
 basctl/source/dlged/dlged.cxx                             |    8 
 basctl/source/dlged/dlgedfac.cxx                          |    4 
 basic/source/classes/eventatt.cxx                         |    7 
 connectivity/source/commontools/dbmetadata.cxx            |    6 
 connectivity/source/commontools/filtermanager.cxx         |    5 
 connectivity/source/commontools/formattedcolumnvalue.cxx  |   12 
 connectivity/source/manager/mdrivermanager.cxx            |   31 +-
 connectivity/source/manager/mdrivermanager.hxx            |   18 -
 connectivity/source/simpledbt/dbtfactory.cxx              |    5 
 connectivity/source/simpledbt/dbtfactory.hxx              |    4 
 cui/source/options/optgdlg.cxx                            |   16 -
 dbaccess/source/core/misc/DatabaseDataProvider.cxx        |    2 
 desktop/source/app/app.cxx                                |   30 --
 desktop/source/app/appfirststart.cxx                      |    8 
 extensions/source/abpilot/abpfinalpage.cxx                |    3 
 extensions/source/logging/consolehandler.cxx              |    4 
 extensions/source/logging/csvformatter.cxx                |   14 -
 extensions/source/logging/filehandler.cxx                 |    8 
 extensions/source/logging/logger.cxx                      |   14 -
 extensions/source/logging/loggerconfig.cxx                |   15 -
 extensions/source/logging/loggerconfig.hxx                |    8 
 extensions/source/logging/plaintextformatter.cxx          |   14 -
 extensions/source/propctrlr/defaultforminspection.cxx     |    8 
 extensions/source/propctrlr/defaultforminspection.hxx     |    2 
 extensions/source/propctrlr/defaulthelpprovider.cxx       |    9 
 extensions/source/propctrlr/defaulthelpprovider.hxx       |    5 
 extensions/source/propctrlr/formcontroller.cxx            |    2 
 extensions/source/propctrlr/inspectormodelbase.cxx        |    3 
 extensions/source/propctrlr/inspectormodelbase.hxx        |    5 
 extensions/source/propctrlr/objectinspectormodel.cxx      |    8 
 extensions/source/propctrlr/pcr.component                 |    1 
 extensions/source/propctrlr/pcrunodialogs.cxx             |   31 ++
 extensions/source/propctrlr/pcrunodialogs.hxx             |    3 
 extensions/source/update/check/updatecheck.cxx            |   30 --
 extensions/source/update/check/updatecheck.hxx            |    8 
 filter/source/config/cache/contenthandlerfactory.cxx      |    4 
 filter/source/config/cache/contenthandlerfactory.hxx      |   25 +-
 filter/source/config/cache/frameloaderfactory.cxx         |    4 
 filter/source/config/cache/frameloaderfactory.hxx         |   23 +
 forms/source/component/Button.cxx                         |   13 -
 forms/source/component/Button.hxx                         |    2 
 forms/source/component/CheckBox.cxx                       |   11 
 forms/source/component/CheckBox.hxx                       |    2 
 forms/source/component/Columns.cxx                        |    6 
 forms/source/component/Columns.hxx                        |    8 
 forms/source/component/ComboBox.cxx                       |   17 -
 forms/source/component/ComboBox.hxx                       |    2 
 forms/source/component/Currency.cxx                       |   11 
 forms/source/component/Currency.hxx                       |    2 
 forms/source/component/DatabaseForm.cxx                   |   20 -
 forms/source/component/DatabaseForm.hxx                   |    2 
 forms/source/component/Date.cxx                           |   14 -
 forms/source/component/Date.hxx                           |    2 
 forms/source/component/Edit.cxx                           |   15 -
 forms/source/component/Edit.hxx                           |    2 
 forms/source/component/EditBase.cxx                       |    4 
 forms/source/component/File.cxx                           |    7 
 forms/source/component/FixedText.cxx                      |    7 
 forms/source/component/FormComponent.cxx                  |   24 -
 forms/source/component/FormattedField.cxx                 |   12 
 forms/source/component/FormattedField.hxx                 |    2 
 forms/source/component/FormattedFieldWrapper.cxx          |   29 +-
 forms/source/component/FormattedFieldWrapper.hxx          |    6 
 forms/source/component/FormsCollection.cxx                |    5 
 forms/source/component/FormsCollection.hxx                |    2 
 forms/source/component/Grid.cxx                           |    9 
 forms/source/component/GroupBox.cxx                       |   11 
 forms/source/component/GroupBox.hxx                       |    2 
 forms/source/component/Hidden.cxx                         |    7 
 forms/source/component/ImageButton.cxx                    |   11 
 forms/source/component/ImageButton.hxx                    |    2 
 forms/source/component/ImageControl.cxx                   |   17 -
 forms/source/component/ImageControl.hxx                   |    2 
 forms/source/component/ListBox.cxx                        |   15 -
 forms/source/component/ListBox.hxx                        |    2 
 forms/source/component/Numeric.cxx                        |   11 
 forms/source/component/Numeric.hxx                        |    2 
 forms/source/component/Pattern.cxx                        |   12 
 forms/source/component/Pattern.hxx                        |    2 
 forms/source/component/RadioButton.cxx                    |   11 
 forms/source/component/RadioButton.hxx                    |    2 
 forms/source/component/Time.cxx                           |   14 -
 forms/source/component/Time.hxx                           |    2 
 forms/source/component/cachedrowset.cxx                   |   13 -
 forms/source/component/cachedrowset.hxx                   |    2 
 forms/source/component/clickableimage.cxx                 |    7 
 forms/source/component/clickableimage.hxx                 |    2 
 forms/source/component/navigationbar.cxx                  |    7 
 forms/source/component/refvaluecomponent.cxx              |    4 
 forms/source/component/refvaluecomponent.hxx              |    2 
 forms/source/component/scrollbar.cxx                      |    4 
 forms/source/component/spinbutton.cxx                     |    4 
 forms/source/helper/commandimageprovider.cxx              |   13 -
 forms/source/helper/controlfeatureinterception.cxx        |    2 
 forms/source/helper/formnavigation.cxx                    |    4 
 forms/source/helper/urltransformer.cxx                    |    4 
 forms/source/inc/FormComponent.hxx                        |   34 +-
 forms/source/inc/InterfaceContainer.hxx                   |    6 
 forms/source/inc/commandimageprovider.hxx                 |    4 
 forms/source/inc/controlfeatureinterception.hxx           |    3 
 forms/source/inc/formnavigation.hxx                       |    9 
 forms/source/inc/forms_module.hxx                         |    3 
 forms/source/inc/urltransformer.hxx                       |    5 
 forms/source/misc/InterfaceContainer.cxx                  |   22 -
 forms/source/richtext/richtextmodel.cxx                   |    4 
 forms/source/runtime/formoperations.cxx                   |   11 
 forms/source/runtime/formoperations.hxx                   |    7 
 forms/source/solar/component/navbarcontrol.cxx            |    8 
 forms/source/solar/component/navbarcontrol.hxx            |    4 
 framework/inc/services.h                                  |    4 
 framework/source/dispatch/dispatchinformationprovider.cxx |    5 
 framework/source/loadenv/loadenv.cxx                      |   76 ++----
 framework/source/services/license.cxx                     |   12 
 include/connectivity/dbmetadata.hxx                       |    8 
 include/connectivity/filtermanager.hxx                    |    9 
 include/connectivity/formattedcolumnvalue.hxx             |    7 
 include/connectivity/virtualdbtools.hxx                   |    8 
 include/sfx2/appuno.hxx                                   |    8 
 include/svx/databaselocationinput.hxx                     |    4 
 include/svx/dbtoolsclient.hxx                             |    2 
 offapi/UnoApi_offapi.mk                                   |   12 
 offapi/com/sun/star/form/TabOrderDialog.idl               |   46 +++
 offapi/com/sun/star/frame/AppDispatchProvider.idl         |   37 +++
 offapi/com/sun/star/frame/ContentHandlerFactory.idl       |   50 ----
 offapi/com/sun/star/frame/FrameLoaderFactory.idl          |   49 ----
 offapi/com/sun/star/frame/OfficeFrameLoader.idl           |   37 +++
 offapi/com/sun/star/frame/XAppDispatchProvider.idl        |   42 +++
 offapi/com/sun/star/frame/XLoaderFactory.idl              |   86 +++++++
 offapi/com/sun/star/office/Quickstart.idl                 |   51 ++++
 offapi/type_reference/offapi.rdb                          |binary
 sd/source/ui/presenter/PresenterHelper.cxx                |    2 
 sfx2/source/appl/appuno.cxx                               |   49 +++-
 sfx2/source/sidebar/ContextChangeBroadcaster.cxx          |    8 
 sfx2/source/sidebar/ControllerFactory.cxx                 |   14 -
 sfx2/source/sidebar/ResourceManager.cxx                   |   11 
 sfx2/source/sidebar/SidebarController.cxx                 |    9 
 sfx2/source/sidebar/SidebarPanel.cxx                      |    2 
 sfx2/source/sidebar/Tools.cxx                             |   40 +--
 sfx2/source/view/frmload.cxx                              |    3 
 sfx2/util/sfx.component                                   |    2 
 svx/source/fmcomp/fmgridcl.cxx                            |    4 
 svx/source/fmcomp/gridcell.cxx                            |    8 
 svx/source/form/databaselocationinput.cxx                 |   18 -
 svx/source/form/dbtoolsclient.cxx                         |    2 
 svx/source/form/fmexpl.cxx                                |    2 
 svx/source/form/fmshimp.cxx                               |   30 --
 svx/source/form/fmview.cxx                                |    3 
 svx/source/form/fmvwimp.cxx                               |   34 +-
 svx/source/form/formcontrolfactory.cxx                    |   22 +
 svx/source/form/navigatortree.cxx                         |    7 
 svx/source/inc/fmexpl.hxx                                 |    3 
 svx/source/inc/fmvwimp.hxx                                |    8 
 svx/source/inc/formcontrolfactory.hxx                     |    3 
 svx/source/inc/gridcell.hxx                               |    7 
 svx/source/sidebar/ContextChangeEventMultiplexer.cxx      |    8 
 svx/source/sidebar/nbdtmg.cxx                             |  170 ++++++--------
 svx/source/sidebar/paragraph/ParaNumberingControl.cxx     |    9 
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx                  |    5 
 vcl/source/gdi/impimagetree.cxx                           |   16 -
 162 files changed, 1097 insertions(+), 937 deletions(-)

New commits:
commit d209e133191853f12557d879d1dcda7a0309dac6
Author: Noel Grandin <noel at peralex.com>
Date:   Mon Jun 3 08:34:09 2013 +0200

    fdo#46808, Convert comphelper::ComponentContext in forms module
    
    Change-Id: I8a9913d964633381f00c0a4885cc655805fa1974

diff --git a/connectivity/source/commontools/filtermanager.cxx b/connectivity/source/commontools/filtermanager.cxx
index be526c3..7719a69 100644
--- a/connectivity/source/commontools/filtermanager.cxx
+++ b/connectivity/source/commontools/filtermanager.cxx
@@ -42,9 +42,8 @@ namespace dbtools
     //= FilterManager
     //====================================================================
     //--------------------------------------------------------------------
-    FilterManager::FilterManager( const Reference< XMultiServiceFactory >& _rxORB )
-        :m_xORB( _rxORB )
-        ,m_aFilterComponents( FC_COMPONENT_COUNT )
+    FilterManager::FilterManager( )
+        :m_aFilterComponents( FC_COMPONENT_COUNT )
         ,m_bApplyPublicFilter( true )
     {
     }
diff --git a/dbaccess/source/core/misc/DatabaseDataProvider.cxx b/dbaccess/source/core/misc/DatabaseDataProvider.cxx
index 5931c30..6c2b992 100644
--- a/dbaccess/source/core/misc/DatabaseDataProvider.cxx
+++ b/dbaccess/source/core/misc/DatabaseDataProvider.cxx
@@ -59,7 +59,7 @@ DatabaseDataProvider::DatabaseDataProvider(uno::Reference< uno::XComponentContex
         context, static_cast< Implements >(
             IMPLEMENTS_PROPERTY_SET), uno::Sequence< OUString >()),
     m_aParameterManager( m_aMutex, context ),
-    m_aFilterManager( uno::Reference< lang::XMultiServiceFactory >(context->getServiceManager(),uno::UNO_QUERY) ),
+    m_aFilterManager(),
     m_xContext(context),
     m_CommandType(sdb::CommandType::COMMAND), // #i94114
     m_RowLimit(0),
diff --git a/forms/source/component/Button.cxx b/forms/source/component/Button.cxx
index b7c759a..0866a23 100644
--- a/forms/source/component/Button.cxx
+++ b/forms/source/component/Button.cxx
@@ -24,6 +24,7 @@
 
 #include <comphelper/streamsection.hxx>
 #include <comphelper/basicio.hxx>
+#include <comphelper/processfactory.hxx>
 #include <tools/diagnose_ex.h>
 #include <tools/debug.hxx>
 #include <tools/urlobj.hxx>
@@ -55,11 +56,11 @@ DBG_NAME(OButtonModel)
 //------------------------------------------------------------------
 InterfaceRef SAL_CALL OButtonModel_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory)
 {
-    return *(new OButtonModel(_rxFactory));
+    return *(new OButtonModel( comphelper::getComponentContext(_rxFactory) ));
 }
 
 //------------------------------------------------------------------
-OButtonModel::OButtonModel(const Reference<XMultiServiceFactory>& _rxFactory)
+OButtonModel::OButtonModel(const Reference<XComponentContext>& _rxFactory)
     :OClickableImageBaseModel( _rxFactory, VCL_CONTROLMODEL_COMMANDBUTTON, FRM_SUN_CONTROL_COMMANDBUTTON )
                                     // use the old control name for compatibility reasons
     ,m_aResetHelper( *this, m_aMutex )
@@ -88,7 +89,7 @@ Sequence< Type > OButtonModel::_getTypes()
 }
 
 //------------------------------------------------------------------
-OButtonModel::OButtonModel( const OButtonModel* _pOriginal, const Reference<XMultiServiceFactory>& _rxFactory )
+OButtonModel::OButtonModel( const OButtonModel* _pOriginal, const Reference<XComponentContext>& _rxFactory )
     :OClickableImageBaseModel( _pOriginal, _rxFactory )
     ,m_aResetHelper( *this, m_aMutex )
     ,m_eDefaultState( _pOriginal->m_eDefaultState )
@@ -339,7 +340,7 @@ void OButtonModel::impl_resetNoBroadcast_nothrow()
 //------------------------------------------------------------------
 InterfaceRef SAL_CALL OButtonControl_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory)
 {
-    return *(new OButtonControl(_rxFactory));
+    return *(new OButtonControl( comphelper::getComponentContext(_rxFactory) ));
 }
 
 //------------------------------------------------------------------------------
@@ -364,7 +365,7 @@ StringSequence  OButtonControl::getSupportedServiceNames() throw()
 }
 
 //------------------------------------------------------------------------------
-OButtonControl::OButtonControl(const Reference<XMultiServiceFactory>& _rxFactory)
+OButtonControl::OButtonControl(const Reference<XComponentContext>& _rxFactory)
                  :OClickableImageBaseControl(_rxFactory, VCL_CONTROL_COMMANDBUTTON)
                  ,OFormNavigationHelper( _rxFactory )
                  ,m_nClickEvent( 0 )
@@ -681,7 +682,7 @@ sal_Int16 OButtonControl::getModelUrlFeatureId( ) const
         // is it a feature URL?
         if ( isFormControllerURL( sUrl ) )
         {
-            OFormNavigationMapper aMapper( m_aContext.getLegacyServiceFactory() );
+            OFormNavigationMapper aMapper( m_xContext );
             nFeatureId = aMapper.getFeatureId( sUrl );
         }
     }
diff --git a/forms/source/component/Button.hxx b/forms/source/component/Button.hxx
index 0128ceb..cc8090d 100644
--- a/forms/source/component/Button.hxx
+++ b/forms/source/component/Button.hxx
@@ -130,7 +130,7 @@ protected:
     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes();
 
 public:
-    OButtonControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory);
+    OButtonControl(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxFactory);
     virtual ~OButtonControl();
 
     // XServiceInfo
diff --git a/forms/source/component/CheckBox.cxx b/forms/source/component/CheckBox.cxx
index 3c79725..67751f2 100644
--- a/forms/source/component/CheckBox.cxx
+++ b/forms/source/component/CheckBox.cxx
@@ -23,6 +23,7 @@
 #include "services.hxx"
 #include <tools/debug.hxx>
 #include <comphelper/basicio.hxx>
+#include <comphelper/processfactory.hxx>
 
 //.........................................................................
 namespace frm
@@ -45,7 +46,7 @@ using namespace ::com::sun::star::form::binding;
 //==================================================================
 
 //------------------------------------------------------------------
-OCheckBoxControl::OCheckBoxControl(const Reference<XMultiServiceFactory>& _rxFactory)
+OCheckBoxControl::OCheckBoxControl(const Reference<XComponentContext>& _rxFactory)
     :OBoundControl(_rxFactory, VCL_CONTROL_CHECKBOX)
 {
 }
@@ -53,7 +54,7 @@ OCheckBoxControl::OCheckBoxControl(const Reference<XMultiServiceFactory>& _rxFac
 //------------------------------------------------------------------
 InterfaceRef SAL_CALL OCheckBoxControl_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory) throw (RuntimeException)
 {
-    return *(new OCheckBoxControl(_rxFactory));
+    return *(new OCheckBoxControl( comphelper::getComponentContext(_rxFactory) ));
 }
 
 //------------------------------------------------------------------------------
@@ -74,13 +75,13 @@ StringSequence SAL_CALL OCheckBoxControl::getSupportedServiceNames() throw(::com
 //==================================================================
 InterfaceRef SAL_CALL OCheckBoxModel_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory) throw (RuntimeException)
 {
-    return *(new OCheckBoxModel(_rxFactory));
+    return *(new OCheckBoxModel( comphelper::getComponentContext(_rxFactory) ));
 }
 
 //------------------------------------------------------------------
 DBG_NAME( OCheckBoxModel )
 //------------------------------------------------------------------
-OCheckBoxModel::OCheckBoxModel(const Reference<XMultiServiceFactory>& _rxFactory)
+OCheckBoxModel::OCheckBoxModel(const Reference<XComponentContext>& _rxFactory)
     :OReferenceValueComponent( _rxFactory, VCL_CONTROLMODEL_CHECKBOX, FRM_SUN_CONTROL_CHECKBOX, sal_True )
                     // use the old control name for compytibility reasons
 {
@@ -91,7 +92,7 @@ OCheckBoxModel::OCheckBoxModel(const Reference<XMultiServiceFactory>& _rxFactory
 }
 
 //------------------------------------------------------------------
-OCheckBoxModel::OCheckBoxModel( const OCheckBoxModel* _pOriginal, const Reference<XMultiServiceFactory>& _rxFactory )
+OCheckBoxModel::OCheckBoxModel( const OCheckBoxModel* _pOriginal, const Reference<XComponentContext>& _rxFactory )
     :OReferenceValueComponent( _pOriginal, _rxFactory )
 {
     DBG_CTOR( OCheckBoxModel, NULL );
diff --git a/forms/source/component/CheckBox.hxx b/forms/source/component/CheckBox.hxx
index 3ad94b8..c44ed5b 100644
--- a/forms/source/component/CheckBox.hxx
+++ b/forms/source/component/CheckBox.hxx
@@ -68,7 +68,7 @@ protected:
 class OCheckBoxControl : public OBoundControl
 {
 public:
-    OCheckBoxControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory);
+    OCheckBoxControl(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxContext);
 
     // XServiceInfo
     IMPLEMENTATION_NAME(OCheckBoxControl);
diff --git a/forms/source/component/Columns.cxx b/forms/source/component/Columns.cxx
index aa004a0..05bc70c 100644
--- a/forms/source/component/Columns.cxx
+++ b/forms/source/component/Columns.cxx
@@ -200,11 +200,10 @@ Any SAL_CALL OGridColumn::queryAggregation( const Type& _rType ) throw (RuntimeE
 
 DBG_NAME(OGridColumn);
 //------------------------------------------------------------------------------
-OGridColumn::OGridColumn( const comphelper::ComponentContext& _rContext, const OUString& _sModelName )
+OGridColumn::OGridColumn( const Reference<XComponentContext>& _rContext, const OUString& _sModelName )
     :OGridColumn_BASE(m_aMutex)
     ,OPropertySetAggregationHelper(OGridColumn_BASE::rBHelper)
     ,m_aHidden( makeAny( sal_False ) )
-    ,m_aContext( _rContext )
     ,m_aModelName(_sModelName)
 {
     DBG_CTOR(OGridColumn,NULL);
@@ -215,7 +214,7 @@ OGridColumn::OGridColumn( const comphelper::ComponentContext& _rContext, const O
         increment( m_refCount );
 
         {
-            m_xAggregate.set( m_aContext.createComponent( m_aModelName ), UNO_QUERY );
+            m_xAggregate.set( _rContext->getServiceManager()->createInstanceWithContext( m_aModelName, _rContext ), UNO_QUERY );
             setAggregation( m_xAggregate );
         }
 
@@ -233,7 +232,6 @@ OGridColumn::OGridColumn( const comphelper::ComponentContext& _rContext, const O
 OGridColumn::OGridColumn( const OGridColumn* _pOriginal )
     :OGridColumn_BASE( m_aMutex )
     ,OPropertySetAggregationHelper( OGridColumn_BASE::rBHelper )
-    ,m_aContext( _pOriginal->m_aContext )
 {
     DBG_CTOR(OGridColumn,NULL);
 
diff --git a/forms/source/component/Columns.hxx b/forms/source/component/Columns.hxx
index ed2a105..8313dad 100644
--- a/forms/source/component/Columns.hxx
+++ b/forms/source/component/Columns.hxx
@@ -29,7 +29,6 @@
 #include <com/sun/star/util/XCloneable.hpp>
 
 #include <comphelper/broadcasthelper.hxx>
-#include <comphelper/componentcontext.hxx>
 #include <comphelper/propagg.hxx>
 #include <comphelper/proparrhlp.hxx>
 #include <comphelper/uno3.hxx>
@@ -60,7 +59,6 @@ protected:
     ::com::sun::star::uno::Any  m_aHidden;                  // column hidden?
 // [properties]
 
-    ::comphelper::ComponentContext  m_aContext;
     OUString                 m_aModelName;
 
 // [properties]
@@ -68,7 +66,7 @@ protected:
 // [properties]
 
 public:
-    OGridColumn(const ::comphelper::ComponentContext& _rContext, const OUString& _sModelName = OUString());
+    OGridColumn(const css::uno::Reference<css::uno::XComponentContext>& _rContext, const OUString& _sModelName = OUString());
     OGridColumn(const OGridColumn* _pOriginal );
     virtual ~OGridColumn();
 
@@ -125,7 +123,7 @@ class ClassName
     ,public OAggregationArrayUsageHelper< ClassName >                                                       \
 {                                                                                                           \
 public:                                                                                                     \
-    ClassName(const ::comphelper::ComponentContext& _rContext );                                            \
+    ClassName(const css::uno::Reference<css::uno::XComponentContext>& _rContext );                                            \
     ClassName(const ClassName* _pCloneFrom);                                                                \
                                                                                                             \
     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException);  \
@@ -141,7 +139,7 @@ public:
 
 
 #define IMPL_COLUMN(ClassName, Model, bAllowDropDown)                               \
-    ClassName::ClassName( const ::comphelper::ComponentContext& _rContext ) \
+    ClassName::ClassName( const css::uno::Reference<css::uno::XComponentContext>& _rContext ) \
     :OGridColumn(_rContext, Model) \
 { \
 } \
diff --git a/forms/source/component/ComboBox.cxx b/forms/source/component/ComboBox.cxx
index 33c28e3..ed6eff2 100644
--- a/forms/source/component/ComboBox.cxx
+++ b/forms/source/component/ComboBox.cxx
@@ -40,6 +40,7 @@
 
 #include <comphelper/numbers.hxx>
 #include <comphelper/basicio.hxx>
+#include <comphelper/processfactory.hxx>
 #include <connectivity/dbtools.hxx>
 #include <connectivity/dbconversion.hxx>
 #include <cppuhelper/queryinterface.hxx>
@@ -74,7 +75,7 @@ using namespace ::com::sun::star::form::binding;
 //------------------------------------------------------------------
 InterfaceRef SAL_CALL OComboBoxModel_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory) throw (RuntimeException)
 {
-    return (*new OComboBoxModel(_rxFactory));
+    return (*new OComboBoxModel( comphelper::getComponentContext(_rxFactory) ));
 }
 
 //------------------------------------------------------------------------------
@@ -125,12 +126,12 @@ Any SAL_CALL OComboBoxModel::queryAggregation(const Type& _rType) throw (Runtime
 //------------------------------------------------------------------
 DBG_NAME( OComboBoxModel )
 //------------------------------------------------------------------
-OComboBoxModel::OComboBoxModel(const Reference<XMultiServiceFactory>& _rxFactory)
+OComboBoxModel::OComboBoxModel(const Reference<XComponentContext>& _rxFactory)
     :OBoundControlModel( _rxFactory, VCL_CONTROLMODEL_COMBOBOX, FRM_SUN_CONTROL_COMBOBOX, sal_True, sal_True, sal_True )
                     // use the old control name for compytibility reasons
     ,OEntryListHelper( (OControlModel&)*this )
     ,OErrorBroadcaster( OComponentHelper::rBHelper )
-    ,m_aListRowSet( getContext() )
+    ,m_aListRowSet()
     ,m_eListSourceType(ListSourceType_TABLE)
     ,m_bEmptyIsNull(sal_True)
 {
@@ -141,11 +142,11 @@ OComboBoxModel::OComboBoxModel(const Reference<XMultiServiceFactory>& _rxFactory
 }
 
 //------------------------------------------------------------------
-OComboBoxModel::OComboBoxModel( const OComboBoxModel* _pOriginal, const Reference<XMultiServiceFactory>& _rxFactory )
+OComboBoxModel::OComboBoxModel( const OComboBoxModel* _pOriginal, const Reference<XComponentContext>& _rxFactory )
     :OBoundControlModel( _pOriginal, _rxFactory )
     ,OEntryListHelper( *_pOriginal, (OControlModel&)*this )
     ,OErrorBroadcaster( OComponentHelper::rBHelper )
-    ,m_aListRowSet( getContext() )
+    ,m_aListRowSet()
     ,m_aListSource( _pOriginal->m_aListSource )
     ,m_aDefaultText( _pOriginal->m_aDefaultText )
     ,m_eListSourceType( _pOriginal->m_eListSourceType )
@@ -628,7 +629,7 @@ void OComboBoxModel::loadData( bool _bForce )
                 if ( !xDataField.is() )
                     return;
 
-                ::dbtools::FormattedColumnValue aValueFormatter( getContext().getUNOContext(), xForm, xDataField );
+                ::dbtools::FormattedColumnValue aValueFormatter( getContext(), xForm, xDataField );
 
                 // Fill Lists
                 sal_Int16 i = 0;
@@ -684,7 +685,7 @@ void OComboBoxModel::onConnectedDbColumn( const Reference< XInterface >& _rxForm
 {
     Reference<XPropertySet> xField = getField();
     if ( xField.is() )
-        m_pValueFormatter.reset( new ::dbtools::FormattedColumnValue( getContext().getUNOContext(), Reference< XRowSet >( _rxForm, UNO_QUERY ), xField ) );
+        m_pValueFormatter.reset( new ::dbtools::FormattedColumnValue( getContext(), Reference< XRowSet >( _rxForm, UNO_QUERY ), xField ) );
     getPropertyValue( PROPERTY_STRINGITEMLIST ) >>= m_aDesignModeStringItems;
 
     // Only load data if a ListSource was supplied
@@ -875,12 +876,12 @@ void SAL_CALL OComboBoxModel::disposing( const EventObject& _rSource ) throw ( R
 //------------------------------------------------------------------
 InterfaceRef SAL_CALL OComboBoxControl_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory) throw (RuntimeException)
 {
-    return *(new OComboBoxControl(_rxFactory));
+    return *(new OComboBoxControl( comphelper::getComponentContext(_rxFactory) ));
 }
 
 //------------------------------------------------------------------------------
-OComboBoxControl::OComboBoxControl(const Reference<XMultiServiceFactory>& _rxFactory)
-    :OBoundControl(_rxFactory, VCL_CONTROL_COMBOBOX)
+OComboBoxControl::OComboBoxControl(const Reference<XComponentContext>& _rxContext)
+    :OBoundControl(_rxContext, VCL_CONTROL_COMBOBOX)
 {
 }
 
diff --git a/forms/source/component/ComboBox.hxx b/forms/source/component/ComboBox.hxx
index 7803af3..bd6abc7 100644
--- a/forms/source/component/ComboBox.hxx
+++ b/forms/source/component/ComboBox.hxx
@@ -151,7 +151,7 @@ protected:
 class OComboBoxControl : public OBoundControl
 {
 public:
-    OComboBoxControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory);
+    OComboBoxControl(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxContext);
 
     // XServiceInfo
     IMPLEMENTATION_NAME(OComboBoxControl);
diff --git a/forms/source/component/Currency.cxx b/forms/source/component/Currency.cxx
index c47f18d..0e1c78f 100644
--- a/forms/source/component/Currency.cxx
+++ b/forms/source/component/Currency.cxx
@@ -22,6 +22,7 @@
 #include <unotools/localedatawrapper.hxx>
 #include <vcl/svapp.hxx>
 #include <unotools/syslocale.hxx>
+#include <comphelper/processfactory.hxx>
 
 //.........................................................................
 namespace frm
@@ -43,7 +44,7 @@ using namespace ::com::sun::star::util;
 // OCurrencyControl
 //==================================================================
 //------------------------------------------------------------------
-OCurrencyControl::OCurrencyControl(const Reference<XMultiServiceFactory>& _rxFactory)
+OCurrencyControl::OCurrencyControl(const Reference<XComponentContext>& _rxFactory)
     :OBoundControl(_rxFactory, VCL_CONTROL_CURRENCYFIELD)
 {
 }
@@ -51,7 +52,7 @@ OCurrencyControl::OCurrencyControl(const Reference<XMultiServiceFactory>& _rxFac
 //------------------------------------------------------------------
 InterfaceRef SAL_CALL OCurrencyControl_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory)
 {
-    return *(new OCurrencyControl(_rxFactory));
+    return *(new OCurrencyControl( comphelper::getComponentContext(_rxFactory) ));
 }
 
 //------------------------------------------------------------------------------
@@ -77,7 +78,7 @@ StringSequence SAL_CALL OCurrencyControl::getSupportedServiceNames() throw()
 //------------------------------------------------------------------
 InterfaceRef SAL_CALL OCurrencyModel_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory)
 {
-    return *(new OCurrencyModel(_rxFactory));
+    return *(new OCurrencyModel( comphelper::getComponentContext(_rxFactory) ));
 }
 
 //------------------------------------------------------------------------------
@@ -134,7 +135,7 @@ void OCurrencyModel::implConstruct()
 //------------------------------------------------------------------
 DBG_NAME( OCurrencyModel )
 //------------------------------------------------------------------
-OCurrencyModel::OCurrencyModel(const Reference<XMultiServiceFactory>& _rxFactory)
+OCurrencyModel::OCurrencyModel(const Reference<XComponentContext>& _rxFactory)
     :OEditBaseModel( _rxFactory, VCL_CONTROLMODEL_CURRENCYFIELD, FRM_SUN_CONTROL_CURRENCYFIELD, sal_False, sal_True )
                                     // use the old control name for compytibility reasons
 {
@@ -147,7 +148,7 @@ OCurrencyModel::OCurrencyModel(const Reference<XMultiServiceFactory>& _rxFactory
 }
 
 //------------------------------------------------------------------
-OCurrencyModel::OCurrencyModel( const OCurrencyModel* _pOriginal, const Reference<XMultiServiceFactory>& _rxFactory )
+OCurrencyModel::OCurrencyModel( const OCurrencyModel* _pOriginal, const Reference<XComponentContext>& _rxFactory )
     :OEditBaseModel( _pOriginal, _rxFactory )
 {
     DBG_CTOR( OCurrencyModel, NULL );
diff --git a/forms/source/component/Currency.hxx b/forms/source/component/Currency.hxx
index ba6571d..c2eb146 100644
--- a/forms/source/component/Currency.hxx
+++ b/forms/source/component/Currency.hxx
@@ -79,7 +79,7 @@ protected:
     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes();
 
 public:
-    OCurrencyControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory);
+    OCurrencyControl(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxContext);
     // ::com::sun::star::lang::XServiceInfo
     IMPLEMENTATION_NAME(OCurrencyControl);
     virtual StringSequence SAL_CALL getSupportedServiceNames() throw();
diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx
index 0a49397..7f15aba 100644
--- a/forms/source/component/DatabaseForm.cxx
+++ b/forms/source/component/DatabaseForm.cxx
@@ -216,7 +216,7 @@ void OFormSubmitResetThread::processEvent(
 //------------------------------------------------------------------
 Reference< XInterface > SAL_CALL ODatabaseForm::Create( const Reference< XMultiServiceFactory >& _rxFactory )
 {
-    return *( new ODatabaseForm( _rxFactory ) );
+    return *( new ODatabaseForm( comphelper::getComponentContext(_rxFactory) ) );
 }
 
 //------------------------------------------------------------------------------
@@ -278,8 +278,8 @@ Any SAL_CALL ODatabaseForm::queryAggregation(const Type& _rType) throw(RuntimeEx
 
 DBG_NAME(ODatabaseForm);
 //------------------------------------------------------------------
-ODatabaseForm::ODatabaseForm(const Reference<XMultiServiceFactory>& _rxFactory)
-    :OFormComponents(_rxFactory)
+ODatabaseForm::ODatabaseForm(const Reference<XComponentContext>& _rxContext)
+    :OFormComponents(_rxContext)
     ,OPropertySetAggregationHelper(OComponentHelper::rBHelper)
     ,OPropertyChangeListener(m_aMutex)
     ,m_aLoadListeners(m_aMutex)
@@ -291,8 +291,8 @@ ODatabaseForm::ODatabaseForm(const Reference<XMultiServiceFactory>& _rxFactory)
     ,m_aPropertyBagHelper( *this )
     ,m_pAggregatePropertyMultiplexer(NULL)
     ,m_pGroupManager( NULL )
-    ,m_aParameterManager( m_aMutex, comphelper::getComponentContext(_rxFactory) )
-    ,m_aFilterManager( _rxFactory )
+    ,m_aParameterManager( m_aMutex, _rxContext )
+    ,m_aFilterManager()
     ,m_pLoadTimer(NULL)
     ,m_pThread(NULL)
     ,m_nResetsPending(0)
@@ -331,8 +331,8 @@ ODatabaseForm::ODatabaseForm( const ODatabaseForm& _cloneSource )
     ,m_aPropertyBagHelper( *this )
     ,m_pAggregatePropertyMultiplexer( NULL )
     ,m_pGroupManager( NULL )
-    ,m_aParameterManager( m_aMutex, comphelper::getComponentContext(_cloneSource.m_xServiceFactory) )
-    ,m_aFilterManager( _cloneSource.m_xServiceFactory )
+    ,m_aParameterManager( m_aMutex, _cloneSource.m_xContext )
+    ,m_aFilterManager()
     ,m_pLoadTimer( NULL )
     ,m_pThread( NULL )
     ,m_nResetsPending( 0 )
@@ -418,7 +418,7 @@ void ODatabaseForm::impl_construct()
     // aggregate a row set
     increment(m_refCount);
     {
-        m_xAggregate = Reference< XAggregation >( m_xServiceFactory->createInstance( SRV_SDB_ROWSET ), UNO_QUERY_THROW );
+        m_xAggregate = Reference< XAggregation >( m_xContext->getServiceManager()->createInstanceWithContext(SRV_SDB_ROWSET, m_xContext), UNO_QUERY_THROW );
         m_xAggregateAsRowSet.set( m_xAggregate, UNO_QUERY_THROW );
         setAggregation( m_xAggregate );
     }
@@ -2227,7 +2227,7 @@ void ODatabaseForm::submit_impl(const Reference<XControl>& Control, const ::com:
     if (!xFrame.is())
         return;
 
-    Reference<XURLTransformer> xTransformer(URLTransformer::create(comphelper::getComponentContext(m_xServiceFactory)));
+    Reference<XURLTransformer> xTransformer(URLTransformer::create(m_xContext));
 
     // URL encoding
     if( eSubmitEncoding == FormSubmitEncoding_URL )
@@ -2839,7 +2839,7 @@ sal_Bool ODatabaseForm::implEnsureConnection()
         {
             Reference< XConnection >  xConnection = connectRowset(
                 Reference<XRowSet> (m_xAggregate, UNO_QUERY),
-                comphelper::getComponentContext(m_xServiceFactory),
+                m_xContext,
                 sal_True    // set a calculated connection as ActiveConnection
             );
             return xConnection.is();
diff --git a/forms/source/component/DatabaseForm.hxx b/forms/source/component/DatabaseForm.hxx
index 776b5fe..17ca795 100644
--- a/forms/source/component/DatabaseForm.hxx
+++ b/forms/source/component/DatabaseForm.hxx
@@ -218,7 +218,7 @@ class ODatabaseForm :public OFormComponents
     sal_Bool                    m_bSharingConnection : 1;       // sal_True if the connection we're using is shared with out parent
 
 public:
-    ODatabaseForm(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory);
+    ODatabaseForm(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxFactory);
     ODatabaseForm( const ODatabaseForm& _cloneSource );
     ~ODatabaseForm();
 
diff --git a/forms/source/component/Date.cxx b/forms/source/component/Date.cxx
index 2ac56ab..47f6ea3 100644
--- a/forms/source/component/Date.cxx
+++ b/forms/source/component/Date.cxx
@@ -45,7 +45,7 @@ using namespace ::com::sun::star::io;
 using namespace ::com::sun::star::lang;
 
 //------------------------------------------------------------------
-ODateControl::ODateControl(const Reference<XMultiServiceFactory>& _rxFactory)
+ODateControl::ODateControl(const Reference<XComponentContext>& _rxFactory)
                :OBoundControl(_rxFactory, VCL_CONTROL_DATEFIELD)
 {
 }
@@ -53,7 +53,7 @@ ODateControl::ODateControl(const Reference<XMultiServiceFactory>& _rxFactory)
 //------------------------------------------------------------------
 InterfaceRef SAL_CALL ODateControl_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory)
 {
-    return *(new ODateControl(_rxFactory));
+    return *(new ODateControl( comphelper::getComponentContext(_rxFactory) ));
 }
 
 //------------------------------------------------------------------------------
@@ -77,7 +77,7 @@ StringSequence SAL_CALL ODateControl::getSupportedServiceNames() throw()
 //------------------------------------------------------------------
 InterfaceRef SAL_CALL ODateModel_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory)
 {
-    return *(new ODateModel(_rxFactory));
+    return *(new ODateModel( comphelper::getComponentContext(_rxFactory) ));
 }
 
 //------------------------------------------------------------------------------
@@ -89,10 +89,10 @@ Sequence<Type> ODateModel::_getTypes()
 //------------------------------------------------------------------
 DBG_NAME( ODateModel )
 //------------------------------------------------------------------
-ODateModel::ODateModel(const Reference<XMultiServiceFactory>& _rxFactory)
+ODateModel::ODateModel(const Reference<XComponentContext>& _rxFactory)
             :OEditBaseModel( _rxFactory, VCL_CONTROLMODEL_DATEFIELD, FRM_SUN_CONTROL_DATEFIELD, sal_True, sal_True )
                         // use the old control name for compytibility reasons
-            ,OLimitedFormats( comphelper::getComponentContext(_rxFactory), FormComponentType::DATEFIELD )
+            ,OLimitedFormats( _rxFactory, FormComponentType::DATEFIELD )
 {
     DBG_CTOR( ODateModel, NULL );
 
@@ -115,9 +115,9 @@ ODateModel::ODateModel(const Reference<XMultiServiceFactory>& _rxFactory)
 }
 
 //------------------------------------------------------------------------------
-ODateModel::ODateModel( const ODateModel* _pOriginal, const Reference<XMultiServiceFactory>& _rxFactory )
+ODateModel::ODateModel( const ODateModel* _pOriginal, const Reference<XComponentContext>& _rxFactory )
     :OEditBaseModel( _pOriginal, _rxFactory )
-    ,OLimitedFormats( comphelper::getComponentContext(_rxFactory), FormComponentType::DATEFIELD )
+    ,OLimitedFormats( _rxFactory, FormComponentType::DATEFIELD )
 {
     DBG_CTOR( ODateModel, NULL );
 
diff --git a/forms/source/component/Date.hxx b/forms/source/component/Date.hxx
index 1160945..a1cc55e 100644
--- a/forms/source/component/Date.hxx
+++ b/forms/source/component/Date.hxx
@@ -109,7 +109,7 @@ protected:
     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes();
 
 public:
-    ODateControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory);
+    ODateControl(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxFactory);
     DECLARE_UNO3_AGG_DEFAULTS(ODateControl, OBoundControl);
 
 // ::com::sun::star::lang::XServiceInfo
diff --git a/forms/source/component/Edit.cxx b/forms/source/component/Edit.cxx
index 2a1113c..7ed3cbe 100644
--- a/forms/source/component/Edit.cxx
+++ b/forms/source/component/Edit.cxx
@@ -40,6 +40,7 @@
 
 #include <comphelper/container.hxx>
 #include <comphelper/numbers.hxx>
+#include <comphelper/processfactory.hxx>
 
 using namespace dbtools;
 
@@ -62,7 +63,7 @@ using namespace ::com::sun::star::form::binding;
 //------------------------------------------------------------------
 InterfaceRef SAL_CALL OEditControl_CreateInstance(const Reference< XMultiServiceFactory > & _rxFactory)
 {
-    return *(new OEditControl(_rxFactory));
+    return *(new OEditControl( comphelper::getComponentContext(_rxFactory) ));
 }
 
 //------------------------------------------------------------------------------
@@ -89,7 +90,7 @@ Any SAL_CALL OEditControl::queryAggregation(const Type& _rType) throw (RuntimeEx
 
 DBG_NAME(OEditControl);
 //------------------------------------------------------------------------------
-OEditControl::OEditControl(const Reference<XMultiServiceFactory>& _rxFactory)
+OEditControl::OEditControl(const Reference<XComponentContext>& _rxFactory)
                :OBoundControl( _rxFactory, FRM_SUN_CONTROL_RICHTEXTCONTROL )
                ,m_aChangeListeners(m_aMutex)
                ,m_nKeyEvent( 0 )
@@ -276,7 +277,7 @@ void SAL_CALL OEditControl::createPeer( const Reference< XToolkit>& _rxToolkit,
 //------------------------------------------------------------------
 InterfaceRef SAL_CALL OEditModel_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory)
 {
-    return *(new OEditModel(_rxFactory));
+    return *(new OEditModel( comphelper::getComponentContext(_rxFactory) ));
 }
 
 //------------------------------------------------------------------------------
@@ -288,7 +289,7 @@ Sequence<Type> OEditModel::_getTypes()
 
 DBG_NAME(OEditModel);
 //------------------------------------------------------------------
-OEditModel::OEditModel(const Reference<XMultiServiceFactory>& _rxFactory)
+OEditModel::OEditModel(const Reference<XComponentContext>& _rxFactory)
     :OEditBaseModel( _rxFactory, FRM_SUN_COMPONENT_RICHTEXTCONTROL, FRM_SUN_CONTROL_TEXTFIELD, sal_True, sal_True )
     ,m_bMaxTextLenModified(sal_False)
     ,m_bWritingFormattedFake(sal_False)
@@ -300,7 +301,7 @@ OEditModel::OEditModel(const Reference<XMultiServiceFactory>& _rxFactory)
 }
 
 //------------------------------------------------------------------
-OEditModel::OEditModel( const OEditModel* _pOriginal, const Reference<XMultiServiceFactory>& _rxFactory )
+OEditModel::OEditModel( const OEditModel* _pOriginal, const Reference<XComponentContext>& _rxFactory )
     :OEditBaseModel( _pOriginal, _rxFactory )
     ,m_bMaxTextLenModified(sal_False)
     ,m_bWritingFormattedFake(sal_False)
@@ -508,7 +509,7 @@ void OEditModel::writeAggregate( const Reference< XObjectOutputStream >& _rxOutS
     // but for compatibility, we need to use an "old" aggregate for writing and reading
 
     Reference< XPropertySet > xFakedAggregate(
-        getContext().createComponent( (OUString)VCL_CONTROLMODEL_EDIT ),
+        getContext()->getServiceManager()->createInstanceWithContext( (OUString)VCL_CONTROLMODEL_EDIT, getContext() ),
         UNO_QUERY
     );
     OSL_ENSURE( xFakedAggregate.is(), "OEditModel::writeAggregate: could not create an old EditControlModel!" );
@@ -530,7 +531,7 @@ void OEditModel::readAggregate( const Reference< XObjectInputStream >& _rxInStre
     // but for compatibility, we need to use an "old" aggregate for writing and reading
 
     Reference< XPropertySet > xFakedAggregate(
-        getContext().createComponent( (OUString)VCL_CONTROLMODEL_EDIT ),
+        getContext()->getServiceManager()->createInstanceWithContext( (OUString)VCL_CONTROLMODEL_EDIT, getContext() ),
         UNO_QUERY
     );
     Reference< XPersistObject > xFakedPersist( xFakedAggregate, UNO_QUERY );
@@ -611,7 +612,7 @@ void OEditModel::onConnectedDbColumn( const Reference< XInterface >& _rxForm )
     Reference< XPropertySet > xField = getField();
     if ( xField.is() )
     {
-        m_pValueFormatter.reset( new ::dbtools::FormattedColumnValue( getContext().getUNOContext(), Reference< XRowSet >( _rxForm, UNO_QUERY ), xField ) );
+        m_pValueFormatter.reset( new ::dbtools::FormattedColumnValue( getContext(), Reference< XRowSet >( _rxForm, UNO_QUERY ), xField ) );
 
         if ( m_pValueFormatter->getKeyType() != NumberFormat::SCIENTIFIC )
         {
diff --git a/forms/source/component/Edit.hxx b/forms/source/component/Edit.hxx
index 5ef4daf..acefa31 100644
--- a/forms/source/component/Edit.hxx
+++ b/forms/source/component/Edit.hxx
@@ -135,7 +135,7 @@ class OEditControl : public OBoundControl
     sal_uInt32              m_nKeyEvent;
 
 public:
-    OEditControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory);
+    OEditControl(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxContext);
     virtual ~OEditControl();
 
     DECLARE_UNO3_AGG_DEFAULTS(OEditControl, OBoundControl);
diff --git a/forms/source/component/EditBase.cxx b/forms/source/component/EditBase.cxx
index bfbb76f..73de846 100644
--- a/forms/source/component/EditBase.cxx
+++ b/forms/source/component/EditBase.cxx
@@ -48,7 +48,7 @@ const sal_uInt16 FILTERPROPOSAL  =  0x0004;
 
 DBG_NAME( OEditBaseModel )
 //------------------------------------------------------------------
-OEditBaseModel::OEditBaseModel( const Reference< XMultiServiceFactory >& _rxFactory, const OUString& rUnoControlModelName,
+OEditBaseModel::OEditBaseModel( const Reference< XComponentContext >& _rxFactory, const OUString& rUnoControlModelName,
         const OUString& rDefault, const sal_Bool _bSupportExternalBinding, const sal_Bool _bSupportsValidation )
     :OBoundControlModel( _rxFactory, rUnoControlModelName, rDefault, sal_True, _bSupportExternalBinding, _bSupportsValidation )
     ,m_nLastReadVersion(0)
@@ -59,7 +59,7 @@ OEditBaseModel::OEditBaseModel( const Reference< XMultiServiceFactory >& _rxFact
 }
 
 //------------------------------------------------------------------
-OEditBaseModel::OEditBaseModel( const OEditBaseModel* _pOriginal, const Reference< XMultiServiceFactory >& _rxFactory )
+OEditBaseModel::OEditBaseModel( const OEditBaseModel* _pOriginal, const Reference< XComponentContext >& _rxFactory )
      :OBoundControlModel( _pOriginal, _rxFactory )
      ,m_nLastReadVersion(0)
 {
diff --git a/forms/source/component/File.cxx b/forms/source/component/File.cxx
index fa580bc..c11c09c 100644
--- a/forms/source/component/File.cxx
+++ b/forms/source/component/File.cxx
@@ -27,6 +27,7 @@
 #include <comphelper/container.hxx>
 #include <comphelper/basicio.hxx>
 #include <comphelper/guarding.hxx>
+#include <comphelper/processfactory.hxx>
 
 //.........................................................................
 namespace frm
@@ -47,7 +48,7 @@ using namespace ::com::sun::star::util;
 //------------------------------------------------------------------
 InterfaceRef SAL_CALL OFileControlModel_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory)
 {
-    return *(new OFileControlModel(_rxFactory));
+    return *(new OFileControlModel( comphelper::getComponentContext(_rxFactory) ));
 }
 
 //------------------------------------------------------------------------------
@@ -84,7 +85,7 @@ StringSequence  OFileControlModel::getSupportedServiceNames() throw(RuntimeExcep
 //------------------------------------------------------------------
 DBG_NAME( OFileControlModel )
 //------------------------------------------------------------------
-OFileControlModel::OFileControlModel(const Reference<XMultiServiceFactory>& _rxFactory)
+OFileControlModel::OFileControlModel(const Reference<XComponentContext>& _rxFactory)
                     :OControlModel(_rxFactory, VCL_CONTROLMODEL_FILECONTROL)
                     ,m_aResetListeners(m_aMutex)
 {
@@ -93,7 +94,7 @@ OFileControlModel::OFileControlModel(const Reference<XMultiServiceFactory>& _rxF
 }
 
 //------------------------------------------------------------------
-OFileControlModel::OFileControlModel( const OFileControlModel* _pOriginal, const Reference<XMultiServiceFactory>& _rxFactory )
+OFileControlModel::OFileControlModel( const OFileControlModel* _pOriginal, const Reference<XComponentContext>& _rxFactory )
     :OControlModel( _pOriginal, _rxFactory )
     ,m_aResetListeners( m_aMutex )
 {
diff --git a/forms/source/component/FixedText.cxx b/forms/source/component/FixedText.cxx
index 32738f1..9ca2004 100644
--- a/forms/source/component/FixedText.cxx
+++ b/forms/source/component/FixedText.cxx
@@ -22,6 +22,7 @@
 #include "property.hrc"
 #include "property.hxx"
 #include <tools/debug.hxx>
+#include <comphelper/processfactory.hxx>
 
 //.........................................................................
 namespace frm
@@ -41,13 +42,13 @@ using namespace ::com::sun::star::util;
 //------------------------------------------------------------------------------
 InterfaceRef SAL_CALL OFixedTextModel_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory) throw (RuntimeException)
 {
-    return *(new OFixedTextModel(_rxFactory));
+    return *(new OFixedTextModel( comphelper::getComponentContext(_rxFactory) ));
 }
 
 //------------------------------------------------------------------
 DBG_NAME( OFixedTextModel )
 //------------------------------------------------------------------
-OFixedTextModel::OFixedTextModel( const Reference<XMultiServiceFactory>& _rxFactory )
+OFixedTextModel::OFixedTextModel( const Reference<XComponentContext>& _rxFactory )
         :OControlModel(_rxFactory, VCL_CONTROLMODEL_FIXEDTEXT)
 
 {
@@ -56,7 +57,7 @@ OFixedTextModel::OFixedTextModel( const Reference<XMultiServiceFactory>& _rxFact
 }
 
 //------------------------------------------------------------------
-OFixedTextModel::OFixedTextModel( const OFixedTextModel* _pOriginal, const Reference<XMultiServiceFactory>& _rxFactory )
+OFixedTextModel::OFixedTextModel( const OFixedTextModel* _pOriginal, const Reference<XComponentContext>& _rxFactory )
     :OControlModel( _pOriginal, _rxFactory )
 
 {
diff --git a/forms/source/component/FormComponent.cxx b/forms/source/component/FormComponent.cxx
index a666f6a..eb32945 100644
--- a/forms/source/component/FormComponent.cxx
+++ b/forms/source/component/FormComponent.cxx
@@ -132,9 +132,9 @@ namespace frm
 //=============================================================================
 DBG_NAME(frm_OControl)
 //------------------------------------------------------------------------------
-OControl::OControl( const Reference< XMultiServiceFactory >& _rxFactory, const OUString& _rAggregateService, const sal_Bool _bSetDelegator )
+OControl::OControl( const Reference< XComponentContext >& _rxContext, const OUString& _rAggregateService, const sal_Bool _bSetDelegator )
             :OComponentHelper(m_aMutex)
-            ,m_aContext( _rxFactory )
+            ,m_xContext( _rxContext )
 {
     DBG_CTOR(frm_OControl, NULL);
     // VCL-Control aggregieren
@@ -142,7 +142,7 @@ OControl::OControl( const Reference< XMultiServiceFactory >& _rxFactory, const O
     // das Aggregat selbst den Refcount erhoeht
     increment( m_refCount );
     {
-        m_xAggregate = m_xAggregate.query( _rxFactory->createInstance( _rAggregateService ) );
+        m_xAggregate = m_xAggregate.query( _rxContext->getServiceManager()->createInstanceWithContext(_rAggregateService, _rxContext) );
         m_xControl = m_xControl.query( m_xAggregate );
     }
     decrement( m_refCount );
@@ -390,9 +390,9 @@ sal_Bool SAL_CALL OControl::isTransparent() throw ( RuntimeException)
 //==================================================================
 DBG_NAME(frm_OBoundControl);
 //------------------------------------------------------------------
-OBoundControl::OBoundControl( const Reference< XMultiServiceFactory >& _rxFactory,
+OBoundControl::OBoundControl( const Reference< XComponentContext >& _rxContext,
             const OUString& _rAggregateService, const sal_Bool _bSetDelegator )
-    :OControl( _rxFactory, _rAggregateService, _bSetDelegator )
+    :OControl( _rxContext, _rAggregateService, _bSetDelegator )
     ,m_bLocked(sal_False)
     ,m_aOriginalFont( EmptyFontDescriptor() )
     ,m_nOriginalTextLineColor( 0 )
@@ -573,12 +573,12 @@ void OControlModel::writeHelpTextCompatibly(const staruno::Reference< stario::XO
 
 //------------------------------------------------------------------
 OControlModel::OControlModel(
-                        const Reference<com::sun::star::lang::XMultiServiceFactory>& _rxFactory,
+            const Reference<XComponentContext>& _rxContext,
             const OUString& _rUnoControlModelTypeName,
             const OUString& rDefault, const sal_Bool _bSetDelegator)
     :OComponentHelper(m_aMutex)
     ,OPropertySetAggregationHelper(OComponentHelper::rBHelper)
-    ,m_aContext( _rxFactory )
+    ,m_xContext( _rxContext )
     ,m_lockCount( 0 )
     ,m_aPropertyBagHelper( *this )
     ,m_nTabIndex(FRM_DEFAULT_TABINDEX)
@@ -595,7 +595,7 @@ OControlModel::OControlModel(
         increment(m_refCount);
 
         {
-            m_xAggregate = Reference<XAggregation>(_rxFactory->createInstance(_rUnoControlModelTypeName), UNO_QUERY);
+            m_xAggregate = Reference<XAggregation>(m_xContext->getServiceManager()->createInstanceWithContext(_rUnoControlModelTypeName, m_xContext), UNO_QUERY);
             setAggregation(m_xAggregate);
 
             if ( m_xAggregateSet.is() )
@@ -622,10 +622,10 @@ OControlModel::OControlModel(
 }
 
 //------------------------------------------------------------------
-OControlModel::OControlModel( const OControlModel* _pOriginal, const Reference< XMultiServiceFactory>& _rxFactory, const sal_Bool _bCloneAggregate, const sal_Bool _bSetDelegator )
+OControlModel::OControlModel( const OControlModel* _pOriginal, const Reference< XComponentContext>& _rxFactory, const sal_Bool _bCloneAggregate, const sal_Bool _bSetDelegator )
     :OComponentHelper( m_aMutex )
     ,OPropertySetAggregationHelper( OComponentHelper::rBHelper )
-    ,m_aContext( _rxFactory )
+    ,m_xContext( _rxFactory )
     ,m_lockCount( 0 )
     ,m_aPropertyBagHelper( *this )
     ,m_nTabIndex( FRM_DEFAULT_TABINDEX )
@@ -1227,7 +1227,7 @@ Any SAL_CALL OBoundControlModel::queryAggregation( const Type& _rType ) throw (R
 
 //------------------------------------------------------------------
 OBoundControlModel::OBoundControlModel(
-        const Reference< XMultiServiceFactory>& _rxFactory,
+        const Reference< XComponentContext>& _rxFactory,
         const OUString& _rUnoControlModelTypeName, const OUString& _rDefault,
         const sal_Bool _bCommitable, const sal_Bool _bSupportExternalBinding, const sal_Bool _bSupportsValidation )
     :OControlModel( _rxFactory, _rUnoControlModelTypeName, _rDefault, sal_False )
@@ -1264,7 +1264,7 @@ OBoundControlModel::OBoundControlModel(
 
 //------------------------------------------------------------------
 OBoundControlModel::OBoundControlModel(
-        const OBoundControlModel* _pOriginal, const Reference< XMultiServiceFactory>& _rxFactory )
+        const OBoundControlModel* _pOriginal, const Reference< XComponentContext>& _rxFactory )
     :OControlModel( _pOriginal, _rxFactory, sal_True, sal_False )
     ,OPropertyChangeListener( m_aMutex )
     ,m_xField()
diff --git a/forms/source/component/FormattedField.cxx b/forms/source/component/FormattedField.cxx
index fc3fd0f..991219b 100644
--- a/forms/source/component/FormattedField.cxx
+++ b/forms/source/component/FormattedField.cxx
@@ -182,7 +182,7 @@ void StandardFormatsSupplier::notifyTermination()
 //------------------------------------------------------------------
 InterfaceRef SAL_CALL OFormattedControl_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory)
 {
-    return *(new OFormattedControl(_rxFactory));
+    return *(new OFormattedControl( comphelper::getComponentContext(_rxFactory) ));
 }
 
 //------------------------------------------------------------------
@@ -206,7 +206,7 @@ Any SAL_CALL OFormattedControl::queryAggregation(const Type& _rType) throw (Runt
 
 DBG_NAME(OFormattedControl);
 //------------------------------------------------------------------------------
-OFormattedControl::OFormattedControl(const Reference<XMultiServiceFactory>& _rxFactory)
+OFormattedControl::OFormattedControl(const Reference<XComponentContext>& _rxFactory)
                :OBoundControl(_rxFactory, VCL_CONTROL_FORMATTEDFIELD)
                ,m_nKeyEvent(0)
 {
@@ -356,7 +356,7 @@ void OFormattedModel::implConstruct()
 }
 
 //------------------------------------------------------------------
-OFormattedModel::OFormattedModel(const Reference<XMultiServiceFactory>& _rxFactory)
+OFormattedModel::OFormattedModel(const Reference<XComponentContext>& _rxFactory)
     :OEditBaseModel(_rxFactory, VCL_CONTROLMODEL_FORMATTEDFIELD, FRM_SUN_CONTROL_FORMATTEDFIELD, sal_True, sal_True )
                             // use the old control name for compytibility reasons
     ,OErrorBroadcaster( OComponentHelper::rBHelper )
@@ -370,7 +370,7 @@ OFormattedModel::OFormattedModel(const Reference<XMultiServiceFactory>& _rxFacto
 }
 
 //------------------------------------------------------------------
-OFormattedModel::OFormattedModel( const OFormattedModel* _pOriginal, const Reference< XMultiServiceFactory >& _rxFactory )
+OFormattedModel::OFormattedModel( const OFormattedModel* _pOriginal, const Reference< XComponentContext >& _rxFactory )
     :OEditBaseModel( _pOriginal, _rxFactory )
     ,OErrorBroadcaster( OComponentHelper::rBHelper )
 {
@@ -654,14 +654,14 @@ Reference<XNumberFormatsSupplier>  OFormattedModel::calcFormFormatsSupplier() co
     Reference< XRowSet > xRowSet( xNextParentForm, UNO_QUERY );
     Reference< XNumberFormatsSupplier > xSupplier;
     if (xRowSet.is())
-        xSupplier = getNumberFormats( getConnection(xRowSet), sal_True, getContext().getUNOContext() );
+        xSupplier = getNumberFormats( getConnection(xRowSet), sal_True, getContext() );
     return xSupplier;
 }
 
 //------------------------------------------------------------------------------
 Reference< XNumberFormatsSupplier > OFormattedModel::calcDefaultFormatsSupplier() const
 {
-    return StandardFormatsSupplier::get( getContext().getUNOContext() );
+    return StandardFormatsSupplier::get( getContext() );
 }
 
 // XBoundComponent
diff --git a/forms/source/component/FormattedField.hxx b/forms/source/component/FormattedField.hxx
index a213138..4507225 100644
--- a/forms/source/component/FormattedField.hxx
+++ b/forms/source/component/FormattedField.hxx
@@ -154,7 +154,7 @@ namespace frm
         sal_uInt32              m_nKeyEvent;
 
     public:
-        OFormattedControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory);
+        OFormattedControl(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxContext);
         virtual ~OFormattedControl();
 
         DECLARE_UNO3_AGG_DEFAULTS(OFormattedControl, OBoundControl);
diff --git a/forms/source/component/FormattedFieldWrapper.cxx b/forms/source/component/FormattedFieldWrapper.cxx
index 19f5dae..0e76c8c 100644
--- a/forms/source/component/FormattedFieldWrapper.cxx
+++ b/forms/source/component/FormattedFieldWrapper.cxx
@@ -25,6 +25,7 @@
 #include "services.hxx"
 #include <connectivity/dbtools.hxx>
 #include <vcl/svapp.hxx>
+#include <comphelper/processfactory.hxx>
 
 //.........................................................................
 namespace frm
@@ -46,23 +47,23 @@ using namespace ::com::sun::star::util;
 //==================================================================
 DBG_NAME(OFormattedFieldWrapper)
 
-InterfaceRef SAL_CALL OFormattedFieldWrapper_CreateInstance_ForceFormatted(const Reference<XMultiServiceFactory>& _rxFactory)
+Reference<XInterface> SAL_CALL OFormattedFieldWrapper_CreateInstance_ForceFormatted(const Reference<XMultiServiceFactory>& _rxFactory)
 {
-    return OFormattedFieldWrapper::createFormattedFieldWrapper(_rxFactory, true);
+    return OFormattedFieldWrapper::createFormattedFieldWrapper( comphelper::getComponentContext(_rxFactory), true);
 }
 
 InterfaceRef SAL_CALL OFormattedFieldWrapper_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory)
 {
-    return OFormattedFieldWrapper::createFormattedFieldWrapper(_rxFactory, false);
+    return OFormattedFieldWrapper::createFormattedFieldWrapper( comphelper::getComponentContext(_rxFactory), false);
 }
 
-OFormattedFieldWrapper::OFormattedFieldWrapper(const Reference<XMultiServiceFactory>& _rxFactory)
-    :m_xServiceFactory(_rxFactory)
+OFormattedFieldWrapper::OFormattedFieldWrapper(const Reference<XComponentContext>& _rxFactory)
+    :m_xContext(_rxFactory)
 {
     DBG_CTOR(OFormattedFieldWrapper, NULL);
 }
 
-InterfaceRef OFormattedFieldWrapper::createFormattedFieldWrapper(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory, bool bActAsFormatted)
+InterfaceRef OFormattedFieldWrapper::createFormattedFieldWrapper(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxFactory, bool bActAsFormatted)
 {
     OFormattedFieldWrapper *pRef = new OFormattedFieldWrapper(_rxFactory);
 
@@ -72,7 +73,7 @@ InterfaceRef OFormattedFieldWrapper::createFormattedFieldWrapper(const ::com::su
         InterfaceRef  xFormattedModel;
         // (instantiate it directly ..., as the OFormattedModel isn't
         // registered for any service names anymore)
-        OFormattedModel* pModel = new OFormattedModel(pRef->m_xServiceFactory);
+        OFormattedModel* pModel = new OFormattedModel(pRef->m_xContext);
         query_interface(static_cast<XWeak*>(pModel), xFormattedModel);
 
         pRef->m_xAggregate = Reference<XAggregation> (xFormattedModel, UNO_QUERY);
@@ -80,7 +81,7 @@ InterfaceRef OFormattedFieldWrapper::createFormattedFieldWrapper(const ::com::su
 
         // _before_ setting the delegator, give it to the member references
         query_interface(xFormattedModel, pRef->m_xFormattedPart);
-        pRef->m_pEditPart = rtl::Reference< OEditModel >(new OEditModel(pRef->m_xServiceFactory));
+        pRef->m_pEditPart = rtl::Reference< OEditModel >(new OEditModel(pRef->m_xContext));
     }
 
     increment(pRef->m_refCount);
@@ -100,7 +101,7 @@ Reference< XCloneable > SAL_CALL OFormattedFieldWrapper::createClone() throw (Ru
 {
     ensureAggregate();
 
-    rtl::Reference< OFormattedFieldWrapper > xRef(new OFormattedFieldWrapper(m_xServiceFactory));
+    rtl::Reference< OFormattedFieldWrapper > xRef(new OFormattedFieldWrapper(m_xContext));
 
     Reference< XCloneable > xCloneAccess;
     query_aggregation( m_xAggregate, xCloneAccess );
@@ -116,7 +117,7 @@ Reference< XCloneable > SAL_CALL OFormattedFieldWrapper::createClone() throw (Ru
 
         if ( m_pEditPart.is() )
         {
-            xRef->m_pEditPart = rtl::Reference< OEditModel >( new OEditModel(m_pEditPart.get(), m_xServiceFactory));
+            xRef->m_pEditPart = rtl::Reference< OEditModel >( new OEditModel(m_pEditPart.get(), m_xContext));
         }
     }
     else
@@ -301,7 +302,7 @@ void SAL_CALL OFormattedFieldWrapper::read(const Reference<XObjectInputStream>&
 
     {
         // let an OEditModel do the reading
-        rtl::Reference< OEditModel > pBasicReader(new OEditModel(m_xServiceFactory));
+        rtl::Reference< OEditModel > pBasicReader(new OEditModel(m_xContext));
         pBasicReader->read(_rxInStream);
 
         // was it really an edit model ?
@@ -313,7 +314,7 @@ void SAL_CALL OFormattedFieldWrapper::read(const Reference<XObjectInputStream>&
         else
         {   // no -> substitute it with a formatted model
             // let the formmatted model do the reading
-            m_xFormattedPart = Reference< XPersistObject >(new OFormattedModel(m_xServiceFactory));
+            m_xFormattedPart = Reference< XPersistObject >(new OFormattedModel(m_xContext));
             m_xFormattedPart->read(_rxInStream);
             m_pEditPart = pBasicReader;
             m_xAggregate = Reference< XAggregation >( m_xFormattedPart, UNO_QUERY );
@@ -338,11 +339,11 @@ void OFormattedFieldWrapper::ensureAggregate()
     {
         // instantiate an EditModel (the only place where we are allowed to decide that we're an FormattedModel
         // is in ::read)
-        InterfaceRef  xEditModel = m_xServiceFactory->createInstance(FRM_SUN_COMPONENT_TEXTFIELD);
+        InterfaceRef  xEditModel = m_xContext->getServiceManager()->createInstanceWithContext(FRM_SUN_COMPONENT_TEXTFIELD, m_xContext);
         if (!xEditModel.is())
         {
             // arghhh ... instantiate it directly ... it's dirty, but we really need this aggregate
-            OEditModel* pModel = new OEditModel(m_xServiceFactory);
+            OEditModel* pModel = new OEditModel(m_xContext);
             query_interface(static_cast<XWeak*>(pModel), xEditModel);
         }
 
diff --git a/forms/source/component/FormattedFieldWrapper.hxx b/forms/source/component/FormattedFieldWrapper.hxx
index 1dc202c..0c28f38 100644
--- a/forms/source/component/FormattedFieldWrapper.hxx
+++ b/forms/source/component/FormattedFieldWrapper.hxx
@@ -40,7 +40,7 @@ typedef ::cppu::WeakAggImplHelper3  <   ::com::sun::star::io::XPersistObject
 
 class OFormattedFieldWrapper : public OFormattedFieldWrapper_Base
 {
-    ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory> m_xServiceFactory;
+    ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext> m_xContext;
 
 protected:
     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation>      m_xAggregate;
@@ -52,10 +52,10 @@ protected:
     // to read and write the FormattedModel part
     // if bActAsFormatted is false, the state is undetermined until somebody calls
     // ::read or does anything which requires a living aggregate
-    static InterfaceRef createFormattedFieldWrapper(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory, bool bActAsFormatted);
+    static InterfaceRef createFormattedFieldWrapper(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxFactory, bool bActAsFormatted);
 
 private:
-    OFormattedFieldWrapper(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory);
+    OFormattedFieldWrapper(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxFactory);
 
 protected:
     virtual ~OFormattedFieldWrapper();
diff --git a/forms/source/component/FormsCollection.cxx b/forms/source/component/FormsCollection.cxx
index b89a6c3..e4e0c06 100644
--- a/forms/source/component/FormsCollection.cxx
+++ b/forms/source/component/FormsCollection.cxx
@@ -21,6 +21,7 @@
 #include "FormsCollection.hxx"
 #include "services.hxx"
 #include <comphelper/sequence.hxx>
+#include <comphelper/processfactory.hxx>
 #include <tools/debug.hxx>
 #include <com/sun/star/form/XForm.hpp>
 
@@ -39,7 +40,7 @@ DBG_NAME(OFormsCollection)
 //------------------------------------------------------------------
 InterfaceRef SAL_CALL OFormsCollection_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory)
 {
-    return *(new OFormsCollection(_rxFactory));
+    return *(new OFormsCollection( comphelper::getComponentContext(_rxFactory) ));
 }
 
 //------------------------------------------------------------------------------
@@ -61,7 +62,7 @@ Sequence<Type> SAL_CALL OFormsCollection::getTypes() throw(RuntimeException)
 }
 
 //------------------------------------------------------------------
-OFormsCollection::OFormsCollection(const Reference<XMultiServiceFactory>& _rxFactory)
+OFormsCollection::OFormsCollection(const Reference<XComponentContext>& _rxFactory)
     :FormsCollectionComponentBase( m_aMutex )
     ,OInterfaceContainer( _rxFactory, m_aMutex, XForm::static_type() )
     ,OFormsCollection_BASE()
diff --git a/forms/source/component/FormsCollection.hxx b/forms/source/component/FormsCollection.hxx
index fe847fd..9da3f3e 100644
--- a/forms/source/component/FormsCollection.hxx
+++ b/forms/source/component/FormsCollection.hxx
@@ -52,7 +52,7 @@ class OFormsCollection
     ::comphelper::InterfaceRef  m_xParent;          // Parent
 
 public:
-    OFormsCollection(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory);
+    OFormsCollection(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxFactory);
     OFormsCollection( const OFormsCollection& _cloneSource );
     virtual ~OFormsCollection();
 
diff --git a/forms/source/component/Grid.cxx b/forms/source/component/Grid.cxx
index 29f3b58..e1c8549 100644
--- a/forms/source/component/Grid.cxx
+++ b/forms/source/component/Grid.cxx
@@ -33,6 +33,7 @@
 #include <comphelper/basicio.hxx>
 #include <comphelper/container.hxx>
 #include <comphelper/extract.hxx>
+#include <comphelper/processfactory.hxx>
 #include <cppuhelper/queryinterface.hxx>
 #include <toolkit/helper/vclunohelper.hxx>
 #include <vcl/svapp.hxx>
@@ -72,12 +73,12 @@ const sal_uInt16 BACKGROUNDCOLOR    =   0x0100;
 //------------------------------------------------------------------
 InterfaceRef SAL_CALL OGridControlModel_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory)
 {
-    return *(new OGridControlModel(_rxFactory));
+    return *(new OGridControlModel( comphelper::getComponentContext(_rxFactory) ));
 }
 
 DBG_NAME(OGridControlModel);
 //------------------------------------------------------------------
-OGridControlModel::OGridControlModel(const Reference<XMultiServiceFactory>& _rxFactory)
+OGridControlModel::OGridControlModel(const Reference<XComponentContext>& _rxFactory)
     :OControlModel(_rxFactory, OUString())
     ,OInterfaceContainer(_rxFactory, m_aMutex, ::getCppuType(static_cast<Reference<XPropertySet>*>(NULL)))
     ,OErrorBroadcaster( OComponentHelper::rBHelper )
@@ -103,7 +104,7 @@ OGridControlModel::OGridControlModel(const Reference<XMultiServiceFactory>& _rxF
 }
 
 //------------------------------------------------------------------
-OGridControlModel::OGridControlModel( const OGridControlModel* _pOriginal, const Reference< XMultiServiceFactory >& _rxFactory )
+OGridControlModel::OGridControlModel( const OGridControlModel* _pOriginal, const Reference< XComponentContext >& _rxFactory )
     :OControlModel( _pOriginal, _rxFactory )
     ,OInterfaceContainer( _rxFactory, m_aMutex, ::getCppuType( static_cast<Reference<XPropertySet>*>( NULL ) ) )
     ,OErrorBroadcaster( OComponentHelper::rBHelper )
@@ -148,7 +149,7 @@ OGridControlModel::~OGridControlModel()
 //------------------------------------------------------------------------------
 Reference< XCloneable > SAL_CALL OGridControlModel::createClone( ) throw (RuntimeException)
 {
-    OGridControlModel* pClone = new OGridControlModel( this, getContext().getLegacyServiceFactory() );
+    OGridControlModel* pClone = new OGridControlModel( this, getContext() );
     osl_atomic_increment( &pClone->m_refCount );
     pClone->OControlModel::clonedFrom( this );
     // do not call OInterfaceContainer::clonedFrom, it would clone the elements aka columns, which is
diff --git a/forms/source/component/GroupBox.cxx b/forms/source/component/GroupBox.cxx
index c97a5e7..e8fa191 100644
--- a/forms/source/component/GroupBox.cxx
+++ b/forms/source/component/GroupBox.cxx
@@ -22,6 +22,7 @@
 #include "property.hrc"
 #include "services.hxx"
 #include <tools/debug.hxx>
+#include <comphelper/processfactory.hxx>
 
 //.........................................................................
 namespace frm
@@ -45,13 +46,13 @@ using namespace ::com::sun::star::util;
 //------------------------------------------------------------------
 InterfaceRef SAL_CALL OGroupBoxModel_CreateInstance(const Reference<starlang::XMultiServiceFactory>& _rxFactory) throw (RuntimeException)
 {
-    return *(new OGroupBoxModel(_rxFactory));
+    return *(new OGroupBoxModel( comphelper::getComponentContext(_rxFactory) ));
 }
 
 //------------------------------------------------------------------
 DBG_NAME( OGroupBoxModel )
 //------------------------------------------------------------------
-OGroupBoxModel::OGroupBoxModel(const Reference<starlang::XMultiServiceFactory>& _rxFactory)
+OGroupBoxModel::OGroupBoxModel(const Reference<XComponentContext>& _rxFactory)
     :OControlModel(_rxFactory, VCL_CONTROLMODEL_GROUPBOX, VCL_CONTROL_GROUPBOX)
 {
     DBG_CTOR( OGroupBoxModel, NULL );
@@ -59,7 +60,7 @@ OGroupBoxModel::OGroupBoxModel(const Reference<starlang::XMultiServiceFactory>&
 }
 
 //------------------------------------------------------------------
-OGroupBoxModel::OGroupBoxModel( const OGroupBoxModel* _pOriginal, const Reference<starlang::XMultiServiceFactory>& _rxFactory )
+OGroupBoxModel::OGroupBoxModel( const OGroupBoxModel* _pOriginal, const Reference<XComponentContext>& _rxFactory )
     :OControlModel( _pOriginal, _rxFactory )
 {
     DBG_CTOR( OGroupBoxModel, NULL );
@@ -137,11 +138,11 @@ void SAL_CALL OGroupBoxModel::read(const Reference< XObjectInputStream>& _rxInSt
 //------------------------------------------------------------------
 InterfaceRef SAL_CALL OGroupBoxControl_CreateInstance(const Reference<starlang::XMultiServiceFactory>& _rxFactory) throw (RuntimeException)
 {
-    return *(new OGroupBoxControl(_rxFactory));
+    return *(new OGroupBoxControl( comphelper::getComponentContext(_rxFactory) ));
 }
 
 //------------------------------------------------------------------------------
-OGroupBoxControl::OGroupBoxControl(const Reference<starlang::XMultiServiceFactory>& _rxFactory)
+OGroupBoxControl::OGroupBoxControl(const Reference<XComponentContext>& _rxFactory)
                    :OControl(_rxFactory, VCL_CONTROL_GROUPBOX)
 {
 }
diff --git a/forms/source/component/GroupBox.hxx b/forms/source/component/GroupBox.hxx
index e825e02..4509a28 100644
--- a/forms/source/component/GroupBox.hxx
+++ b/forms/source/component/GroupBox.hxx
@@ -61,7 +61,7 @@ protected:
 class OGroupBoxControl : public OControl
 {
 public:
-    OGroupBoxControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory);
+    OGroupBoxControl(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxFactory);
 
     // XServiceInfo
     IMPLEMENTATION_NAME(OGroupBoxControl);
diff --git a/forms/source/component/Hidden.cxx b/forms/source/component/Hidden.cxx
index 223c081..9c0dd5e 100644
--- a/forms/source/component/Hidden.cxx
+++ b/forms/source/component/Hidden.cxx
@@ -23,6 +23,7 @@
 #include "services.hxx"
 #include <tools/debug.hxx>
 #include <comphelper/basicio.hxx>
+#include <comphelper/processfactory.hxx>
 
 //.........................................................................
 namespace frm
@@ -42,13 +43,13 @@ using namespace ::com::sun::star::util;
 //------------------------------------------------------------------
 InterfaceRef SAL_CALL OHiddenModel_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory) throw (RuntimeException)
 {
-    return *(new OHiddenModel(_rxFactory));
+    return *(new OHiddenModel( comphelper::getComponentContext(_rxFactory) ));
 }
 
 //------------------------------------------------------------------
 DBG_NAME( OHiddenModel )
 //------------------------------------------------------------------
-OHiddenModel::OHiddenModel(const Reference<XMultiServiceFactory>& _rxFactory)
+OHiddenModel::OHiddenModel(const Reference<XComponentContext>& _rxFactory)
     :OControlModel(_rxFactory, OUString())
 {
     DBG_CTOR( OHiddenModel, NULL );
@@ -56,7 +57,7 @@ OHiddenModel::OHiddenModel(const Reference<XMultiServiceFactory>& _rxFactory)
 }
 
 //------------------------------------------------------------------
-OHiddenModel::OHiddenModel( const OHiddenModel* _pOriginal, const Reference<XMultiServiceFactory>& _rxFactory )
+OHiddenModel::OHiddenModel( const OHiddenModel* _pOriginal, const Reference<XComponentContext>& _rxFactory )
     :OControlModel( _pOriginal, _rxFactory )
 {
     DBG_CTOR( OHiddenModel, NULL );
diff --git a/forms/source/component/ImageButton.cxx b/forms/source/component/ImageButton.cxx
index e5f66ef..9507ebe 100644
--- a/forms/source/component/ImageButton.cxx
+++ b/forms/source/component/ImageButton.cxx
@@ -23,6 +23,7 @@
 #include <vcl/svapp.hxx>
 #include <osl/mutex.hxx>
 #include <comphelper/basicio.hxx>
+#include <comphelper/processfactory.hxx>
 #include <com/sun/star/awt/MouseButton.hpp>
 
 //.........................................................................
@@ -48,11 +49,11 @@ DBG_NAME(OImageButtonModel)
 //------------------------------------------------------------------
 InterfaceRef SAL_CALL OImageButtonModel_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory)
 {
-     return *(new OImageButtonModel(_rxFactory));
+     return *(new OImageButtonModel( comphelper::getComponentContext(_rxFactory) ));
 }
 
 //------------------------------------------------------------------
-OImageButtonModel::OImageButtonModel(const Reference<XMultiServiceFactory>& _rxFactory)
+OImageButtonModel::OImageButtonModel(const Reference<XComponentContext>& _rxFactory)
                     :OClickableImageBaseModel( _rxFactory, VCL_CONTROLMODEL_IMAGEBUTTON, FRM_SUN_CONTROL_IMAGEBUTTON )
                                     // use the old control name for compytibility reasons
 {
@@ -61,7 +62,7 @@ OImageButtonModel::OImageButtonModel(const Reference<XMultiServiceFactory>& _rxF
 }
 
 //------------------------------------------------------------------
-OImageButtonModel::OImageButtonModel( const OImageButtonModel* _pOriginal, const Reference<XMultiServiceFactory>& _rxFactory)
+OImageButtonModel::OImageButtonModel( const OImageButtonModel* _pOriginal, const Reference<XComponentContext>& _rxFactory)
     :OClickableImageBaseModel( _pOriginal, _rxFactory )
 {
     DBG_CTOR(OImageButtonModel, NULL);
@@ -168,7 +169,7 @@ void OImageButtonModel::read(const Reference<XObjectInputStream>& _rxInStream) t
 //------------------------------------------------------------------
 InterfaceRef SAL_CALL OImageButtonControl_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory)
 {
-    return *(new OImageButtonControl(_rxFactory));
+    return *(new OImageButtonControl( comphelper::getComponentContext(_rxFactory) ));
 }
 
 //------------------------------------------------------------------------------
@@ -192,7 +193,7 @@ StringSequence  OImageButtonControl::getSupportedServiceNames() throw()
 }
 
 //------------------------------------------------------------------------------
-OImageButtonControl::OImageButtonControl(const Reference<XMultiServiceFactory>& _rxFactory)
+OImageButtonControl::OImageButtonControl(const Reference<XComponentContext>& _rxFactory)
             :OClickableImageBaseControl(_rxFactory, VCL_CONTROL_IMAGEBUTTON)
 {
     increment(m_refCount);
diff --git a/forms/source/component/ImageButton.hxx b/forms/source/component/ImageButton.hxx
index 1496b42..40ebaac 100644
--- a/forms/source/component/ImageButton.hxx
+++ b/forms/source/component/ImageButton.hxx
@@ -67,7 +67,7 @@ protected:
     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes();
 
 public:
-    OImageButtonControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory);
+    OImageButtonControl(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxFactory);
 
     // XServiceInfo
     IMPLEMENTATION_NAME(OImageButtonControl);
diff --git a/forms/source/component/ImageControl.cxx b/forms/source/component/ImageControl.cxx
index 9816599..138ea20 100644
--- a/forms/source/component/ImageControl.cxx
+++ b/forms/source/component/ImageControl.cxx
@@ -52,6 +52,7 @@
 #include <unotools/streamhelper.hxx>
 #include <comphelper/extract.hxx>
 #include <comphelper/guarding.hxx>
+#include <comphelper/processfactory.hxx>
 #include <unotools/ucbstreamhelper.hxx>
 #include <svl/urihelper.hxx>
 
@@ -124,7 +125,7 @@ namespace
 //------------------------------------------------------------------------------
 InterfaceRef SAL_CALL OImageControlModel_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory)
 {
-    return *(new OImageControlModel(_rxFactory));
+    return *(new OImageControlModel( comphelper::getComponentContext(_rxFactory) ));
 }
 
 //------------------------------------------------------------------------------
@@ -138,7 +139,7 @@ Sequence<Type> OImageControlModel::_getTypes()
 
 DBG_NAME(OImageControlModel)
 //------------------------------------------------------------------
-OImageControlModel::OImageControlModel(const Reference<XMultiServiceFactory>& _rxFactory)
+OImageControlModel::OImageControlModel(const Reference<XComponentContext>& _rxFactory)
     :OBoundControlModel( _rxFactory, VCL_CONTROLMODEL_IMAGECONTROL, FRM_SUN_CONTROL_IMAGECONTROL, sal_False, sal_False, sal_False )
                     // use the old control name for compytibility reasons
     ,m_pImageProducer( NULL )
@@ -155,7 +156,7 @@ OImageControlModel::OImageControlModel(const Reference<XMultiServiceFactory>& _r
 }
 
 //------------------------------------------------------------------
-OImageControlModel::OImageControlModel( const OImageControlModel* _pOriginal, const Reference< XMultiServiceFactory >& _rxFactory )
+OImageControlModel::OImageControlModel( const OImageControlModel* _pOriginal, const Reference< XComponentContext >& _rxFactory )
     :OBoundControlModel( _pOriginal, _rxFactory )
                 // use the old control name for compytibility reasons
     ,m_pImageProducer( NULL )
@@ -283,7 +284,7 @@ void OImageControlModel::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, con
                 m_xGraphicObject.clear();
             else
             {
-                m_xGraphicObject = GraphicObject::create( m_aContext.getUNOContext() );
+                m_xGraphicObject = GraphicObject::create( m_xContext );
                 m_xGraphicObject->setGraphic( xGraphic );
             }
 
@@ -420,7 +421,7 @@ sal_Bool OImageControlModel::impl_updateStreamForURL_lck( const OUString& _rURL,
 
     if ( ::svt::GraphicAccess::isSupportedURL( _rURL ) )
     {
-        xImageStream = ::svt::GraphicAccess::getImageXStream( getContext().getUNOContext(), _rURL );
+        xImageStream = ::svt::GraphicAccess::getImageXStream( getContext(), _rURL );
     }
     else
     {
@@ -701,7 +702,7 @@ IMPL_LINK( OImageControlModel, OnImageImportDone, ::Graphic*, i_pGraphic )
 //------------------------------------------------------------------
 InterfaceRef SAL_CALL OImageControlControl_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory)
 {
-    return *(new OImageControlControl(_rxFactory));
+    return *(new OImageControlControl( comphelper::getComponentContext(_rxFactory) ));
 }
 
 //------------------------------------------------------------------------------
@@ -714,7 +715,7 @@ Sequence<Type> OImageControlControl::_getTypes()
 }
 
 //------------------------------------------------------------------------------
-OImageControlControl::OImageControlControl(const Reference<XMultiServiceFactory>& _rxFactory)
+OImageControlControl::OImageControlControl(const Reference<XComponentContext>& _rxFactory)
     :OBoundControl(_rxFactory, VCL_CONTROL_IMAGECONTROL)
     ,m_aModifyListeners( m_aMutex )
 {
@@ -903,7 +904,7 @@ void OImageControlControl::mousePressed(const ::com::sun::star::awt::MouseEvent&
     // is this a request for a context menu?
     if ( e.PopupTrigger )
     {
-        Reference< XPopupMenu > xMenu( awt::PopupMenu::create( m_aContext.getUNOContext() ) );
+        Reference< XPopupMenu > xMenu( awt::PopupMenu::create( m_xContext ) );
         DBG_ASSERT( xMenu.is(), "OImageControlControl::mousePressed: could not create a popup menu!" );
 
         Reference< XWindowPeer > xWindowPeer = getPeer();
diff --git a/forms/source/component/ImageControl.hxx b/forms/source/component/ImageControl.hxx
index 56f8952..4bca629 100644
--- a/forms/source/component/ImageControl.hxx
+++ b/forms/source/component/ImageControl.hxx
@@ -159,7 +159,7 @@ private:
     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes();
 
 public:
-    OImageControlControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory);
+    OImageControlControl(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxFactory);
 
     // UNO
     DECLARE_UNO3_AGG_DEFAULTS( OImageControlControl, OBoundControl );
diff --git a/forms/source/component/ListBox.cxx b/forms/source/component/ListBox.cxx
index 29f6981..f99d4fe 100644
--- a/forms/source/component/ListBox.cxx
+++ b/forms/source/component/ListBox.cxx
@@ -41,6 +41,7 @@
 #include <comphelper/basicio.hxx>
 #include <comphelper/container.hxx>
 #include <comphelper/numbers.hxx>
+#include <comphelper/processfactory.hxx>
 #include <comphelper/listenernotification.hxx>
 #include <connectivity/dbtools.hxx>
 #include <connectivity/formattedcolumnvalue.hxx>
@@ -133,7 +134,7 @@ namespace frm
     //------------------------------------------------------------------
     InterfaceRef SAL_CALL OListBoxModel_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory) throw (RuntimeException)
     {
-        return *(new OListBoxModel(_rxFactory));
+        return *(new OListBoxModel( comphelper::getComponentContext(_rxFactory) ));
     }
 
     //------------------------------------------------------------------------------
@@ -154,12 +155,12 @@ namespace frm
 
     DBG_NAME(OListBoxModel);
     //------------------------------------------------------------------
-    OListBoxModel::OListBoxModel(const Reference<XMultiServiceFactory>& _rxFactory)
+    OListBoxModel::OListBoxModel(const Reference<XComponentContext>& _rxFactory)
         :OBoundControlModel( _rxFactory, VCL_CONTROLMODEL_LISTBOX, FRM_SUN_CONTROL_LISTBOX, sal_True, sal_True, sal_True )
         // use the old control name for compatibility reasons
         ,OEntryListHelper( (OControlModel&)*this )
         ,OErrorBroadcaster( OComponentHelper::rBHelper )
-        ,m_aListRowSet( getContext() )
+        ,m_aListRowSet()
         ,m_nNULLPos(-1)
         ,m_nBoundColumnType( DataType::SQLNULL )
     {
@@ -174,11 +175,11 @@ namespace frm
     }
 
     //------------------------------------------------------------------
-    OListBoxModel::OListBoxModel( const OListBoxModel* _pOriginal, const Reference<XMultiServiceFactory>& _rxFactory )
+    OListBoxModel::OListBoxModel( const OListBoxModel* _pOriginal, const Reference<XComponentContext>& _rxFactory )
         :OBoundControlModel( _pOriginal, _rxFactory )
         ,OEntryListHelper( *_pOriginal, (OControlModel&)*this )
         ,OErrorBroadcaster( OComponentHelper::rBHelper )
-        ,m_aListRowSet( getContext() )
+        ,m_aListRowSet()
         ,m_eListSourceType( _pOriginal->m_eListSourceType )
         ,m_aBoundColumn( _pOriginal->m_aBoundColumn )
         ,m_aListSourceValues( _pOriginal->m_aListSourceValues )
@@ -877,7 +878,7 @@ namespace frm
                     if ( !xDataField.is() )
                         return;
 
-                    ::dbtools::FormattedColumnValue aValueFormatter( getContext().getUNOContext(), m_xCursor, xDataField );
+                    ::dbtools::FormattedColumnValue aValueFormatter( getContext(), m_xCursor, xDataField );
 
                     // Get the field of BoundColumn of the ResultSet
                     m_nBoundColumnType = DataType::SQLNULL;
@@ -1709,7 +1710,7 @@ namespace frm
     //------------------------------------------------------------------
     InterfaceRef SAL_CALL OListBoxControl_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory) throw (RuntimeException)
     {
-        return *(new OListBoxControl(_rxFactory));
+        return *(new OListBoxControl( comphelper::getComponentContext(_rxFactory) ));
     }
 
     //------------------------------------------------------------------------------
@@ -1736,7 +1737,7 @@ namespace frm
 
     DBG_NAME(OListBoxControl);
     //------------------------------------------------------------------------------
-    OListBoxControl::OListBoxControl(const Reference<XMultiServiceFactory>& _rxFactory)
+    OListBoxControl::OListBoxControl(const Reference<XComponentContext>& _rxFactory)
         :OBoundControl( _rxFactory, VCL_CONTROL_LISTBOX, sal_False )
         ,m_aChangeListeners( m_aMutex )
         ,m_aItemListeners( m_aMutex )
diff --git a/forms/source/component/ListBox.hxx b/forms/source/component/ListBox.hxx
index fe60540..2448218 100644
--- a/forms/source/component/ListBox.hxx
+++ b/forms/source/component/ListBox.hxx
@@ -271,7 +271,7 @@ protected:
     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type>   _getTypes();
 
 public:
-    OListBoxControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory);
+    OListBoxControl(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxFactory);
     virtual ~OListBoxControl();
 
     // UNO Anbindung
diff --git a/forms/source/component/Numeric.cxx b/forms/source/component/Numeric.cxx
index ac4542e..d567b35 100644
--- a/forms/source/component/Numeric.cxx
+++ b/forms/source/component/Numeric.cxx
@@ -19,6 +19,7 @@
 
 #include "Numeric.hxx"
 #include <tools/debug.hxx>
+#include <comphelper/processfactory.hxx>
 
 //.........................................................................
 namespace frm
@@ -42,7 +43,7 @@ using namespace ::com::sun::star::form::binding;
 //==================================================================
 
 //------------------------------------------------------------------
-ONumericControl::ONumericControl(const Reference<XMultiServiceFactory>& _rxFactory)
+ONumericControl::ONumericControl(const Reference<XComponentContext>& _rxFactory)
     :OBoundControl(_rxFactory, VCL_CONTROL_NUMERICFIELD)
 {
 }
@@ -62,7 +63,7 @@ StringSequence ONumericControl::getSupportedServiceNames() throw()
 //------------------------------------------------------------------
 InterfaceRef SAL_CALL ONumericControl_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory)
 {
-    return *(new ONumericControl(_rxFactory));
+    return *(new ONumericControl( comphelper::getComponentContext(_rxFactory) ));
 }
 
 //------------------------------------------------------------------------------
@@ -77,7 +78,7 @@ Sequence<Type> ONumericControl::_getTypes()
 //------------------------------------------------------------------
 InterfaceRef SAL_CALL ONumericModel_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory)
 {
-    return *(new ONumericModel(_rxFactory));
+    return *(new ONumericModel( comphelper::getComponentContext(_rxFactory) ));
 }
 
 //------------------------------------------------------------------------------
@@ -89,7 +90,7 @@ Sequence<Type> ONumericModel::_getTypes()
 //------------------------------------------------------------------
 DBG_NAME( ONumericModel )
 //------------------------------------------------------------------
-ONumericModel::ONumericModel(const Reference<XMultiServiceFactory>& _rxFactory)
+ONumericModel::ONumericModel(const Reference<XComponentContext>& _rxFactory)
                 :OEditBaseModel( _rxFactory, VCL_CONTROLMODEL_NUMERICFIELD, FRM_SUN_CONTROL_NUMERICFIELD, sal_True, sal_True )
                                     // use the old control name for compytibility reasons
 {
@@ -100,7 +101,7 @@ ONumericModel::ONumericModel(const Reference<XMultiServiceFactory>& _rxFactory)
 }
 
 //------------------------------------------------------------------
-ONumericModel::ONumericModel( const ONumericModel* _pOriginal, const Reference<XMultiServiceFactory>& _rxFactory )
+ONumericModel::ONumericModel( const ONumericModel* _pOriginal, const Reference<XComponentContext>& _rxFactory )
     :OEditBaseModel( _pOriginal, _rxFactory )
 {
     DBG_CTOR( ONumericModel, NULL );
diff --git a/forms/source/component/Numeric.hxx b/forms/source/component/Numeric.hxx
index 542028c..bdb0a39 100644
--- a/forms/source/component/Numeric.hxx
+++ b/forms/source/component/Numeric.hxx
@@ -76,7 +76,7 @@ protected:
     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes();
 
 public:
-    ONumericControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory);
+    ONumericControl(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxFactory);
 
     // ::com::sun::star::lang::XServiceInfo
     IMPLEMENTATION_NAME(ONumericControl);
diff --git a/forms/source/component/Pattern.cxx b/forms/source/component/Pattern.cxx
index 2d24d5f..0dd42ff 100644
--- a/forms/source/component/Pattern.cxx
+++ b/forms/source/component/Pattern.cxx
@@ -18,6 +18,7 @@
  */
 
 #include "Pattern.hxx"
+#include "comphelper/processfactory.hxx"
 
 //.........................................................................
 namespace frm
@@ -28,6 +29,7 @@ namespace frm
     using ::com::sun::star::lang::XMultiServiceFactory;
     using ::com::sun::star::uno::Sequence;
     using ::com::sun::star::uno::Type;
+    using ::com::sun::star::uno::XComponentContext;
     using ::com::sun::star::beans::Property;
     using ::com::sun::star::uno::Exception;
     using ::com::sun::star::uno::XInterface;
@@ -42,7 +44,7 @@ namespace frm
 // OPatternControl
 //==================================================================
 //------------------------------------------------------------------
-OPatternControl::OPatternControl(const Reference<XMultiServiceFactory>& _rxFactory)
+OPatternControl::OPatternControl(const Reference<XComponentContext>& _rxFactory)
     :OBoundControl(_rxFactory, VCL_CONTROL_PATTERNFIELD)
 {
 }
@@ -50,7 +52,7 @@ OPatternControl::OPatternControl(const Reference<XMultiServiceFactory>& _rxFacto
 //------------------------------------------------------------------
 InterfaceRef SAL_CALL OPatternControl_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory)
 {
-    return *(new OPatternControl(_rxFactory));
+    return *(new OPatternControl( comphelper::getComponentContext(_rxFactory) ));
 }
 
 //------------------------------------------------------------------------------
@@ -76,7 +78,7 @@ StringSequence OPatternControl::getSupportedServiceNames() throw()
 //------------------------------------------------------------------
 InterfaceRef SAL_CALL OPatternModel_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory)
 {
-    return *(new OPatternModel(_rxFactory));
+    return *(new OPatternModel( comphelper::getComponentContext(_rxFactory) ));
 }
 
 //------------------------------------------------------------------------------
@@ -88,7 +90,7 @@ Sequence<Type> OPatternModel::_getTypes()
 //------------------------------------------------------------------
 DBG_NAME( OPatternModel )
 //------------------------------------------------------------------
-OPatternModel::OPatternModel(const Reference<XMultiServiceFactory>& _rxFactory)
+OPatternModel::OPatternModel(const Reference<XComponentContext>& _rxFactory)
     :OEditBaseModel( _rxFactory, VCL_CONTROLMODEL_PATTERNFIELD, FRM_SUN_CONTROL_PATTERNFIELD, sal_False, sal_False )
                                     // use the old control name for compytibility reasons
 {
@@ -99,7 +101,7 @@ OPatternModel::OPatternModel(const Reference<XMultiServiceFactory>& _rxFactory)
 }
 
 //------------------------------------------------------------------
-OPatternModel::OPatternModel( const OPatternModel* _pOriginal, const Reference<XMultiServiceFactory>& _rxFactory )
+OPatternModel::OPatternModel( const OPatternModel* _pOriginal, const Reference<XComponentContext>& _rxFactory )
     :OEditBaseModel( _pOriginal, _rxFactory )
 {
     DBG_CTOR( OPatternModel, NULL );
@@ -189,7 +191,7 @@ void OPatternModel::onConnectedDbColumn( const Reference< XInterface >& _rxForm
     if ( !xField.is() )
         return;
 
-    m_pFormattedValue.reset( new ::dbtools::FormattedColumnValue( getContext().getUNOContext(), Reference< XRowSet >( _rxForm, UNO_QUERY ), xField ) );
+    m_pFormattedValue.reset( new ::dbtools::FormattedColumnValue( getContext(), Reference< XRowSet >( _rxForm, UNO_QUERY ), xField ) );
 }
 
 //------------------------------------------------------------------------------
diff --git a/forms/source/component/Pattern.hxx b/forms/source/component/Pattern.hxx
index 80aac87..43975ea 100644
--- a/forms/source/component/Pattern.hxx
+++ b/forms/source/component/Pattern.hxx
@@ -85,7 +85,7 @@ protected:
     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes();
 
 public:
-    OPatternControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory);
+    OPatternControl(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxFactory);
 
     // ::com::sun::star::lang::XServiceInfo
     IMPLEMENTATION_NAME(OPatternControl);
diff --git a/forms/source/component/RadioButton.cxx b/forms/source/component/RadioButton.cxx
index b0bcdfb..51cf309 100644
--- a/forms/source/component/RadioButton.cxx
+++ b/forms/source/component/RadioButton.cxx
@@ -25,6 +25,7 @@
 #include <tools/debug.hxx>
 #include <comphelper/extract.hxx>
 #include <comphelper/basicio.hxx>
+#include <comphelper/processfactory.hxx>
 #include <com/sun/star/container/XIndexAccess.hpp>
 #include <com/sun/star/awt/XVclWindowPeer.hpp>
 
@@ -48,7 +49,7 @@ using namespace ::com::sun::star::form::binding;
 //------------------------------------------------------------------------------
 InterfaceRef SAL_CALL ORadioButtonControl_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory) throw (RuntimeException)
 {
-    return *(new ORadioButtonControl(_rxFactory));
+    return *(new ORadioButtonControl( comphelper::getComponentContext(_rxFactory) ));
 }
 
 //------------------------------------------------------------------------------
@@ -64,7 +65,7 @@ StringSequence SAL_CALL ORadioButtonControl::getSupportedServiceNames() throw(Ru
 
 
 //------------------------------------------------------------------
-ORadioButtonControl::ORadioButtonControl(const Reference<XMultiServiceFactory>& _rxFactory)
+ORadioButtonControl::ORadioButtonControl(const Reference<XComponentContext>& _rxFactory)
                       :OBoundControl(_rxFactory, VCL_CONTROL_RADIOBUTTON)
 {
 }
@@ -93,13 +94,13 @@ void SAL_CALL ORadioButtonControl::createPeer(const Reference<starawt::XToolkit>
 //==================================================================
 InterfaceRef SAL_CALL ORadioButtonModel_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory) throw (RuntimeException)
 {
-    return *(new ORadioButtonModel(_rxFactory));
+    return *(new ORadioButtonModel( comphelper::getComponentContext(_rxFactory) ));
 }
 
 //------------------------------------------------------------------
 DBG_NAME( ORadioButtonModel )
 //------------------------------------------------------------------
-ORadioButtonModel::ORadioButtonModel(const Reference<XMultiServiceFactory>& _rxFactory)
+ORadioButtonModel::ORadioButtonModel(const Reference<XComponentContext>& _rxFactory)
     :OReferenceValueComponent( _rxFactory, VCL_CONTROLMODEL_RADIOBUTTON, FRM_SUN_CONTROL_RADIOBUTTON,sal_True )
                     // use the old control name for compytibility reasons
 {
@@ -112,7 +113,7 @@ ORadioButtonModel::ORadioButtonModel(const Reference<XMultiServiceFactory>& _rxF
 }
 
 //------------------------------------------------------------------
-ORadioButtonModel::ORadioButtonModel( const ORadioButtonModel* _pOriginal, const Reference<XMultiServiceFactory>& _rxFactory )
+ORadioButtonModel::ORadioButtonModel( const ORadioButtonModel* _pOriginal, const Reference<XComponentContext>& _rxFactory )
     :OReferenceValueComponent( _pOriginal, _rxFactory )
 {
     DBG_CTOR( ORadioButtonModel, NULL );
diff --git a/forms/source/component/RadioButton.hxx b/forms/source/component/RadioButton.hxx
index 94e50eb..f1d39d1 100644
--- a/forms/source/component/RadioButton.hxx
+++ b/forms/source/component/RadioButton.hxx
@@ -86,7 +86,7 @@ private:
 class ORadioButtonControl: public OBoundControl
 {
 public:
-    ORadioButtonControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory);
+    ORadioButtonControl(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxFactory);
 
     // XServiceInfo
     IMPLEMENTATION_NAME(ORadioButtonControl);
diff --git a/forms/source/component/Time.cxx b/forms/source/component/Time.cxx
index 512b3f0..db81946 100644
--- a/forms/source/component/Time.cxx
+++ b/forms/source/component/Time.cxx
@@ -52,7 +52,7 @@ using namespace ::com::sun::star::lang;
 //= OTimeControl
 //==================================================================
 //------------------------------------------------------------------
-OTimeControl::OTimeControl(const Reference<XMultiServiceFactory>& _rxFactory)
+OTimeControl::OTimeControl(const Reference<XComponentContext>& _rxFactory)
                :OBoundControl(_rxFactory, VCL_CONTROL_TIMEFIELD)
 {
 }
@@ -60,7 +60,7 @@ OTimeControl::OTimeControl(const Reference<XMultiServiceFactory>& _rxFactory)
 //------------------------------------------------------------------
 InterfaceRef SAL_CALL OTimeControl_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory)
 {
-    return *(new OTimeControl(_rxFactory));
+    return *(new OTimeControl( comphelper::getComponentContext(_rxFactory) ));
 }
 
 //------------------------------------------------------------------------------
@@ -86,7 +86,7 @@ StringSequence SAL_CALL OTimeControl::getSupportedServiceNames() throw()
 //------------------------------------------------------------------
 InterfaceRef SAL_CALL OTimeModel_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory)
 {
-    return *(new OTimeModel(_rxFactory));
+    return *(new OTimeModel( comphelper::getComponentContext(_rxFactory) ));
 }
 
 // XServiceInfo
@@ -122,10 +122,10 @@ Sequence<Type> OTimeModel::_getTypes()
 //------------------------------------------------------------------
 DBG_NAME( OTimeModel )
 //------------------------------------------------------------------
-OTimeModel::OTimeModel(const Reference<XMultiServiceFactory>& _rxFactory)
+OTimeModel::OTimeModel(const Reference<XComponentContext>& _rxFactory)
             :OEditBaseModel( _rxFactory, VCL_CONTROLMODEL_TIMEFIELD, FRM_SUN_CONTROL_TIMEFIELD, sal_True, sal_True )
                                     // use the old control name for compytibility reasons
-            ,OLimitedFormats( comphelper::getComponentContext(_rxFactory), FormComponentType::TIMEFIELD)
+            ,OLimitedFormats( _rxFactory, FormComponentType::TIMEFIELD)
 {
     DBG_CTOR( OTimeModel, NULL );
 
@@ -136,9 +136,9 @@ OTimeModel::OTimeModel(const Reference<XMultiServiceFactory>& _rxFactory)
 }
 
 //------------------------------------------------------------------------------
-OTimeModel::OTimeModel( const OTimeModel* _pOriginal, const Reference<XMultiServiceFactory>& _rxFactory )
+OTimeModel::OTimeModel( const OTimeModel* _pOriginal, const Reference<XComponentContext>& _rxFactory )
     :OEditBaseModel( _pOriginal, _rxFactory )
-    ,OLimitedFormats( comphelper::getComponentContext(_rxFactory), FormComponentType::TIMEFIELD )
+    ,OLimitedFormats( _rxFactory, FormComponentType::TIMEFIELD )
 {
     DBG_CTOR( OTimeModel, NULL );
 
diff --git a/forms/source/component/Time.hxx b/forms/source/component/Time.hxx
index b36c3c6..74cf5ac3 100644
--- a/forms/source/component/Time.hxx
+++ b/forms/source/component/Time.hxx
@@ -109,7 +109,7 @@ protected:
     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes();
 
 public:
-    OTimeControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory);
+    OTimeControl(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxFactory);
     DECLARE_UNO3_AGG_DEFAULTS(OTimeControl, OBoundControl);
 
     // ::com::sun::star::lang::XServiceInfo
diff --git a/forms/source/component/cachedrowset.cxx b/forms/source/component/cachedrowset.cxx
index 4a2792b..8847e37 100644
--- a/forms/source/component/cachedrowset.cxx
+++ b/forms/source/component/cachedrowset.cxx
@@ -40,6 +40,7 @@ namespace frm
     using ::com::sun::star::uno::UNO_SET_THROW;
     using ::com::sun::star::uno::Exception;
     using ::com::sun::star::uno::RuntimeException;
+    using ::com::sun::star::uno::XComponentContext;
     using ::com::sun::star::sdbc::XConnection;
     using ::com::sun::star::lang::XComponent;
     using ::com::sun::star::beans::XPropertySet;
@@ -58,16 +59,14 @@ namespace frm
     //====================================================================
     struct CachedRowSet_Data
     {
-        ::comphelper::ComponentContext  aContext;
         OUString                 sCommand;
         sal_Bool                        bEscapeProcessing;
         Reference< XConnection >        xConnection;
 
         bool                            bStatementDirty;
 
-        CachedRowSet_Data( const ::comphelper::ComponentContext& _rContext )
-            :aContext( _rContext )
-            ,sCommand()
+        CachedRowSet_Data()
+            :sCommand()
             ,bEscapeProcessing( sal_False )
             ,xConnection()
             ,bStatementDirty( true )
@@ -79,8 +78,8 @@ namespace frm
     //= CachedRowSet
     //====================================================================
     //--------------------------------------------------------------------
-    CachedRowSet::CachedRowSet( const ::comphelper::ComponentContext& _rContext )
-        :m_pData( new CachedRowSet_Data( _rContext ) )
+    CachedRowSet::CachedRowSet()
+        :m_pData( new CachedRowSet_Data )
     {
     }
 
@@ -176,7 +175,7 @@ namespace frm
     {
         try
         {
-            m_pData.reset( new CachedRowSet_Data( m_pData->aContext ) );
+            m_pData.reset( new CachedRowSet_Data );
         }
         catch( const Exception& )
         {
diff --git a/forms/source/component/cachedrowset.hxx b/forms/source/component/cachedrowset.hxx
index 7b7ece8..5293bc9 100644
--- a/forms/source/component/cachedrowset.hxx
+++ b/forms/source/component/cachedrowset.hxx
@@ -42,7 +42,7 @@ namespace frm
     class CachedRowSet
     {
     public:
-        CachedRowSet( const ::comphelper::ComponentContext& _rContext );
+        CachedRowSet();
         ~CachedRowSet();
 
     public:
diff --git a/forms/source/component/clickableimage.cxx b/forms/source/component/clickableimage.cxx
index 93ef01e..f3b9f89 100644
--- a/forms/source/component/clickableimage.cxx
+++ b/forms/source/component/clickableimage.cxx
@@ -40,6 +40,7 @@
 #include "services.hxx"
 #include <comphelper/container.hxx>
 #include <comphelper/listenernotification.hxx>
+#include <comphelper/processfactory.hxx>
 #include <svtools/imageresourceaccess.hxx>
 #define LOCAL_URL_PREFIX    '#'
 
@@ -77,7 +78,7 @@ namespace frm
     }
 
     //------------------------------------------------------------------------------
-    OClickableImageBaseControl::OClickableImageBaseControl(const Reference<XMultiServiceFactory>& _rxFactory, const OUString& _aService)
+    OClickableImageBaseControl::OClickableImageBaseControl(const Reference<XComponentContext>& _rxFactory, const OUString& _aService)
         :OControl(_rxFactory, _aService)
         ,m_pThread(NULL)
         ,m_aSubmissionVetoListeners( m_aMutex )
@@ -448,7 +449,7 @@ namespace frm
     //------------------------------------------------------------------
     DBG_NAME( OClickableImageBaseModel )
     //------------------------------------------------------------------
-    OClickableImageBaseModel::OClickableImageBaseModel( const Reference< XMultiServiceFactory >& _rxFactory, const OUString& _rUnoControlModelTypeName,
+    OClickableImageBaseModel::OClickableImageBaseModel( const Reference< XComponentContext >& _rxFactory, const OUString& _rUnoControlModelTypeName,
             const OUString& rDefault )
         :OControlModel( _rxFactory, _rUnoControlModelTypeName, rDefault )
         ,OPropertyChangeListener(m_aMutex)
@@ -464,7 +465,7 @@ namespace frm
     }
 
     //------------------------------------------------------------------
-    OClickableImageBaseModel::OClickableImageBaseModel( const OClickableImageBaseModel* _pOriginal, const Reference<XMultiServiceFactory>& _rxFactory )
+    OClickableImageBaseModel::OClickableImageBaseModel( const OClickableImageBaseModel* _pOriginal, const Reference<XComponentContext>& _rxFactory )
         :OControlModel( _pOriginal, _rxFactory )
         ,OPropertyChangeListener( m_aMutex )
         ,m_pMedium( NULL )
diff --git a/forms/source/component/clickableimage.hxx b/forms/source/component/clickableimage.hxx
index 4ce20fc..ec6593e 100644
--- a/forms/source/component/clickableimage.hxx
+++ b/forms/source/component/clickableimage.hxx
@@ -203,7 +203,7 @@ namespace frm
 
     public:
         OClickableImageBaseControl(
-            const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory,
+            const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxFactory,
             const OUString& _aService);
         virtual ~OClickableImageBaseControl();
 
diff --git a/forms/source/component/navigationbar.cxx b/forms/source/component/navigationbar.cxx
index 9d1ac5f..d7979c7 100644
--- a/forms/source/component/navigationbar.cxx
+++ b/forms/source/component/navigationbar.cxx
@@ -24,6 +24,7 @@
 
 #include <comphelper/streamsection.hxx>
 #include <comphelper/basicio.hxx>
+#include <comphelper/processfactory.hxx>
 
 //--------------------------------------------------------------------------

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list