diff libinterp/octave-value/ov-struct.cc @ 20619:eef93a493ce3

use new cell_value method to handle value extraction errors * cellfun.cc, ov-class.cc, ov-struct.cc, ov-usr-fcn.cc: Use new cell_value method.
author John W. Eaton <jwe@octave.org>
date Fri, 09 Oct 2015 14:43:36 -0400
parents c41595061186
children
line wrap: on
line diff
--- a/libinterp/octave-value/ov-struct.cc	Fri Oct 09 14:41:49 2015 -0400
+++ b/libinterp/octave-value/ov-struct.cc	Fri Oct 09 14:43:36 2015 -0400
@@ -799,13 +799,7 @@
               if (!is)
                 break;
 
-              Cell tcell = t2.is_cell () ? t2.cell_value () : Cell (t2);
-
-              if (error_state)
-                {
-                  error ("load: internal error loading struct elements");
-                  return false;
-                }
+              Cell tcell = t2.is_cell () ? t2.cell_value ("load: internal error loading struct elements") : Cell (t2);
 
               m.setfield (nm, tcell);
             }
@@ -927,13 +921,7 @@
           if (!is)
             break;
 
-          Cell tcell = t2.is_cell () ? t2.cell_value () : Cell (t2);
-
-          if (error_state)
-            {
-              error ("load: internal error loading struct elements");
-              return false;
-            }
+          Cell tcell = t2.is_cell () ? t2.cell_value ("load: internal error loading struct elements") : Cell (t2);
 
           m.setfield (nm, tcell);
         }
@@ -1030,13 +1018,7 @@
     {
       octave_value t2 = dsub.tc;
 
-      Cell tcell = t2.is_cell () ? t2.cell_value () : Cell (t2);
-
-      if (error_state)
-        {
-          error ("load: internal error loading struct elements");
-          return false;
-        }
+      Cell tcell = t2.is_cell () ? t2.cell_value ("load: internal error loading struct elements") : Cell (t2);
 
       m.setfield (dsub.name, tcell);