changeset 8782:45524925bed9

ov-class.cc (octave_class::subsref): return class object, not struct when indexing directly
author John W. Eaton <jwe@octave.org>
date Tue, 17 Feb 2009 14:24:02 -0500
parents f57c9fdb6836
children aee6f5c6665e
files src/ChangeLog src/ov-class.cc
diffstat 2 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Tue Feb 17 12:39:30 2009 -0500
+++ b/src/ChangeLog	Tue Feb 17 14:24:02 2009 -0500
@@ -1,5 +1,8 @@
 2009-02-17  John W. Eaton  <jwe@octave.org>
 
+	* ov-class.cc (octave_class::subsref): If indexing directly and
+	result is map, return class object, not simple struct.
+
 	* symtab.cc
 	(symbol_table::fcn_info::fcn_info_rep::load_private_function):
 	Pass dir_name to load_fcn_from_file.
--- a/src/ov-class.cc	Tue Feb 17 12:39:30 2009 -0500
+++ b/src/ov-class.cc	Tue Feb 17 14:24:02 2009 -0500
@@ -235,7 +235,8 @@
 		  }
 	      }
 	    else
-	      retval(0) = map.index (idx.front ());
+	      retval(0) = octave_value (map.index (idx.front ()),
+					class_name ());
 	  }
 	  break;