diff scripts/plot/util/copyobj.m @ 18625:ee125c82e01e

struct2hdl.m: handle properly objects with non-empy "tag" (bug #42047). * struct2hdl.m: don't exclude object properties with non-empty "tag". * copyobj.m: add a test for bug #42047.
author Pantxo Diribarne <pantxo.diribarne@gmail.com>
date Fri, 04 Apr 2014 20:49:52 +0200
parents 5ec4b7006b82
children 9a5e03801d23
line wrap: on
line diff
--- a/scripts/plot/util/copyobj.m	Fri Apr 04 11:50:14 2014 -0700
+++ b/scripts/plot/util/copyobj.m	Fri Apr 04 20:49:52 2014 +0200
@@ -168,3 +168,17 @@
 %!   graphics_toolkit (toolkit);
 %! end_unwind_protect
 
+%!test 
+%! unwind_protect
+%!   tag = "foo";
+%!   hf = figure ("visible", "off");
+%!   hax = axes ("tag", tag);
+%!   hpa = patch ();
+%!   set (hpa, "facecolor", [.5 .5 .5], "tag", tag)
+%!   hax2 = copyobj (hax, hf);
+%!   assert (get (hax2, "tag"), tag)
+%!   hpa2 = get (hax2, "children");
+%!   assert (get (hpa2, "facecolor"), [.5 .5 .5])
+%! unwind_protect_cleanup
+%!   close (hf)
+%! end_unwind_protect