# HG changeset patch # User Ben Abbott # Date 1224512944 14400 # Node ID 041bb0c64f07eeaf3bef27fda18c0ad01980c72e # Parent 6ef647359f076a1864bf22d0ddb35d5b07f923fc orient.m,print.f: validate figure handle diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -3,6 +3,8 @@ * plot/__stem__.m: Respect new ordering of children when setting baseline. + * plot/orient.m, plot/print.m: Properly validate figure handle. + 2008-10-20 David Bateman * plot/plotyy.m: Test that an axes handle actually is one before diff --git a/scripts/plot/orient.m b/scripts/plot/orient.m --- a/scripts/plot/orient.m +++ b/scripts/plot/orient.m @@ -32,7 +32,7 @@ nargs = nargin; - if (nargs > 0 && numel (varargin{1}) == 1 && ishandle (varargin{1})) + if (nargs > 0 && numel (varargin{1]) == 1 && isfigure (varargin{1})) cf = varargin{1}; varargin(1) = []; nargs--; diff --git a/scripts/plot/print.m b/scripts/plot/print.m --- a/scripts/plot/print.m +++ b/scripts/plot/print.m @@ -190,7 +190,7 @@ elseif (length (arg) > 0) name = arg; endif - elseif (ishandle (arg)) + elseif (isfigure (arg)) figure (arg); else error ("print: expecting inputs to be character string options or a figure handle"); @@ -439,7 +439,7 @@ endif unwind_protect_cleanup - if (ishandle (old_fig)) + if (isfigure (old_fig)) figure (old_fig) endif end_unwind_protect