From d926caff4b6b96185c3deaa0ec548d0ed84af3d9 Mon Sep 17 00:00:00 2001 From: srn Date: Wed, 13 Jul 2005 04:44:38 +0000 Subject: [PATCH] IPAL BugID9021, modified method closeDocument, added a boolean argument "permanently" --- src/CAM/CAM_Study.cxx | 4 ++-- src/CAM/CAM_Study.h | 2 +- src/SUIT/SUIT_Study.cxx | 2 +- src/SUIT/SUIT_Study.h | 2 +- src/SalomeApp/SalomeApp_Study.cxx | 6 +++--- src/SalomeApp/SalomeApp_Study.h | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/CAM/CAM_Study.cxx b/src/CAM/CAM_Study.cxx index cdf05adc8..95a566fbb 100755 --- a/src/CAM/CAM_Study.cxx +++ b/src/CAM/CAM_Study.cxx @@ -14,12 +14,12 @@ CAM_Study::~CAM_Study() { } -void CAM_Study::closeDocument() +void CAM_Study::closeDocument(bool permanently) { for ( ModelListIterator it( myDataModels ); it.current(); ++it ) it.current()->close(); - SUIT_Study::closeDocument(); + SUIT_Study::closeDocument(permanently); } bool CAM_Study::appendDataModel( const CAM_DataModel* dm ) diff --git a/src/CAM/CAM_Study.h b/src/CAM/CAM_Study.h index b8c894f69..57e07a031 100755 --- a/src/CAM/CAM_Study.h +++ b/src/CAM/CAM_Study.h @@ -25,7 +25,7 @@ public: CAM_Study( SUIT_Application* ); virtual ~CAM_Study(); - virtual void closeDocument(); + virtual void closeDocument(bool permanently = true); bool appendDataModel( const CAM_DataModel* ); virtual bool insertDataModel( const CAM_DataModel*, const int = -1 ); diff --git a/src/SUIT/SUIT_Study.cxx b/src/SUIT/SUIT_Study.cxx index 099d24393..61ca4f5f9 100755 --- a/src/SUIT/SUIT_Study.cxx +++ b/src/SUIT/SUIT_Study.cxx @@ -62,7 +62,7 @@ bool SUIT_Study::isModified() const return myIsModified; } -void SUIT_Study::closeDocument() +void SUIT_Study::closeDocument(bool permanently) { } diff --git a/src/SUIT/SUIT_Study.h b/src/SUIT/SUIT_Study.h index 56582caf7..58d311eea 100755 --- a/src/SUIT/SUIT_Study.h +++ b/src/SUIT/SUIT_Study.h @@ -32,7 +32,7 @@ public: virtual bool isSaved() const; virtual bool isModified() const; - virtual void closeDocument(); + virtual void closeDocument(bool permanently = true); virtual void createDocument(); virtual bool openDocument( const QString& ); diff --git a/src/SalomeApp/SalomeApp_Study.cxx b/src/SalomeApp/SalomeApp_Study.cxx index d452ebc5f..8b6f90193 100644 --- a/src/SalomeApp/SalomeApp_Study.cxx +++ b/src/SalomeApp/SalomeApp_Study.cxx @@ -180,7 +180,7 @@ void SalomeApp_Study::saveDocument() // Function : closeDocument // Purpose : //================================================================ -void SalomeApp_Study::closeDocument() +void SalomeApp_Study::closeDocument(bool permanently) { // Inform everybody that this study is going to close when it's most safe to, // i.e. in the very beginning @@ -190,12 +190,12 @@ void SalomeApp_Study::closeDocument() _PTR(Study) studyPtr = studyDS(); if ( studyPtr ) { - SalomeApp_Application::studyMgr()->Close( studyPtr ); + if(permanently) SalomeApp_Application::studyMgr()->Close( studyPtr ); SALOMEDSClient_Study* aStudy = 0; setStudyDS( _PTR(Study)(aStudy) ); } - CAM_Study::closeDocument(); + CAM_Study::closeDocument(permanently); } //================================================================ diff --git a/src/SalomeApp/SalomeApp_Study.h b/src/SalomeApp/SalomeApp_Study.h index 4e2a9b336..0d5c3cd79 100644 --- a/src/SalomeApp/SalomeApp_Study.h +++ b/src/SalomeApp/SalomeApp_Study.h @@ -28,7 +28,7 @@ public: virtual void saveDocument(); virtual bool saveDocumentAs( const QString& ); - virtual void closeDocument(); + virtual void closeDocument(bool permanently = true); virtual bool isSaved() const; virtual bool isModified() const; -- 2.39.2