changeset 12587:c3d4542a4f06 stable

graphics.cc: Allow ishandle() to accept vector of handles (bug 33025).
author John Eaton <jwe@octave.org>
date Sun, 10 Apr 2011 11:46:50 -0400
parents 7ef7e20057fa
children cf9cae7fed6d b4bd0bef55b6 732a568bf694
files src/ChangeLog src/graphics.cc
diffstat 2 files changed, 16 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Fri Apr 08 12:44:40 2011 -0700
+++ b/src/ChangeLog	Sun Apr 10 11:46:50 2011 -0400
@@ -5,6 +5,10 @@
 	DLD-FUNCTIONS/sqrtm.cc, DLD-FUNCTIONS/svd.cc, data.cc: Improve
 	docstrings.
 
+2011-04-10  John Eaton  <jwe@octave.org>
+
+	* graphics.cc: Allow ishandle() to accept vector of handles (bug 33025).
+
 2011-04-06  Rik  <octave@nomad.inbox5.com>
 
 	* DLD-FUNCTIONS/dmperm.cc, data.cc: Clean up operator and function
--- a/src/graphics.cc	Fri Apr 08 12:44:40 2011 -0700
+++ b/src/graphics.cc	Sun Apr 10 11:46:50 2011 -0400
@@ -2011,23 +2011,18 @@
 
   if (val.is_real_scalar () && is_handle (val.double_value ()))
     retval = true;
-  else if (val.is_real_matrix ())
-    {
-      if (val.is_string ())
-        retval = boolNDArray (val.dims (), false);
-      else
-        {
-          const NDArray handles = val.array_value ();
-
-          if (! error_state)
-            {
-              boolNDArray result (handles.dims ());
-
-              for (octave_idx_type i = 0; i < handles.numel (); i++)
-                result.xelem (i) = is_handle (handles (i));
-
-              retval = result;
-            }
+  else if (val.is_numeric_type () && val.is_real_type ())
+    {
+      const NDArray handles = val.array_value ();
+
+      if (! error_state)
+        {
+          boolNDArray result (handles.dims ());
+
+          for (octave_idx_type i = 0; i < handles.numel (); i++)
+            result.xelem (i) = is_handle (handles (i));
+
+          retval = result;
         }
     }