Fix test after https://codereview.scilab.org/#/c/13823/ (no need to create a new... 87/13987/2
Vincent COUVERT [Wed, 12 Mar 2014 08:39:42 +0000 (09:39 +0100)]
To test: test_run graphics bug_3975

Change-Id: I2de6bc22f053da1a419ea05491acee3dff6af03c

scilab/modules/io/macros/%_sodload.sci

index 5541f3c..4e5f3f1 100644 (file)
@@ -159,14 +159,27 @@ function %_sodload(%__filename__, varargin)
         fields(1) = [];
 
         if or(fields=="resize") then
-            // File created by Scilab 5.5.0 or more
-            h = figure("menubar", figureProperties.menubar, ...
-            "toolbar", figureProperties.toolbar, ...
-            "dockable", figureProperties.dockable, ...
-            "default_axes", figureProperties.default_axes, ...
-            "visible", "off");
+            if figureProperties.menubar<>"figure" ..
+                | figureProperties.toolbar<>"figure" ..
+                | figureProperties.dockable<>"on" ..
+                | figureProperties.default_axes<>"on" then
+                // File created by Scilab 5.5.0 or more
+                h = figure("menubar", figureProperties.menubar, ...
+                "toolbar", figureProperties.toolbar, ...
+                "dockable", figureProperties.dockable, ...
+                "default_axes", figureProperties.default_axes, ...
+                "visible", "off");
+            else
+                h = gcf();
+                h.visible = "off";
+            end
         else
-            h = figure("visible", "off");
+            if isempty(winsid()) then
+                h = figure("visible", "off");
+            else
+                h = gcf();
+                h.visible = "off";
+            end
         end
 
         // Following propeties will be set after all other ones