From 256da2892a4d6a9cf43429b96fc612b6db29ae6e Mon Sep 17 00:00:00 2001 From: asl Date: Thu, 10 Dec 2009 11:54:11 +0000 Subject: [PATCH] The dump() and save() should work with complete list of parameters, but GUI should not show anonymous ones --- src/Notebook/SALOME_Notebook.cxx | 11 ++++++----- src/Notebook/SALOME_Notebook.hxx | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Notebook/SALOME_Notebook.cxx b/src/Notebook/SALOME_Notebook.cxx index 7886e835c..42074647c 100644 --- a/src/Notebook/SALOME_Notebook.cxx +++ b/src/Notebook/SALOME_Notebook.cxx @@ -544,14 +544,15 @@ private: int myId; }; -std::list SALOME_Notebook::GetParameters() const +std::list SALOME_Notebook::Parameters( bool theWithAnonymous ) const { std::list aParams; std::map< std::string, SALOME_Parameter* >::const_iterator it = myParameters.begin(), last = myParameters.end(); for( ; it!=last; it++ ) { ParameterRank aRank( it->second ); - if( !it->second->IsAnonymous() && find( aParams.begin(), aParams.end(), aRank ) == aParams.end() ) + if( ( theWithAnonymous || !it->second->IsAnonymous() ) && + find( aParams.begin(), aParams.end(), aRank ) == aParams.end() ) aParams.push_back( aRank ); } aParams.sort(); @@ -568,7 +569,7 @@ SALOME::StringArray* SALOME_Notebook::Parameters() { //Utils_Locker lock( &myMutex ); - return GenerateList( GetParameters() ); + return GenerateList( Parameters( false ) ); } SALOME::StringArray* SALOME_Notebook::AbsentParameters( const char* theExpr ) @@ -800,7 +801,7 @@ CORBA::Boolean SALOME_Notebook::Save( const char* theFileName ) //2. Save parameters save( aFile, "parameters" ); - std::list aNames = GetParameters(); + std::list aNames = Parameters( true ); std::list::const_iterator pit = aNames.begin(), plast = aNames.end(); for( ; pit!=plast; pit++ ) myParameters[*pit]->Save( aFile ); @@ -1045,7 +1046,7 @@ char* SALOME_Notebook::Dump() //2. Parameters aStr += "Parameters:\n"; - std::list aNames = GetParameters(); + std::list aNames = Parameters( true ); std::list::const_iterator pit = aNames.begin(), plast = aNames.end(); for( ; pit!=plast; pit++ ) { diff --git a/src/Notebook/SALOME_Notebook.hxx b/src/Notebook/SALOME_Notebook.hxx index 5a8bd6871..b69b5c0fa 100644 --- a/src/Notebook/SALOME_Notebook.hxx +++ b/src/Notebook/SALOME_Notebook.hxx @@ -104,7 +104,7 @@ private: SALOME::ParameterizedObject_ptr FindObject( const std::string& theKey ) const; void ThrowError( const std::string& theErrorMsg ) const; bool CanUpdate( SALOME::ParameterizedObject_ptr theObj ) const; - std::list GetParameters() const; + std::list Parameters( bool theWithAnonymous ) const; private: class KeyHelper -- 2.39.2