Tag: cws_src680_dba203a
User: fs      
Date: 06/03/16 01:53:44

Modified:
 /dba/dbaccess/source/core/dataaccess/
  databasedocument.cxx

Log:
 #i63162# upon closing the last view, close the document automatically

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.25.12.1&r2=1.25.12.2
Delta lines:  +18 -7
--------------------
--- databasedocument.cxx        17 Feb 2006 12:40:43 -0000      1.25.12.1
+++ databasedocument.cxx        16 Mar 2006 09:53:40 -0000      1.25.12.2
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: databasedocument.cxx,v $
  *
- *  $Revision: 1.25.12.1 $
+ *  $Revision: 1.25.12.2 $
  *
- *  last change: $Author: fs $ $Date: 2006/02/17 12:40:43 $
+ *  last change: $Author: fs $ $Date: 2006/03/16 09:53:40 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -358,6 +358,20 @@
     
m_pImpl->m_aControllers.erase(::std::find(m_pImpl->m_aControllers.begin(),m_pImpl->m_aControllers.end(),_xController));
        if ( m_pImpl->m_xCurrentController == _xController )
                m_pImpl->m_xCurrentController = NULL;
+
+    if ( m_pImpl->m_aControllers.empty() )
+    {
+        // if this was the last view, close the document as a whole
+        // #i51157# / 2006-03-16 / [EMAIL PROTECTED]
+        try
+        {
+            close( sal_True );
+        }
+        catch( const CloseVetoException& )
+        {
+            // okay, somebody vetoed and took ownership
+        }
+    }
 }
 // 
-----------------------------------------------------------------------------
 void SAL_CALL ODatabaseDocument::lockControllers(  ) throw (RuntimeException)
@@ -459,9 +473,7 @@
        if ( m_pImpl->m_bDocumentReadOnly )
                throw IOException();
 
-    m_bCommitMasterStorage = sal_False;
     m_pImpl->commitStorages();
-    m_bCommitMasterStorage = sal_True;
 
        Reference<XStorage> xMyStorage = m_pImpl->getStorage();
     OSL_ENSURE( xMyStorage.is(), "ODatabaseDocument::storeToURL: no own 
storage?" );
@@ -783,7 +795,6 @@
         aGuard.reset();
     }
 
-    DBG_ASSERT( m_pImpl->m_aControllers.empty(), "ODatabaseDocument::close: 
aren't controllers expected to veto the closing?" );
     impl_closeControllerFrames( _bDeliverOwnership );
 
     {
@@ -1092,8 +1103,8 @@
     }
 
     DBG_ASSERT( m_pImpl->m_aControllers.empty(), 
"ODatabaseDocument::disposing: there still are controllers!" );
-        // normally, nobody should explicitly dispose, but only 
XCloseable::close the document. And controllers
-        // are expected to veto the closing, so when we're here, there 
shouldn't be any controllers anymore.
+        // normally, nobody should explicitly dispose, but only 
XCloseable::close the document.An upon
+        // closing, our controllers are closed, too
     m_pImpl->m_aControllers.clear();
 
     Reference< XModel > xHoldAlive( this );




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

Reply via email to