# HG changeset patch # User John W. Eaton # Date 1294422766 18000 # Node ID fbdb95640852bde308be3e758bc090cbc21ce433 # Parent 2be9e22796d2991b7a2476acbc2f5f851168a263 get: return empty matrix if no values are found diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -28,6 +28,11 @@ (text::properties::renderer): New class member of type ft_render. (text::properties::pixels): New class member of type uint8NDArray. +2011-01-07 John W. Eaton + + * graphics.cc (Fget): Return empty matrix if no values are found. + Bug #32067. + 2011-01-06 John W. Eaton * DLD-FUNCTIONS/rand.cc (Frandperm): Tag call to floor with gnulib::. diff --git a/src/graphics.cc b/src/graphics.cc --- a/src/graphics.cc +++ b/src/graphics.cc @@ -6150,15 +6150,21 @@ { octave_idx_type len = vals.numel (); - if (len > 1) - retval = vals; + if (len == 0) + retval = Matrix (); else if (len == 1) retval = vals(0); + else + retval = vals; } return retval; } +/* +%!assert (get (findobj (0, 'Tag', 'nonexistenttag'), 'nonexistentproperty'), []) +*/ + // Return all properties from the graphics handle @var{h}. // If @var{h} is a vector, return a cell array including the // property values or lists respectively.