User: rt      
Date: 05/10/24 01:30:47

Modified:
 /dba/dbaccess/source/ui/app/
  AppControllerGen.cxx

Log:
 INTEGRATION: CWS dba201d (1.14.2); FILE MERGED
 2005/10/05 10:22:15 fs 1.14.2.1: #i55493# flush the connection before 
disconnecting, if possible / no code multiple connections anymore (dead code)

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&r2=1.15
Delta lines:  +6 -24
--------------------
--- AppControllerGen.cxx        23 Sep 2005 12:15:14 -0000      1.14
+++ AppControllerGen.cxx        24 Oct 2005 08:30:44 -0000      1.15
@@ -155,7 +155,7 @@
 {
        try
        {
-               Reference<XConnection> xConnection = getActiveConnection();
+               SharedConnection xConnection( getConnection() );
                Reference<XQueriesSupplier> xSup(xConnection,UNO_QUERY);
                if ( xSup.is() )
                {
@@ -214,13 +214,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) );
@@ -246,7 +240,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();
@@ -272,7 +266,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;
@@ -294,16 +288,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() )
@@ -322,9 +306,7 @@
                }
 
                getContainer()->getDetailView()->clearPages(sal_False);
-               Reference<XConnection> xConnection;
-               ensureConnection(xConnection);
-               getContainer()->getDetailView()->createTablesPage(xConnection);
+               getContainer()->getDetailView()->createTablesPage( 
ensureConnection() );
        }
 }
 // 
-----------------------------------------------------------------------------
@@ -432,7 +414,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]

Reply via email to