# HG changeset patch # User Pantxo Diribarne # Date 1410121572 -7200 # Node ID 3e0720bd6bfc7ff035af1c31c328b8499aad747c # Parent dc88c5784f74d5b3182c59d32ab8217d67d3a442 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. diff -r dc88c5784f74 -r 3e0720bd6bfc libinterp/corefcn/graphics.cc --- a/libinterp/corefcn/graphics.cc Sun Sep 07 10:47:20 2014 +0200 +++ b/libinterp/corefcn/graphics.cc Sun Sep 07 22:26:12 2014 +0200 @@ -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) diff -r dc88c5784f74 -r 3e0720bd6bfc libinterp/corefcn/graphics.in.h --- a/libinterp/corefcn/graphics.in.h Sun Sep 07 10:47:20 2014 +0200 +++ b/libinterp/corefcn/graphics.in.h Sun Sep 07 22:26:12 2014 +0200 @@ -4220,8 +4220,8 @@ axes (const graphics_handle& mh, const graphics_handle& p) : base_graphics_object (), xproperties (mh, p), default_properties () { + xproperties.update_transform (); xproperties.override_defaults (*this); - xproperties.update_transform (); } ~axes (void) { }