xset/xget gateway now uses MVC features [lastpattern] 59/5759/1
Bruno JOFRET [Mon, 26 Dec 2011 15:18:30 +0000 (16:18 +0100)]
Change-Id: I4d5b3ed55440be6b481b53269045a5f8d455e517

scilab/modules/graphics/sci_gateway/c/sci_xget.c

index 36d8b87..585c4b2 100644 (file)
@@ -302,8 +302,18 @@ int sci_xget(char *fname,unsigned long fname_len)
     }
     else if(strcmp(cstk(l1),"lastpattern") == 0)
     {
-        x1[0] = sciGetNumColors(sciGetCurrentFigure());
-        x2 = 1;
+        int iNumColors = 0;
+        int* piNumColors = &iNumColors;
+
+        getOrCreateDefaultSubwin();
+        getGraphicObjectProperty(getCurrentFigure(), __GO_COLORMAP_SIZE__, jni_int, &piNumColors);
+
+        createScalarDouble(pvApiCtx, Rhs + 1, iNumColors);
+
+        LhsVar(1) = Rhs + 1;
+        PutLhsVar();
+
+        return 0;
     }
     else if(strcmp(cstk(l1),"line mode") == 0)
     {