From 0f7c08d0619ea1fa544be328b386a58991a0d00a Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 24 Feb 2009 14:51:23 +0000 Subject: [PATCH] fix ReplaceVariables() for a command w/o calling any method --- src/GEOM/GEOM_Engine.cxx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/GEOM/GEOM_Engine.cxx b/src/GEOM/GEOM_Engine.cxx index e8a25f375..a8917f10b 100644 --- a/src/GEOM/GEOM_Engine.cxx +++ b/src/GEOM/GEOM_Engine.cxx @@ -839,17 +839,21 @@ void ReplaceVariables(TCollection_AsciiString& theCommand, if( aCommand.Search("=") != -1 ) // command returns an object anEntry = aCommand.Token("=",1); else { // command modifies the object - int aStartEntryPos = aCommand.Location(1,'(',1,aCommand.Length()); - int aEndEntryPos = aCommand.Location(1,',',aStartEntryPos,aCommand.Length()); - anEntry = aCommand.SubString(aStartEntryPos+1, aEndEntryPos-1); + if (int aStartEntryPos = aCommand.Location(1,'(',1,aCommand.Length())) + if (int aEndEntryPos = aCommand.Location(1,',',aStartEntryPos,aCommand.Length())) + anEntry = aCommand.SubString(aStartEntryPos+1, aEndEntryPos-1); } - //Remove white spaces anEntry.RightAdjust(); anEntry.LeftAdjust(); if(MYDEBUG) cout<<"Result entry : '" <