xfpolys better looks for parent figure 43/14743/1
Antoine ELIAS [Thu, 26 Jun 2014 09:15:08 +0000 (11:15 +0200)]
Change-Id: Id96889e4e1bb098127fd0ff26a2d0c825f3f244a

scilab/modules/graphics/sci_gateway/c/sci_xfpolys.c

index d72ea6a..9449370 100644 (file)
@@ -70,6 +70,9 @@ int sci_xfpolys(char *fname, unsigned long fname_len)
     int iVisible = 0;
     int *piVisible = &iVisible;
 
+    int iType = 0;
+    int *piType = &iType;
+
     CheckInputArgument(pvApiCtx, 2, 3);
 
     sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddrl1);
@@ -194,7 +197,14 @@ int sci_xfpolys(char *fname, unsigned long fname_len)
     }
 
     iSubWinUID = getOrCreateDefaultSubwin();
-    iFigureUID = getParentObject(iSubWinUID);
+    iFigureUID = iSubWinUID;
+    iType = 0;
+    while (iType != __GO_FIGURE__)
+    {
+        iFigureUID = getParentObject(iFigureUID);
+        getGraphicObjectProperty(iFigureUID, __GO_TYPE__, jni_int, (void **) &piType);
+    }
+
     getGraphicObjectProperty(iFigureUID, __GO_IMMEDIATE_DRAWING__, jni_bool, (void **)&piImmediateDrawing);
     setGraphicObjectProperty(iFigureUID, __GO_IMMEDIATE_DRAWING__, &iFalse, jni_bool, 1);