# HG changeset patch # User jwe # Date 1187974788 0 # Node ID d069de22e9aa329aae8d8aaddea96581ad85e3e2 # Parent 647cad23207009dd087320bf6c206f5158f06644 [project @ 2007-08-24 16:59:47 by jwe] diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,12 @@ +2007-08-24 John W. Eaton + + * plot/subplot.m, plot/plot.m, plot/grid.m: + Use p = get (h, "prop") instead of obj = get (h); p = obj.prop. + + * miscellaneous/movefile.m: Separate second and third args and + use p1 and p2, not f1 and f2 when constructing arguments for + calls to system. From Michael Goffioul . + 2007-08-24 Michael Goffioul * set/intersect.m: Make it work with cell arrays of strings. diff --git a/scripts/miscellaneous/movefile.m b/scripts/miscellaneous/movefile.m --- a/scripts/miscellaneous/movefile.m +++ b/scripts/miscellaneous/movefile.m @@ -96,7 +96,7 @@ endif ## Move the file(s). - [err, msg] = system (sprintf ("%s %s\"%s\"", cmd, f1, f2)); + [err, msg] = system (sprintf ("%s %s \"%s\"", cmd, p1, p2)); if (err < 0) status = false; msgid = "movefile"; @@ -109,7 +109,7 @@ endif ## Move the file(s). - [err, msg] = system (sprintf ("%s %s\"%s\"", cmd, f1, f2)); + [err, msg] = system (sprintf ("%s %s \"%s\"", cmd, p1, p2)); if (err < 0) status = false; msgid = "movefile"; diff --git a/scripts/plot/grid.m b/scripts/plot/grid.m --- a/scripts/plot/grid.m +++ b/scripts/plot/grid.m @@ -46,10 +46,9 @@ if (nargs == 2) if (ishandle (x)) ax = x; - obj = get (x); x = y; nargs--; - if (! strcmp (obj.type, "axes")) + if (! strcmp (get (ax, "type"), "axes")) error ("grid: expecting first argument to be an axes object"); endif else diff --git a/scripts/plot/plot.m b/scripts/plot/plot.m --- a/scripts/plot/plot.m +++ b/scripts/plot/plot.m @@ -182,8 +182,7 @@ if (isscalar (varargin{1}) && ishandle (varargin{1})) h = varargin {1}; - obj = get (h); - if (! strcmp (obj.type, "axes")) + if (! strcmp (get (h, "type"), "axes")) error ("plot: expecting first argument to be an axes object"); endif oldh = gca (); diff --git a/scripts/plot/subplot.m b/scripts/plot/subplot.m --- a/scripts/plot/subplot.m +++ b/scripts/plot/subplot.m @@ -116,10 +116,8 @@ set (cf, "nextplot", "add"); - obj = get (cf); - found = false; - for child = obj.children + for child = get (cf, "children") ## Check if this child is still valid; this might not be the case ## anymore due to the deletion of previous children (due to DeleteFcn ## callback or for legends/colorbars that get deleted with their @@ -127,9 +125,8 @@ if (! ishandle (child)) continue; endif - obj = get (child); - if (strcmp (obj.type, "axes")) - objpos = obj.outerposition; + if (strcmp (get (child, "type"), "axes")) + objpos = get (child, "outerposition"); if (objpos == pos) ## If the new axes are in exactly the same position as an ## existing axes object, use the existing axes. diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,9 @@ 2007-08-24 John W. Eaton + * mappers.cc (octave_is_NA (int), xisnan (int)): New functions. + (install_mapper_functions): Use them to handle character data in + isna and isnan functions. + * load-path.cc (load_path::do_remove): Call remove_hook function before removing directory from list. diff --git a/src/mappers.cc b/src/mappers.cc --- a/src/mappers.cc +++ b/src/mappers.cc @@ -166,6 +166,18 @@ return x.real (); } +static int +octave_is_NA (int) +{ + return 0; +} + +static int +xisnan (int) +{ + return 0; +} + void install_mapper_functions (void) { @@ -462,7 +474,7 @@ Return 1 for characters that are lower case letters.\n\ @end deftypefn"); - DEFUN_MAPPER (isna, 0, octave_is_NA, octave_is_NA, 0, 0, 0, 0.0, 0.0, 0, 0, + DEFUN_MAPPER (isna, octave_is_NA, octave_is_NA, octave_is_NA, 0, 0, 0, 0.0, 0.0, 0, 0, "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} isna (@var{x})\n\ Return 1 for elements of @var{x} that are NA (missing) values and zero\n\ @@ -476,7 +488,7 @@ @end example\n\ @end deftypefn"); - DEFUN_MAPPER (isnan, 0, xisnan, xisnan, 0, 0, 0, 0.0, 0.0, 0, 0, + DEFUN_MAPPER (isnan, xisnan, xisnan, xisnan, 0, 0, 0, 0.0, 0.0, 0, 0, "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} isnan (@var{x})\n\ Return 1 for elements of @var{x} that are NaN values and zero\n\