changeset 22578:956f5c71dc3c stable

Fix printing when axes has color "none" (bug #49243). * print.m: Check whether list of top-level axes objects that need to change color to white for the inverthardcopy option is empty before using said list.
author Rik <rik@octave.org>
date Sat, 01 Oct 2016 18:45:39 -0700
parents fc9cd56986af
children 6e492d3d2e1e
files scripts/plot/util/print.m
diffstat 1 files changed, 10 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/util/print.m	Sat Oct 01 18:29:43 2016 -0700
+++ b/scripts/plot/util/print.m	Sat Oct 01 18:45:39 2016 -0700
@@ -400,14 +400,16 @@
       hax = findall (opts.figure, "-depth", 1, "type", "axes",
                                   "-not", "tag", "legend",
                                   "-not", "color", "none");
-      m = numel (props);
-      for n = 1:numel(hax)
-        props(m+n).h = hax(n);
-        props(m+n).name = "color";
-        props(m+n).value{1} = get(hax(n), "color");
-        set (hax(n), "color", "white");
-      endfor
-      nfig += n;
+      if (! isempty (hax))
+        m = numel (props);
+        for n = 1:numel (hax)
+          props(m+n).h = hax(n);
+          props(m+n).name = "color";
+          props(m+n).value{1} = get(hax(n), "color");
+          set (hax(n), "color", "white");
+        endfor
+        nfig += n;
+      endif
     endif
 
     if (opts.force_solid != 0)