changeset 11322:71cce7108190

graphics.h.in (base_property::do_set): don't reverse order of children
author John W. Eaton <jwe@octave.org>
date Wed, 08 Dec 2010 02:45:48 -0500
parents 43fa0522734d
children d7fbb08e28cf
files src/ChangeLog src/graphics.h.in
diffstat 2 files changed, 14 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Wed Dec 08 02:34:45 2010 -0500
+++ b/src/ChangeLog	Wed Dec 08 02:45:48 2010 -0500
@@ -1,3 +1,8 @@
+2010-12-08  John W. Eaton  <jwe@octave.org>
+
+	* graphics.h.in (base_property::do_set): Don't reverse order of
+	children.  Bug #31822.
+
 2010-12-08  John W. Eaton  <jwe@octave.org>
 
 	* symtab.cc (symbol_table::fcn_info::fcn_info_rep::find_user_function):
--- a/src/graphics.h.in	Wed Dec 08 02:34:45 2010 -0500
+++ b/src/graphics.h.in	Wed Dec 08 02:45:48 2010 -0500
@@ -1475,8 +1475,16 @@
 
       if (is_ok)
         {
+          Matrix tmp = new_kids_column.stack (get_hidden ());
+
           children_list.clear ();
-          do_init_children (new_kids_column.stack (get_hidden ()));
+
+          // Don't use do_init_children here, as that reverses the
+          // order of the list, and we don't want to do that if setting
+          // the child list directly.
+
+          for (octave_idx_type i = 0; i < tmp.numel (); i++)
+            children_list.push_back (tmp.xelem (i));
         }
 
       return is_ok;