]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
0021824: EDF 2364 SMESH : Unknown exception when dumping a Study
authoreap <eap@opencascade.com>
Thu, 30 Aug 2012 08:12:19 +0000 (08:12 +0000)
committereap <eap@opencascade.com>
Thu, 30 Aug 2012 08:12:19 +0000 (08:12 +0000)
fix a bug in DumpPython()

src/GEOM/GEOM_Engine.cxx

index 6efcaf7e0bfc958888502b5ec90cba9beaf9fa50..dee9d3b544b89ec548c9f297eaaeb2a1d2a22191 100644 (file)
@@ -674,12 +674,13 @@ TCollection_AsciiString GEOM_Engine::DumpPython(int theDocID,
       // add function description before dump
       if (!aCurScript.IsEmpty())
       {
-        if ( aFunction->GetDriverGUID() == GEOM_Object::GetSubShapeID() )
+        if ( aFunction->GetDriverGUID() == GEOM_Object::GetSubShapeID() &&
+             aFuncScript.Length() > aCurScript.Length() )
           // avoid repeated SubShape...() command at the end
           if (aFuncScript.Location( aCurScript,
                                     aFuncScript.Length() - aCurScript.Length(),
                                     aFuncScript.Length()))
-              continue;
+            continue; // aCurScript is already at the end of aFuncScript
         aFuncScript += aCurScript;
       }
       if (isDumpCollected ) {