Tag: cws_src680_oj14 User: oj Date: 06/01/03 05:18:36 Modified: /dba/dbaccess/source/ui/app/ AppControllerGen.cxx
Log: RESYNC: (1.14-1.15); FILE MERGED File Changes: Directory: /dba/dbaccess/source/ui/app/ ======================================= File [changed]: AppControllerGen.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/app/AppControllerGen.cxx?r1=1.14.4.1&r2=1.14.4.2 Delta lines: +9 -27 -------------------- --- AppControllerGen.cxx 3 Jan 2006 07:48:57 -0000 1.14.4.1 +++ AppControllerGen.cxx 3 Jan 2006 13:18:33 -0000 1.14.4.2 @@ -158,7 +158,7 @@ { try { - Reference<XConnection> xConnection = getActiveConnection(); + SharedConnection xConnection( getConnection() ); Reference<XQueriesSupplier> xSup(xConnection,UNO_QUERY); if ( xSup.is() ) { @@ -217,13 +217,7 @@ ElementType eType = getContainer()->getElementType(); if ( eType == E_TABLE ) { - Reference<XConnection> xDestConnection; - ensureConnection(xDestConnection); - - SharedConnection xConnection( xDestConnection, SharedConnection::NoTakeOwnership ); - // TODO: migrate ensureConnection to the SharedConnection-API - - m_aTableCopyHelper.pasteTable( _nFormatId, rClipboard, getDatabaseName(), xConnection); + m_aTableCopyHelper.pasteTable( _nFormatId, rClipboard, getDatabaseName(), ensureConnection() ); } else paste( eType,ODataAccessObjectTransferable::extractObjectDescriptor(rClipboard) ); @@ -249,7 +243,7 @@ ::osl::MutexGuard aGuard(m_aMutex); WaitObject aWO(getView()); - Reference<XConnection> xConnection = getActiveConnection(); + SharedConnection xConnection( getConnection() ); Sequence< Any > aArgs(xConnection.is() ? 3 : 2); Reference< ::com::sun::star::awt::XWindow> xWindow = getTopMostContainerWindow(); @@ -275,7 +269,7 @@ if ( xConnection.is() ) aArgs[2] <<= PropertyValue( PROPERTY_ACTIVECONNECTION, 0, - makeAny(xConnection), PropertyState_DIRECT_VALUE); + makeAny( xConnection ), PropertyState_DIRECT_VALUE); // create the dialog Reference< XExecutableDialog > xAdminDialog; @@ -297,16 +291,6 @@ openDialog(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.TableFilterDialog"))); } // ----------------------------------------------------------------------------- -void OApplicationController::closeConnection() -{ - if ( getContainer() ) - { - TDataSourceConnections::iterator aFind = m_aDataSourceConnections.find(getDatabaseName()); - if ( aFind != m_aDataSourceConnections.end() ) - disconnect(aFind->second); - } -} -// ----------------------------------------------------------------------------- void OApplicationController::refreshTables() { if ( getContainer() && getContainer()->getDetailView() ) @@ -325,9 +309,7 @@ } getContainer()->getDetailView()->clearPages(sal_False); - Reference<XConnection> xConnection; - ensureConnection(xConnection); - getContainer()->getDetailView()->createTablesPage(xConnection); + getContainer()->getDetailView()->createTablesPage( ensureConnection() ); } } // ----------------------------------------------------------------------------- @@ -435,7 +417,7 @@ if ( bClear ) { ElementType eType = getContainer()->getElementType(); - clearConnections(); + disconnect(); getContainer()->getDetailView()->clearPages(sal_False); getContainer()->changeContainer(E_NONE); // invalidate the old selection getContainer()->changeContainer(eType); // reselect the current one again --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
