Tag: cws_src680_oj14
User: oj      
Date: 06/01/03 05:19:35

Modified:
 /dba/dbaccess/source/ui/browser/
  unodatbr.cxx

Log:
 RESYNC: (1.172-1.173); FILE MERGED

File Changes:

Directory: /dba/dbaccess/source/ui/browser/
===========================================

File [changed]: unodatbr.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/browser/unodatbr.cxx?r1=1.172.4.1&r2=1.172.4.2
Delta lines:  +42 -17
---------------------
--- unodatbr.cxx        3 Jan 2006 07:49:02 -0000       1.172.4.1
+++ unodatbr.cxx        3 Jan 2006 13:19:32 -0000       1.172.4.2
@@ -90,6 +90,9 @@
 #ifndef _COM_SUN_STAR_FRAME_XLAYOUTMANAGER_HPP_
 #include <com/sun/star/frame/XLayoutManager.hpp>
 #endif
+#ifndef _COM_SUN_STAR_UTIL_XFLUSHABLE_HPP_
+#include <com/sun/star/util/XFlushable.hpp>
+#endif
 #ifndef _URLOBJ_HXX //autogen
 #include <tools/urlobj.hxx>
 #endif
@@ -2874,6 +2877,41 @@
 }
 
 // -------------------------------------------------------------------------
+void SbaTableQueryBrowser::impl_releaseConnection( SharedConnection& 
_rxConnection )
+{
+       // remove as event listener
+       Reference< XComponent > xComponent( _rxConnection, UNO_QUERY );
+       if ( xComponent.is() )
+       {
+               Reference< XEventListener > xListener( static_cast< 
::cppu::OWeakObject* >( this ), UNO_QUERY );
+               xComponent->removeEventListener( xListener );
+       }
+
+    try
+    {
+        // temporary (hopefully!) hack for #i55274#
+        Reference< XFlushable > xFlush( _rxConnection, UNO_QUERY );
+        if ( xFlush.is() )
+            xFlush->flush();
+    }
+    catch( const Exception& e )
+    {
+    #if OSL_DEBUG_LEVEL > 0
+        ::rtl::OString sMessage( 
"SbaTableQueryBrowser::impl_releaseConnection: caught an exception!\n" );
+        sMessage += "message:\n";
+        sMessage += ::rtl::OString( e.Message.getStr(), e.Message.getLength(), 
osl_getThreadTextEncoding() );
+        OSL_ENSURE( false, sMessage );
+    #else
+        e; // make compiler happy
+    #endif
+    }
+
+       // clear
+       _rxConnection.clear();
+        // will implicitly dispose if we have the ownership, since xConnection 
is a SharedConnection
+}
+
+// -------------------------------------------------------------------------
 void SbaTableQueryBrowser::disposeConnection( SvLBoxEntry* _pDSEntry )
 {
        DBG_ASSERT( _pDSEntry, "SbaTableQueryBrowser::disposeConnection: 
invalid entry (NULL)!" );
@@ -2884,25 +2922,12 @@
                DBTreeListModel::DBTreeListUserData* pTreeListData = 
static_cast< DBTreeListModel::DBTreeListUserData* >( _pDSEntry->GetUserData() );
                if ( pTreeListData )
                {
-                       // remove as event listener
-                       Reference< XComponent > xComponent( 
pTreeListData->xConnection, UNO_QUERY );
-                       if ( xComponent.is() )
-                       {
-                               Reference< XEventListener > xListener( 
static_cast< ::cppu::OWeakObject* >( this ), UNO_QUERY );
-                               xComponent->removeEventListener( xListener );
-                       }
-
-                       // dispose
-            pTreeListData->xConnection.clear();
-                // will implicitly dispose, since xConnection is a 
SharedConnection
+            impl_releaseConnection( pTreeListData->xConnection );
 
             // release the model-controller-connection
             DBG_ASSERT( !pTreeListData->aController.empty(),
                 "SbaTableQueryBrowser::disposeConnection: there's a 
connection, but we didn't register ourself as controller at the model?!" );
             pTreeListData->aController.clear();
-
-                       // clear
-                       pTreeListData->xConnection.clear();
                }
        }
 }




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to