Tag: cws_src680_dba201b
User: fs      
Date: 05/07/29 03:04:32

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

Log:
 #i52603# suspend(false) if suspend(true) was successful, but closing needed to 
be cancelled for other reasons

File Changes:

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

File [changed]: documentdefinition.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/documentdefinition.cxx?r1=1.26.18.6&r2=1.26.18.7
Delta lines:  +12 -3
--------------------
--- documentdefinition.cxx      26 Jul 2005 07:51:47 -0000      1.26.18.6
+++ documentdefinition.cxx      29 Jul 2005 10:04:30 -0000      1.26.18.7
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: documentdefinition.cxx,v $
  *
- *  $Revision: 1.26.18.6 $
+ *  $Revision: 1.26.18.7 $
  *
- *  last change: $Author: fs $ $Date: 2005/07/26 07:51:47 $
+ *  last change: $Author: fs $ $Date: 2005/07/29 10:04:30 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -1351,13 +1351,22 @@
         if ( xModel.is() )
             xController = xModel->getCurrentController();
         OSL_ENSURE( xController.is(), "ODocumentDefinition::prepareClose: no 
controller!" );
-        if ( xController.is() && !xController->suspend( sal_True ) )
+        if ( !xController.is() )
+            return sal_False;
+        
+        sal_Bool bCouldSuspend = xController->suspend( sal_True );
+        if ( !bCouldSuspend )
             // controller vetoed the closing
             return false;
 
         if ( isModified() && !save( sal_True ) )
+        {
+            if ( bCouldSuspend )
+                // revert suspension
+                xController->suspend( sal_False );
             // saving failed or was cancelled
             return false;
+        }
     }
     catch( const Exception& )
     {




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

Reply via email to