changeset 5598:86cd3d260b42

[project @ 2006-01-14 01:09:42 by jwe]
author jwe
date Sat, 14 Jan 2006 01:09:43 +0000
parents e0e48ea2a93c
children 38db18df5df8
files src/ChangeLog src/ov-struct.cc
diffstat 2 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Fri Jan 13 21:17:39 2006 +0000
+++ b/src/ChangeLog	Sat Jan 14 01:09:43 2006 +0000
@@ -1,5 +1,8 @@
 2006-01-13  John W. Eaton  <jwe@octave.org>
 
+	* ov-struct.cc (octave_struct::print_raw): Correctly print scalar
+	structs and empty struct arrays.
+
 	* DLD-FUNCTIONS/__gnuplot_raw__.l (Fclearplot): For compatibility,
 	also turn off hold state for current figure.
 
--- a/src/ov-struct.cc	Fri Jan 13 21:17:39 2006 +0000
+++ b/src/ov-struct.cc	Sat Jan 14 01:09:43 2006 +0000
@@ -413,8 +413,8 @@
 
   if (Vstruct_levels_to_print >= 0)
     {
-      bool print_keys_only = (Vstruct_levels_to_print == 0 || 
-			      map.numel() == 0);
+      bool print_keys_only = (Vstruct_levels_to_print == 0
+			      || map.numel () == 0);
 
       Vstruct_levels_to_print--;
 
@@ -424,9 +424,9 @@
 
       increment_indent_level ();
 
-      octave_idx_type n = map_keys().length();
+      octave_idx_type n = map.numel ();
 
-      if (n > 1 && print_keys_only)
+      if (n == 0 || (n > 1 && print_keys_only))
 	{
 	  indent (os);
 	  dim_vector dv = dims ();
@@ -459,7 +459,7 @@
 	    tmp.print_with_name (os, key);
 	}
 
-      if (n > 1 && print_keys_only)
+      if (n == 0 || (n > 1 && print_keys_only))
 	decrement_indent_level ();
 
       decrement_indent_level ();