changeset 4519:8e1c04e506ce

[project @ 2003-09-24 17:11:46 by jwe]
author jwe
date Wed, 24 Sep 2003 17:11:46 +0000
parents 382cb0ed8c14
children 7843dfef8dd0
files src/ChangeLog src/ov-base-mat.cc src/ov-cell.cc
diffstat 3 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Sat Sep 20 18:08:40 2003 +0000
+++ b/src/ChangeLog	Wed Sep 24 17:11:46 2003 +0000
@@ -1,3 +1,9 @@
+2003-09-24  John W. Eaton  <jwe@bevo.che.wisc.edu>
+
+	* ov-cell.cc (octave_cell::subsasgn): Also attempt empty
+	conversion after extracting single element from cell array to
+	allow things like x{i}.elt = rhs to work.
+
 2003-09-19  John W. Eaton  <jwe@bevo.che.wisc.edu>
 
 	* ov.h (octave_value::dim_vector): New function.
--- a/src/ov-base-mat.cc	Sat Sep 20 18:08:40 2003 +0000
+++ b/src/ov-base-mat.cc	Wed Sep 24 17:11:46 2003 +0000
@@ -93,7 +93,7 @@
 	else
 	  {
 	    std::string nm = type_name ();
-	    error ("in indexed assignment of %s, last rhs index must be ()",
+	    error ("in indexed assignment of %s, last lhs index must be ()",
 		   nm.c_str ());
 	  }
       }
--- a/src/ov-cell.cc	Sat Sep 20 18:08:40 2003 +0000
+++ b/src/ov-cell.cc	Wed Sep 24 17:11:46 2003 +0000
@@ -158,7 +158,11 @@
 
 		    tmp.make_unique ();
 
-		    t_rhs = tmp.subsasgn (type.substr (1), next_idx, rhs);
+		    if (! tmp.is_defined () || tmp.is_empty ())
+		      tmp = octave_value::empty_conv (type.substr (1), rhs);
+
+		    if (! error_state)
+		      t_rhs = tmp.subsasgn (type.substr (1), next_idx, rhs);
 		  }
 	      }
 	  }