]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
fix ReplaceVariables() for a command w/o calling any method
authoreap <eap@opencascade.com>
Tue, 24 Feb 2009 14:51:23 +0000 (14:51 +0000)
committereap <eap@opencascade.com>
Tue, 24 Feb 2009 14:51:23 +0000 (14:51 +0000)
src/GEOM/GEOM_Engine.cxx

index e8a25f375aa0c4707d9dbade34c8698badd37c8d..a8917f10b6aab3d3b43dddc000e0d7b7bb0bbdb1 100644 (file)
@@ -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 : '" <<anEntry<<"'"<<endl;
 
+    if ( anEntry.IsEmpty() ) {
+      aCommandIndex++;
+      continue;
+    }
+
     //Check if result is list of entries - enough to get the first entry in this case
     int aNbEntries = 1;
     if( anEntry.Value( 1 ) == O_SQR_BRACKET && anEntry.Value( anEntry.Length() ) == C_SQR_BRACKET ) {