Tag: cws_dev300_odbmacros3
User: fs      
Date: 2008-07-29 20:19:31+0000
Modified:
   dba/dbaccess/source/core/dataaccess/databasedocument.cxx

Log:
 +OnViewClosed event

File Changes:

Directory: /dba/dbaccess/source/core/dataaccess/
================================================

File [changed]: databasedocument.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/databasedocument.cxx?r1=1.40.6.15&r2=1.40.6.16
Delta lines:  +17 -8
--------------------
--- databasedocument.cxx        2008-07-29 13:31:06+0000        1.40.6.15
+++ databasedocument.cxx        2008-07-29 20:19:28+0000        1.40.6.16
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: databasedocument.cxx,v $
- * $Revision: 1.40.6.15 $
+ * $Revision: 1.40.6.16 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -497,7 +497,10 @@
     Controllers::iterator pos = ::std::find( m_aControllers.begin(), 
m_aControllers.end(), _xController );
     OSL_ENSURE( pos != m_aControllers.end(), 
"ODatabaseDocument::disconnectController: don't know this controller!" );
     if ( pos != m_aControllers.end() )
+    {
         m_aControllers.erase( pos );
+        m_aEventNotifier.notifyDocumentEventAsync( "OnViewClosed", Reference< 
XController2 >( _xController, UNO_QUERY ) );
+    }
 
        if ( m_xCurrentController == _xController )
                m_xCurrentController = NULL;
@@ -883,17 +886,23 @@
 }
 
 // 
-----------------------------------------------------------------------------
-void SAL_CALL ODatabaseDocument::fireDocumentEvent( const ::rtl::OUString& 
_EventName, const Reference< XController2 >& _ViewController, const Any& 
_Supplement ) throw (IllegalArgumentException, RuntimeException)
+void SAL_CALL ODatabaseDocument::notifyDocumentEvent( const ::rtl::OUString& 
_EventName, const Reference< XController2 >& _ViewController, const Any& 
_Supplement ) throw (IllegalArgumentException, RuntimeException)
 {
+    if ( !_EventName.getLength() )
+        throw IllegalArgumentException( ::rtl::OUString(), *this, 1 );
+
+    // SYNCHRONIZED ->
     DocumentGuard aGuard( *this );
 
-    if ( _EventName.getLength() )
-        throw IllegalArgumentException( ::rtl::OUString(), *this, 1 );
+    if ( !DocumentEvents::needsSynchronousNotification( _EventName ) )
+    {
+        m_aEventNotifier.notifyDocumentEventAsync( _EventName, 
_ViewController, _Supplement );
+        return;
+    }
+    aGuard.clear();
+    // <- SYNCHRONIZED
 
-    if ( DocumentEvents::needsSynchronousNotification( _EventName ) )
         m_aEventNotifier.notifyDocumentEvent( _EventName, _ViewController, 
_Supplement );
-    else
-        m_aEventNotifier.notifyDocumentEventAsync( _EventName, 
_ViewController, _Supplement );
 }
 
 // 
-----------------------------------------------------------------------------




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

Reply via email to