changeset 15783:d61b92690820

coerce plot array and vector properties to full * graphics.h.in (array_property::array_property, array_property::set): Store full array if given data is sparse.
author John W. Eaton <jwe@octave.org>
date Thu, 13 Dec 2012 15:58:25 -0500
parents 10ed43563df5
children 2abea2cfdace b081fbe80174
files libinterp/interpfcn/graphics.in.h
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/interpfcn/graphics.in.h	Thu Dec 13 15:40:51 2012 -0500
+++ b/libinterp/interpfcn/graphics.in.h	Thu Dec 13 15:58:25 2012 -0500
@@ -1394,7 +1394,7 @@
 
   array_property (const std::string& nm, const graphics_handle& h,
                   const octave_value& m)
-    : base_property (nm, h), data (m),
+    : base_property (nm, h), data (m.is_sparse_type () ? m.full_value () : m),
       xmin (), xmax (), xminp (), xmaxp (),
       type_constraints (), size_constraints ()
     {
@@ -1454,12 +1454,14 @@
 protected:
   bool do_set (const octave_value& v)
     {
-      if (validate (v))
+      octave_value tmp = v.is_sparse_type () ? v.full_value () : v;
+
+      if (validate (tmp))
         {
           // FIXME -- should we check for actual data change?
-          if (! is_equal (v))
+          if (! is_equal (tmp))
             {
-              data = v;
+              data = tmp;
 
               get_data_limits ();