# HG changeset patch # User John Eaton # Date 1302450410 14400 # Node ID c3d4542a4f062935c8ef1766824b0b3e4f0fe352 # Parent 7ef7e20057fa96a112e3d81de1edaa5be6fc671f graphics.cc: Allow ishandle() to accept vector of handles (bug 33025). diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -5,6 +5,10 @@ DLD-FUNCTIONS/sqrtm.cc, DLD-FUNCTIONS/svd.cc, data.cc: Improve docstrings. +2011-04-10 John Eaton + + * graphics.cc: Allow ishandle() to accept vector of handles (bug 33025). + 2011-04-06 Rik * DLD-FUNCTIONS/dmperm.cc, data.cc: Clean up operator and function diff --git a/src/graphics.cc b/src/graphics.cc --- a/src/graphics.cc +++ b/src/graphics.cc @@ -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; } }