-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// 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 );
}
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
return ok;
}
-