Mercurial > octave
diff libinterp/octave-value/ov-cell.cc @ 24652:ef60416c4686
directly edit scalar numeric & logical values in cell arrays (bug #52988)
* variable-editor-model.cc (variable_editor::impl::cell): Don't
require subeditor for scalar numeric and logical values in cell
arrays. Create label in same way for all objects.
* ov-cell.cc (octave_cell::edit_display): Correctly call edit_display
for individual scalar numeric and logical values instead of calling
edit_display recursively for all scalar objects. Return dimensions
and type if element is not a scalar numeric or logical array.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 29 Jan 2018 16:22:30 -0500 |
parents | 78aff6f14227 |
children | 3ceee1910e1a |
line wrap: on
line diff
--- a/libinterp/octave-value/ov-cell.cc Mon Jan 29 15:19:09 2018 -0500 +++ b/libinterp/octave-value/ov-cell.cc Mon Jan 29 16:22:30 2018 -0500 @@ -106,10 +106,15 @@ { octave_value val = matrix(i,j); - if (val.numel () == 1) - return edit_display(0,0); + if (val.numel () == 1 && (val.isnumeric () || val.islogical ())) + return val.edit_display (0, 0); else - return "type + dims"; + { + std::string tname = val.type_name (); + dim_vector dv = val.dims (); + std::string dimstr = dv.str (); + return "[" + dimstr + " " + tname + "]"; + } } template <>