changeset 6828:d069de22e9aa

[project @ 2007-08-24 16:59:47 by jwe]
author jwe
date Fri, 24 Aug 2007 16:59:48 +0000
parents 647cad232070
children 6c85f7d37e61
files scripts/ChangeLog scripts/miscellaneous/movefile.m scripts/plot/grid.m scripts/plot/plot.m scripts/plot/subplot.m src/ChangeLog src/mappers.cc
diffstat 7 files changed, 34 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog	Fri Aug 24 16:38:05 2007 +0000
+++ b/scripts/ChangeLog	Fri Aug 24 16:59:48 2007 +0000
@@ -1,3 +1,12 @@
+2007-08-24  John W. Eaton  <jwe@octave.org>
+
+	* 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 <michael.goffioul@gmail.com>.
+
 2007-08-24  Michael Goffioul  <michael.goffioul@gmail.com>
 
 	* set/intersect.m: Make it work with cell arrays of strings.
--- a/scripts/miscellaneous/movefile.m	Fri Aug 24 16:38:05 2007 +0000
+++ b/scripts/miscellaneous/movefile.m	Fri Aug 24 16:59:48 2007 +0000
@@ -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";
--- a/scripts/plot/grid.m	Fri Aug 24 16:38:05 2007 +0000
+++ b/scripts/plot/grid.m	Fri Aug 24 16:59:48 2007 +0000
@@ -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
--- a/scripts/plot/plot.m	Fri Aug 24 16:38:05 2007 +0000
+++ b/scripts/plot/plot.m	Fri Aug 24 16:59:48 2007 +0000
@@ -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 ();
--- a/scripts/plot/subplot.m	Fri Aug 24 16:38:05 2007 +0000
+++ b/scripts/plot/subplot.m	Fri Aug 24 16:59:48 2007 +0000
@@ -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.
--- a/src/ChangeLog	Fri Aug 24 16:38:05 2007 +0000
+++ b/src/ChangeLog	Fri Aug 24 16:59:48 2007 +0000
@@ -1,5 +1,9 @@
 2007-08-24  John W. Eaton  <jwe@octave.org>
 
+	* 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.
 
--- a/src/mappers.cc	Fri Aug 24 16:38:05 2007 +0000
+++ b/src/mappers.cc	Fri Aug 24 16:59:48 2007 +0000
@@ -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\