Mercurial > hg > octave-nkf
diff libinterp/corefcn/graphics.cc @ 19279:3e0720bd6bfc
Fix setting axes default x/y/zlabel with string values (bug #34755)
* /libinterp/corefcn/graphics.cc (base_properties::set_from_list): when setting a string value, don't delete/recreate the text object, simply set its string property.
* /libinterp/corefcn/graphics.in.h (axes::axes): update_transform before setting default properties.
author | Pantxo Diribarne <pantxo.diribarne@gmail.com> |
---|---|
date | Sun, 07 Sep 2014 22:26:12 +0200 |
parents | dc88c5784f74 |
children | 0f9c5a15c8fa |
line wrap: on
line diff
--- a/libinterp/corefcn/graphics.cc +++ b/libinterp/corefcn/graphics.cc @@ -2806,7 +2806,7 @@ q++) { std::string pname = q->first; - + obj.set (pname, q->second); if (error_state) @@ -4766,28 +4766,23 @@ const std::string& who, const octave_value& v) { + if (v.is_string ()) + { + xset (hp.handle_value (), "string", v); + return; + } + graphics_handle val; - - if (v.is_string ()) - { - val = gh_manager::make_graphics_handle ("text", __myhandle__, - false, false); - - xset (val, "string", v); - } - else - { - graphics_object go = gh_manager::get_object (gh_manager::lookup (v)); - - if (go.isa ("text")) - val = ::reparent (v, "set", who, __myhandle__, false); - else - { - std::string cname = v.class_name (); - - error ("set: expecting text graphics object or character string for %s property, found %s", - who.c_str (), cname.c_str ()); - } + graphics_object go = gh_manager::get_object (gh_manager::lookup (v)); + + if (go.isa ("text")) + val = ::reparent (v, "set", who, __myhandle__, false); + else + { + std::string cname = v.class_name (); + + error ("set: expecting text graphics object or character string for %s property, found %s", + who.c_str (), cname.c_str ()); } if (! error_state)