From: eap Date: Fri, 29 Mar 2013 13:34:37 +0000 (+0000) Subject: 0051789: TC7.2.0: NoteBook cannot update study X-Git-Tag: pluginMGCleaner~24 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b72983c0ad71ee5f233db7c1464708d692429bff;p=modules%2Fsmesh.git 0051789: TC7.2.0: NoteBook cannot update study Fix for "LayerDistribution" hypothesis + const std::string & GetLastObjEntry() const { return myLastObj; } + std::string myLastObj; --- diff --git a/src/SMESH_I/SMESH_Gen_i.hxx b/src/SMESH_I/SMESH_Gen_i.hxx index 42157d407..798670f6b 100644 --- a/src/SMESH_I/SMESH_Gen_i.hxx +++ b/src/SMESH_I/SMESH_Gen_i.hxx @@ -576,6 +576,7 @@ public: //char* ParseParameters(const char* theParameters); const std::vector< int >& GetLastParamIndices() const { return myLastParamIndex; } const std::vector< std::string >& GetLastParameters() const { return myLastParameters; } + const std::string & GetLastObjEntry() const { return myLastObj; } std::vector< std::string > GetAllParameters(const std::string& theObjectEntry) const; private: @@ -624,6 +625,7 @@ private: bool myIsHistoricalPythonDump; std::vector< int > myLastParamIndex; std::vector< std::string > myLastParameters; + std::string myLastObj; }; diff --git a/src/SMESH_I/SMESH_Gen_i_1.cxx b/src/SMESH_I/SMESH_Gen_i_1.cxx index 13f283fc0..4ac7ad8d3 100644 --- a/src/SMESH_I/SMESH_Gen_i_1.cxx +++ b/src/SMESH_I/SMESH_Gen_i_1.cxx @@ -952,6 +952,7 @@ void SMESH_Gen_i::UpdateParameters(CORBA::Object_ptr theObject, const char* theP // find variable names within theParameters + myLastObj.clear(); myLastParameters.clear(); myLastParamIndex.clear(); /* vector holding indices of virables within the string of all varibles used for theObject */ @@ -986,9 +987,12 @@ void SMESH_Gen_i::UpdateParameters(CORBA::Object_ptr theObject, const char* theP // (1) variable names in the string of all varibles used for theObject and // (2) indices of found variables in myLastParamIndex. + // remember theObject SALOMEDS::SObject_wrap aSObj = ObjectToSObject(aStudy,theObject); if ( aSObj->_is_nil() ) return; + CORBA::String_var anObjEntry = aSObj->GetID(); + myLastObj = anObjEntry.in(); // get a string of variable names SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder(); @@ -1082,9 +1086,10 @@ std::vector< std::string > SMESH_Gen_i::GetAllParameters(const std::string& theO while ( pos < varStr.size() ) { // skip separators - while ( separators.find( varStr[ pos ]) != std::string::npos ) - if ( ++pos >= varStr.size() ) - break; + pos = varStr.find_first_not_of( separators, pos ); + // while ( separators.find( varStr[ pos ]) != std::string::npos ) + // if ( ++pos >= varStr.size() ) + // break; // skip repetition number following '=' if ( varStr[ pos-1 ] == '=' ) { @@ -1096,7 +1101,7 @@ std::vector< std::string > SMESH_Gen_i::GetAllParameters(const std::string& theO if ( pos < varStr.size() ) { size_t pos2 = varStr.find_first_of( separators, pos ); - varNames.push_back( varStr.substr( pos, pos2-1 )); + varNames.push_back( varStr.substr( pos, pos2 - pos)); pos = pos2; } }