diff options
author | Noel Grandin <noel@peralex.com> | 2012-11-27 11:45:21 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-11-28 13:06:18 +0100 |
commit | 38cc919efb965e7982d23d5b1c91a639cc2c6fdd (patch) | |
tree | 3586b24e5d14c7612dae8da02cdd04ad7b2ec112 /extensions | |
parent | 7470cc532fe408dc9d8735cde0e2eb5bb62fd69c (diff) |
fdo#46808, use service constructor for sdbc::ConnectionPool
Change-Id: Id12226af5e537b1eeacbb062ad937a3551e245c0
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/source/dbpilots/controlwizard.cxx | 14 | ||||
-rw-r--r-- | extensions/source/dbpilots/controlwizard.hxx | 12 | ||||
-rw-r--r-- | extensions/source/dbpilots/gridwizard.cxx | 4 | ||||
-rw-r--r-- | extensions/source/dbpilots/gridwizard.hxx | 2 | ||||
-rw-r--r-- | extensions/source/dbpilots/groupboxwiz.cxx | 6 | ||||
-rw-r--r-- | extensions/source/dbpilots/groupboxwiz.hxx | 2 | ||||
-rw-r--r-- | extensions/source/dbpilots/listcombowizard.cxx | 4 | ||||
-rw-r--r-- | extensions/source/dbpilots/listcombowizard.hxx | 2 | ||||
-rw-r--r-- | extensions/source/dbpilots/unoautopilot.inl | 2 | ||||
-rw-r--r-- | extensions/source/propctrlr/formcomponenthandler.cxx | 4 | ||||
-rw-r--r-- | extensions/source/propctrlr/formlinkdialog.cxx | 5 |
11 files changed, 27 insertions, 30 deletions
diff --git a/extensions/source/dbpilots/controlwizard.cxx b/extensions/source/dbpilots/controlwizard.cxx index fa0eb717f569..3c486324795b 100644 --- a/extensions/source/dbpilots/controlwizard.cxx +++ b/extensions/source/dbpilots/controlwizard.cxx @@ -273,9 +273,9 @@ namespace dbp //===================================================================== //--------------------------------------------------------------------- OControlWizard::OControlWizard( Window* _pParent, const ResId& _rId, - const Reference< XPropertySet >& _rxObjectModel, const Reference< XMultiServiceFactory >& _rxORB ) + const Reference< XPropertySet >& _rxObjectModel, const Reference< XComponentContext >& _rxContext ) :OWizardMachine(_pParent, _rId, WZB_CANCEL | WZB_PREVIOUS | WZB_NEXT | WZB_FINISH) - ,m_xORB(_rxORB) + ,m_xContext(_rxContext) { m_aContext.xObjectModel = _rxObjectModel; initContext(); @@ -433,13 +433,11 @@ namespace dbp //--------------------------------------------------------------------- void OControlWizard::implGetDSContext() { - Reference< XMultiServiceFactory > xORB = getServiceFactory(); try { - DBG_ASSERT(xORB.is(), "OControlWizard::implGetDSContext: invalid service factory!"); + DBG_ASSERT(m_xContext.is(), "OControlWizard::implGetDSContext: invalid service factory!"); - m_aContext.xDatasourceContext = - DatabaseContext::create(comphelper::getComponentContext(xORB)); + m_aContext.xDatasourceContext = DatabaseContext::create(m_xContext); } catch(const Exception&) { @@ -509,7 +507,7 @@ namespace dbp Reference< XInteractionHandler > xHandler; try { - xHandler = Reference< XInteractionHandler >( InteractionHandler::createWithParent(comphelper::getComponentContext(getServiceFactory()), 0), UNO_QUERY_THROW ); + xHandler = Reference< XInteractionHandler >( InteractionHandler::createWithParent(m_xContext, 0), UNO_QUERY_THROW ); } catch(const Exception&) { } if (!xHandler.is()) @@ -567,7 +565,7 @@ namespace dbp Reference< XConnection > xConnection; m_aContext.bEmbedded = ::dbtools::isEmbeddedInDatabase( m_aContext.xForm, xConnection ); if ( !m_aContext.bEmbedded ) - xConnection = ::dbtools::connectRowset( m_aContext.xRowSet, getServiceFactory(), sal_True ); + xConnection = ::dbtools::connectRowset( m_aContext.xRowSet, m_xContext, sal_True ); // get the fields if (xConnection.is()) diff --git a/extensions/source/dbpilots/controlwizard.hxx b/extensions/source/dbpilots/controlwizard.hxx index dbb4748e2144..c6b97bd1d7a8 100644 --- a/extensions/source/dbpilots/controlwizard.hxx +++ b/extensions/source/dbpilots/controlwizard.hxx @@ -106,17 +106,15 @@ namespace dbp { private: OControlWizardContext m_aContext; - - protected: - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > - m_xORB; + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > + m_xContext; public: OControlWizard( Window* _pParent, const ResId& _rId, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxObjectModel, - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext ); ~OControlWizard(); @@ -124,8 +122,8 @@ namespace dbp sal_Bool travelNext() { return OControlWizard_Base::travelNext(); } public: - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > - getServiceFactory() const { return m_xORB; } + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > + getComponentContext() const { return m_xContext; } const OControlWizardContext& getContext() const { return m_aContext; } sal_Bool updateContext(const OAccessRegulator&); diff --git a/extensions/source/dbpilots/gridwizard.cxx b/extensions/source/dbpilots/gridwizard.cxx index ece4e1d03865..dcb73bb3260b 100644 --- a/extensions/source/dbpilots/gridwizard.cxx +++ b/extensions/source/dbpilots/gridwizard.cxx @@ -51,8 +51,8 @@ namespace dbp //===================================================================== //--------------------------------------------------------------------- OGridWizard::OGridWizard( Window* _pParent, - const Reference< XPropertySet >& _rxObjectModel, const Reference< XMultiServiceFactory >& _rxORB ) - :OControlWizard(_pParent, ModuleRes(RID_DLG_GRIDWIZARD), _rxObjectModel, _rxORB) + const Reference< XPropertySet >& _rxObjectModel, const Reference< XComponentContext >& _rxContext ) + :OControlWizard(_pParent, ModuleRes(RID_DLG_GRIDWIZARD), _rxObjectModel, _rxContext) ,m_bHadDataSelection(sal_True) { initControlSettings(&m_aSettings); diff --git a/extensions/source/dbpilots/gridwizard.hxx b/extensions/source/dbpilots/gridwizard.hxx index 43b2aa3e45ec..b837e3da4989 100644 --- a/extensions/source/dbpilots/gridwizard.hxx +++ b/extensions/source/dbpilots/gridwizard.hxx @@ -49,7 +49,7 @@ namespace dbp OGridWizard( Window* _pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxObjectModel, - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext ); OGridSettings& getSettings() { return m_aSettings; } diff --git a/extensions/source/dbpilots/groupboxwiz.cxx b/extensions/source/dbpilots/groupboxwiz.cxx index a814272050d4..904c1c1c2ec1 100644 --- a/extensions/source/dbpilots/groupboxwiz.cxx +++ b/extensions/source/dbpilots/groupboxwiz.cxx @@ -48,8 +48,8 @@ namespace dbp //===================================================================== //--------------------------------------------------------------------- OGroupBoxWizard::OGroupBoxWizard( Window* _pParent, - const Reference< XPropertySet >& _rxObjectModel, const Reference< XMultiServiceFactory >& _rxORB ) - :OControlWizard(_pParent, ModuleRes(RID_DLG_GROUPBOXWIZARD), _rxObjectModel, _rxORB) + const Reference< XPropertySet >& _rxObjectModel, const Reference< XComponentContext >& _rxContext ) + :OControlWizard(_pParent, ModuleRes(RID_DLG_GROUPBOXWIZARD), _rxObjectModel, _rxContext) ,m_bVisitedDefault(sal_False) ,m_bVisitedDB(sal_False) { @@ -160,7 +160,7 @@ namespace dbp { try { - OOptionGroupLayouter aLayouter(comphelper::getComponentContext(getServiceFactory())); + OOptionGroupLayouter aLayouter( getComponentContext() ); aLayouter.doLayout(getContext(), getSettings()); } catch(const Exception&) diff --git a/extensions/source/dbpilots/groupboxwiz.hxx b/extensions/source/dbpilots/groupboxwiz.hxx index e7e082412f1a..026e39e7ea4b 100644 --- a/extensions/source/dbpilots/groupboxwiz.hxx +++ b/extensions/source/dbpilots/groupboxwiz.hxx @@ -55,7 +55,7 @@ namespace dbp OGroupBoxWizard( Window* _pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxObjectModel, - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext ); OOptionGroupSettings& getSettings() { return m_aSettings; } diff --git a/extensions/source/dbpilots/listcombowizard.cxx b/extensions/source/dbpilots/listcombowizard.cxx index f25c3653a45d..08e365807d95 100644 --- a/extensions/source/dbpilots/listcombowizard.cxx +++ b/extensions/source/dbpilots/listcombowizard.cxx @@ -50,8 +50,8 @@ namespace dbp //===================================================================== //--------------------------------------------------------------------- OListComboWizard::OListComboWizard( Window* _pParent, - const Reference< XPropertySet >& _rxObjectModel, const Reference< XMultiServiceFactory >& _rxORB ) - :OControlWizard(_pParent, ModuleRes(RID_DLG_LISTCOMBOWIZARD), _rxObjectModel, _rxORB) + const Reference< XPropertySet >& _rxObjectModel, const Reference< XComponentContext >& _rxContext ) + :OControlWizard(_pParent, ModuleRes(RID_DLG_LISTCOMBOWIZARD), _rxObjectModel, _rxContext) ,m_bListBox(sal_False) ,m_bHadDataSelection(sal_True) { diff --git a/extensions/source/dbpilots/listcombowizard.hxx b/extensions/source/dbpilots/listcombowizard.hxx index d312d2857bbc..8c9fc3ac0268 100644 --- a/extensions/source/dbpilots/listcombowizard.hxx +++ b/extensions/source/dbpilots/listcombowizard.hxx @@ -59,7 +59,7 @@ namespace dbp OListComboWizard( Window* _pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxObjectModel, - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext ); OListComboSettings& getSettings() { return m_aSettings; } diff --git a/extensions/source/dbpilots/unoautopilot.inl b/extensions/source/dbpilots/unoautopilot.inl index 035982ea9d2a..9375243425bd 100644 --- a/extensions/source/dbpilots/unoautopilot.inl +++ b/extensions/source/dbpilots/unoautopilot.inl @@ -99,7 +99,7 @@ template <class TYPE, class SERVICEINFO> template <class TYPE, class SERVICEINFO> Dialog* OUnoAutoPilot<TYPE, SERVICEINFO>::createDialog(Window* _pParent) { - return new TYPE(_pParent, m_xObjectModel, m_aContext.getLegacyServiceFactory()); + return new TYPE(_pParent, m_xObjectModel, m_aContext.getUNOContext()); } //-------------------------------------------------------------------------- diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx index 42fd503daa25..992b2d5fb927 100644 --- a/extensions/source/propctrlr/formcomponenthandler.cxx +++ b/extensions/source/propctrlr/formcomponenthandler.cxx @@ -2414,7 +2414,7 @@ namespace pcr if ( xRowSetProps.is() ) { WaitCursor aWaitCursor( impl_getDefaultDialogParent_nothrow() ); - m_xRowSetConnection = ::dbtools::ensureRowSetConnection( xRowSet, m_aContext.getLegacyServiceFactory(), false ); + m_xRowSetConnection = ::dbtools::ensureRowSetConnection( xRowSet, m_aContext.getUNOContext(), false ); } } catch ( const SQLException& ) { aError = SQLExceptionInfo( ::cppu::getCaughtException() ); } @@ -2632,7 +2632,7 @@ namespace pcr return false; // get a composer for the statement which the form is currently based on - Reference< XSingleSelectQueryComposer > xComposer( ::dbtools::getCurrentSettingsComposer( m_xComponent, m_aContext.getLegacyServiceFactory() ) ); + Reference< XSingleSelectQueryComposer > xComposer( ::dbtools::getCurrentSettingsComposer( m_xComponent, m_aContext.getUNOContext() ) ); OSL_ENSURE( xComposer.is(), "FormComponentPropertyHandler::impl_dialogFilterOrSort_nothrow: could not obtain a composer!" ); if ( !xComposer.is() ) return false; diff --git a/extensions/source/propctrlr/formlinkdialog.cxx b/extensions/source/propctrlr/formlinkdialog.cxx index ecc2c7059c4c..fadcc0afd107 100644 --- a/extensions/source/propctrlr/formlinkdialog.cxx +++ b/extensions/source/propctrlr/formlinkdialog.cxx @@ -31,6 +31,7 @@ #include <connectivity/dbtools.hxx> #include <connectivity/dbexception.hxx> #include <toolkit/helper/vclunohelper.hxx> +#include <comphelper/processfactory.hxx> #include <com/sun/star/sdbcx/XColumnsSupplier.hpp> #include <com/sun/star/sdbcx/XKeysSupplier.hpp> @@ -449,7 +450,7 @@ namespace pcr _rxConnection.set(_rxFormProps->getPropertyValue(PROPERTY_ACTIVE_CONNECTION),UNO_QUERY); if ( !_rxConnection.is() ) - _rxConnection = ::dbtools::connectRowset( Reference< XRowSet >( _rxFormProps, UNO_QUERY ), m_xORB, sal_True ); + _rxConnection = ::dbtools::connectRowset( Reference< XRowSet >( _rxFormProps, UNO_QUERY ), comphelper::getComponentContext(m_xORB), sal_True ); } //------------------------------------------------------------------------ @@ -471,7 +472,7 @@ namespace pcr Reference< XPropertySet > xTable; try { - Reference< XTablesSupplier > xTablesInForm( ::dbtools::getCurrentSettingsComposer( _rxFormProps, m_xORB ), UNO_QUERY ); + Reference< XTablesSupplier > xTablesInForm( ::dbtools::getCurrentSettingsComposer( _rxFormProps, comphelper::getComponentContext(m_xORB) ), UNO_QUERY ); Reference< XNameAccess > xTables; if ( xTablesInForm.is() ) xTables = xTablesInForm->getTables(); |