X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESH_I%2FSMESH_NoteBook.cxx;h=324dd253e3c00d8d3586184abe2a0fbb18564fc9;hb=2ec7f35acedb4734ca755bd095a5504440e875f8;hp=0168a96e7ef3db68b9eec1e9cc5ffefeeece906c;hpb=bd8f1aee7c78f7d2eb82bd4fec5e08c9e3d280ce;p=modules%2Fsmesh.git diff --git a/src/SMESH_I/SMESH_NoteBook.cxx b/src/SMESH_I/SMESH_NoteBook.cxx index 0168a96e7..324dd253e 100644 --- a/src/SMESH_I/SMESH_NoteBook.cxx +++ b/src/SMESH_I/SMESH_NoteBook.cxx @@ -258,10 +258,12 @@ void SMESH_NoteBook::ReplaceVariables() // Get the entry of object storing "StringAttribute" TCollection_AsciiString & cmdStr = aCmd->GetString(); TEntry2VarVecMap::iterator ent2varVec; - if (int pos = cmdStr.Location( SMESH::TVar::ObjPrefix(), 6, cmdStr.Length() )) + Standard_Integer fromIndex = 6; + Standard_Integer cmdLen = cmdStr.Length(); + if ( int pos = (fromIndex <= cmdLen) ? cmdStr.Location( SMESH::TVar::ObjPrefix(), fromIndex, cmdLen ) : 0 ) { TCollection_AsciiString varHolderEntry = - cmdStr.SubString( pos + strlen( SMESH::TVar::ObjPrefix() ), cmdStr.Length() ); + cmdStr.SubString( pos + strlen( SMESH::TVar::ObjPrefix() ), cmdLen ); ent2varVec = _entry2VarsMap.find( varHolderEntry ); cmdStr.Split( pos - 1 ); } @@ -932,6 +934,17 @@ TCollection_AsciiString SMESH_NoteBook::GetResultScript() const return aResult; } +//================================================================================ +/*! + * \brief Return lines of the result script + */ +//================================================================================ +void SMESH_NoteBook::GetResultLines(std::list< TCollection_AsciiString >& lines) const +{ + for(int i=0;i<_commands.size();i++) + lines.push_back( _commands[i]->GetString() ); +} + //================================================================================ /*! * \brief Return value of the variable @@ -963,4 +976,3 @@ bool SMESH_NoteBook::GetReal(const TCollection_AsciiString& theVarName, double& return ok; } -