diff options
author | Frank Schönheit <fs@openoffice.org> | 2001-11-08 09:48:16 +0000 |
---|---|---|
committer | Frank Schönheit <fs@openoffice.org> | 2001-11-08 09:48:16 +0000 |
commit | 1c71c18c156b0f4b41e1195e2c26af89907fb00c (patch) | |
tree | ce8820dc4d38d6a0df554e2edbefda68a75188be /extensions/source | |
parent | aea93141f3a8db5a5600d835f98333baa87424ea (diff) |
#94407# setFormConnection allows to be called without auto disposing
Diffstat (limited to 'extensions/source')
-rw-r--r-- | extensions/source/dbpilots/controlwizard.cxx | 28 | ||||
-rw-r--r-- | extensions/source/dbpilots/controlwizard.hxx | 11 |
2 files changed, 26 insertions, 13 deletions
diff --git a/extensions/source/dbpilots/controlwizard.cxx b/extensions/source/dbpilots/controlwizard.cxx index dc413cd1120e..45d4ba257f5e 100644 --- a/extensions/source/dbpilots/controlwizard.cxx +++ b/extensions/source/dbpilots/controlwizard.cxx @@ -2,9 +2,9 @@ * * $RCSfile: controlwizard.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: fs $ $Date: 2001-11-02 14:42:19 $ + * last change: $Author: fs $ $Date: 2001-11-08 10:48:16 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -215,9 +215,9 @@ namespace dbp } //--------------------------------------------------------------------- - void OControlWizardPage::setFormConnection(const Reference< XConnection >& _rxConn) + void OControlWizardPage::setFormConnection( const Reference< XConnection >& _rxConn, sal_Bool _bAutoDispose ) { - getDialog()->setFormConnection(OAccessRegulator(), _rxConn); + getDialog()->setFormConnection( OAccessRegulator(), _rxConn, _bAutoDispose ); } //--------------------------------------------------------------------- @@ -542,7 +542,7 @@ namespace dbp } //--------------------------------------------------------------------- - void OControlWizard::setFormConnection(const OAccessRegulator& _rAccess, const Reference< XConnection >& _rxConn) + void OControlWizard::setFormConnection( const OAccessRegulator& _rAccess, const Reference< XConnection >& _rxConn, sal_Bool _bAutoDispose ) { try { @@ -553,10 +553,17 @@ namespace dbp disposeComponent(xOldConn); // set the new connection - // for this, use a AutoDisposer (so the conn is cleaned up when the form dies or get's another connection) - Reference< XRowSet > xFormRowSet( m_aContext.xForm, UNO_QUERY ); - OAutoConnectionDisposer* pAutoDispose = new OAutoConnectionDisposer( xFormRowSet, _rxConn ); - Reference< XPropertyChangeListener > xEnsureDelete( pAutoDispose ); + if ( _bAutoDispose ) + { + // for this, use a AutoDisposer (so the conn is cleaned up when the form dies or get's another connection) + Reference< XRowSet > xFormRowSet( m_aContext.xForm, UNO_QUERY ); + OAutoConnectionDisposer* pAutoDispose = new OAutoConnectionDisposer( xFormRowSet, _rxConn ); + Reference< XPropertyChangeListener > xEnsureDelete( pAutoDispose ); + } + else + { + m_aContext.xForm->setPropertyValue( ::rtl::OUString::createFromAscii("ActiveConnection"), makeAny( _rxConn ) ); + } } catch(const Exception&) { @@ -808,6 +815,9 @@ namespace dbp /************************************************************************* * history: * $Log: not supported by cvs2svn $ + * Revision 1.7 2001/11/02 14:42:19 fs + * #94077# use an AutoDisposer when setting a Connection on the RowSet + * * Revision 1.6 2001/05/30 16:46:47 fs * #86714# functionality for displaying the form data source in a wizard page * diff --git a/extensions/source/dbpilots/controlwizard.hxx b/extensions/source/dbpilots/controlwizard.hxx index d2830f45b70f..4d998bf69b5c 100644 --- a/extensions/source/dbpilots/controlwizard.hxx +++ b/extensions/source/dbpilots/controlwizard.hxx @@ -2,9 +2,9 @@ * * $RCSfile: controlwizard.hxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: fs $ $Date: 2001-05-30 16:46:47 $ + * last change: $Author: fs $ $Date: 2001-11-08 10:48:16 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -139,7 +139,7 @@ namespace dbp getServiceFactory(); const OControlWizardContext& getContext(); sal_Bool updateContext(); - void setFormConnection(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConn); + void setFormConnection(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConn, sal_Bool _bAutoDispose = sal_True ); ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > getFormConnection() const; @@ -198,7 +198,7 @@ namespace dbp const OControlWizardContext& getContext() const { return m_aContext; } sal_Bool updateContext(const OAccessRegulator&); - void setFormConnection(const OAccessRegulator&, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConn); + void setFormConnection(const OAccessRegulator&, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConn, sal_Bool _bAutoDispose = sal_True ); ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > getFormConnection(const OAccessRegulator&) const; @@ -237,6 +237,9 @@ namespace dbp /************************************************************************* * history: * $Log: not supported by cvs2svn $ + * Revision 1.6 2001/05/30 16:46:47 fs + * #86714# functionality for displaying the form data source in a wizard page + * * Revision 1.5 2001/04/03 12:42:48 fs * #85223# get-/setFormConnection * |