User: obo Date: 2006/07/10 08:39:16 Modified: dba/dbaccess/source/ui/misc/singledoccontroller.cxx
Log: INTEGRATION: CWS qiq (1.16.118); FILE MERGED 2006/06/27 12:50:17 fs 1.16.118.4: RESYNC: (1.16-1.17); FILE MERGED 2006/06/19 09:27:52 fs 1.16.118.3: during #i51143#: A FeatureState can now transport more than one state. In particular, it has typed bChecked and sTitle members, instead of the previous unchecked aState 2006/05/19 10:53:05 fs 1.16.118.2: signature of SQLExceptionIteratorHelper ctor changed during #i51143# 2006/05/17 11:48:37 fs 1.16.118.1: SharedConnection (during #i51143#) File Changes: Directory: /dba/dbaccess/source/ui/misc/ ======================================== File [changed]: singledoccontroller.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/misc/singledoccontroller.cxx?r1=1.17&r2=1.18 Delta lines: +19 -35 --------------------- --- singledoccontroller.cxx 20 Jun 2006 03:24:31 -0000 1.17 +++ singledoccontroller.cxx 10 Jul 2006 15:39:14 -0000 1.18 @@ -149,14 +149,14 @@ OSingleDocumentController::OSingleDocumentController(const Reference< XMultiServiceFactory >& _rxORB) :OSingleDocumentController_CBASE( _rxORB ) ,OSingleDocumentController_PBASE( getBroadcastHelper() ) - ,m_bOwnConnection( sal_False ) ,m_bSuspended( sal_False ) ,m_bEditable(sal_True) ,m_bModified(sal_False) { - registerProperty( PROPERTY_ACTIVECONNECTION, PROPERTY_ID_ACTIVECONNECTION, PropertyAttribute::READONLY | PropertyAttribute::BOUND, - &m_xConnection, ::getCppuType( &m_xConnection ) ); +// registerProperty( PROPERTY_ACTIVECONNECTION, PROPERTY_ID_ACTIVECONNECTION, PropertyAttribute::READONLY | PropertyAttribute::BOUND, +// &m_xConnection, ::getCppuType( &m_xConnection ) ); + // TODO: is this still needed? } //-------------------------------------------------------------------- @@ -235,8 +235,8 @@ if ( isConnected() ) disconnect(); - m_xConnection = _rxForeignConn; - m_bOwnConnection = sal_False; + m_xConnection.reset( _rxForeignConn, SharedConnection::NoTakeOwnership ); + m_aSdbMetaData.reset( m_xConnection ); startConnectionListening( m_xConnection ); // get the data source the connection belongs to @@ -272,18 +272,9 @@ OSL_ENSURE(!m_bSuspended, "Cannot reconnect while suspended!"); OConnectionChangeBroadcaster( this ); - stopConnectionListening(m_xConnection); - if ( m_bOwnConnection ) - { - try - { - ::comphelper::disposeComponent( m_xConnection ); - } - catch( const Exception& ) { /* allowed: if we reconnect because the old connection has been disposed .... */ } - } - m_xConnection = NULL; - m_bOwnConnection = sal_False; - + stopConnectionListening( m_xConnection ); + m_aSdbMetaData.reset( NULL ); + m_xConnection.clear(); // reconnect sal_Bool bReConnect = sal_True; @@ -296,8 +287,8 @@ // now really reconnect ... if ( bReConnect ) { - m_xConnection = connect( Reference<XDataSource>(m_xDataSource,UNO_QUERY), sal_True ); - m_bOwnConnection = m_xConnection.is(); + m_xConnection.reset( connect( Reference<XDataSource>(m_xDataSource,UNO_QUERY), sal_True ), SharedConnection::TakeOwnership ); + m_aSdbMetaData.reset( m_xConnection ); } // invalidate all slots @@ -310,16 +301,8 @@ OConnectionChangeBroadcaster( this ); stopConnectionListening(m_xConnection); - try - { - if ( m_bOwnConnection ) - ::comphelper::disposeComponent( m_xConnection ); - } - catch(const Exception&) - { - } - m_xConnection = NULL; - m_bOwnConnection = sal_False; + m_aSdbMetaData.reset( NULL ); + m_xConnection.clear(); InvalidateAll(); } @@ -372,7 +355,8 @@ } else { - m_bOwnConnection = sal_False; // this prevents the "disposeComponent" call in disconnect + m_xConnection.reset( m_xConnection, SharedConnection::NoTakeOwnership ); + // this prevents the "disposeComponent" call in disconnect disconnect(); } } @@ -394,7 +378,7 @@ DBG_ASSERT(::dbtools::SQLExceptionInfo(_rChainLeft).isValid(), "concatSQLExceptions: invalid warnings chain (this will crash)!"); const SQLException* pChainTravel = static_cast<const SQLException*>(_rChainLeft.getValue()); - ::dbtools::SQLExceptionIteratorHelper aReferenceIterHelper(pChainTravel); + ::dbtools::SQLExceptionIteratorHelper aReferenceIterHelper(*pChainTravel); while (aReferenceIterHelper.hasMoreElements()) pChainTravel = aReferenceIterHelper.next(); @@ -460,7 +444,7 @@ String sUndo(ModuleRes(STR_UNDO_COLON)); sUndo += String(RTL_CONSTASCII_USTRINGPARAM(" ")); sUndo += m_aUndoManager.GetUndoActionComment(); - aReturn.aState <<= ::rtl::OUString(sUndo); + aReturn.sTitle = sUndo; } break; case ID_BROWSER_REDO: @@ -470,7 +454,7 @@ String sRedo(ModuleRes(STR_REDO_COLON)); sRedo += String(RTL_CONSTASCII_USTRINGPARAM(" ")); sRedo += m_aUndoManager.GetRedoActionComment(); - aReturn.aState <<= ::rtl::OUString(sRedo); + aReturn.sTitle = sRedo; } break; default: --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
