Mercurial > hg > octave-terminal
changeset 8896:f155e9d1f086
graphics.cc (Fget, F__get__): return column vector, not row vector
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 02 Mar 2009 01:08:33 -0500 |
parents | ac8f5a159c2c |
children | fd83cc87f55e |
files | src/ChangeLog src/graphics.cc |
diffstat | 2 files changed, 20 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2009-03-02 John W. Eaton <jwe@octave.org> + + * graphics.cc (Fget, F__get__): Return a column vector of property + values, not a row vector. + 2009-03-01 John W. Eaton <jwe@octave.org> * OPERATORS/op-fcm-fcm.cc (DEFNDASSIGNOP_FN (dbl_assign)):
--- a/src/graphics.cc +++ b/src/graphics.cc @@ -4391,7 +4391,8 @@ gh_manager::autolock guard; octave_value retval; - octave_value_list vlist; + + Cell vals; int nargin = args.length (); @@ -4403,7 +4404,7 @@ { octave_idx_type len = hcv.length (); - vlist.resize (len); + vals.resize (dim_vector (len, 1)); for (octave_idx_type n = 0; n < len; n++) { @@ -4412,13 +4413,13 @@ if (obj) { if (nargin == 1) - vlist(n) = obj.get (); + vals(n) = obj.get (); else { caseless_str property = args(1).string_value (); if (! error_state) - vlist(n) = obj.get (property); + vals(n) = obj.get (property); else { error ("get: expecting property name as second argument"); @@ -4441,12 +4442,12 @@ if (! error_state) { - octave_idx_type len = vlist.length (); + octave_idx_type len = vals.numel (); if (len > 1) - retval = Cell (vlist); + retval = vals; else if (len == 1) - retval = vlist(0); + retval = vals(0); } return retval; @@ -4465,7 +4466,8 @@ gh_manager::autolock guard; octave_value retval; - octave_value_list vlist; + + Cell vals; int nargin = args.length (); @@ -4477,14 +4479,14 @@ { octave_idx_type len = hcv.length (); - vlist.resize (len); + vals.resize (dim_vector (len, 1)); for (octave_idx_type n = 0; n < len; n++) { graphics_object obj = gh_manager::get_object (hcv(n)); if (obj) - vlist(n) = obj.get (true); + vals(n) = obj.get (true); else { error ("get: invalid handle (= %g)", hcv(n)); @@ -4500,12 +4502,12 @@ if (! error_state) { - octave_idx_type len = vlist.length (); + octave_idx_type len = vals.numel (); if (len > 1) - retval = Cell (vlist); + retval = vals; else if (len == 1) - retval = vlist(0); + retval = vals(0); } return retval;