changeset 17867:49d573a1deda

avoid initial spaces for scalars in GUI workspace viewer (bug #40500) * pr-output.cc (octave_base_scalar<ST>:short_disp): Pass true for pr_as_read_syntax to octave_print_internal.
author John W. Eaton <jwe@octave.org>
date Wed, 06 Nov 2013 19:22:02 -0500
parents ea0ecbe2eaf5
children da3586730ea0
files libinterp/corefcn/pr-output.cc libinterp/octave-value/ov-base-scalar.cc
diffstat 2 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/pr-output.cc	Wed Nov 06 19:17:59 2013 -0500
+++ b/libinterp/corefcn/pr-output.cc	Wed Nov 06 19:22:02 2013 -0500
@@ -2122,12 +2122,12 @@
 
 void
 octave_print_internal (std::ostream& os, const Complex& c,
-                       bool /* pr_as_read_syntax */)
+                       bool pr_as_read_syntax)
 {
-  if (plus_format)
-    {
-      pr_plus_format (os, c);
-    }
+  if (pr_as_read_syntax)
+    os << c;
+  else if (plus_format)
+    pr_plus_format (os, c);
   else
     {
       set_format (c);
--- a/libinterp/octave-value/ov-base-scalar.cc	Wed Nov 06 19:17:59 2013 -0500
+++ b/libinterp/octave-value/ov-base-scalar.cc	Wed Nov 06 19:22:02 2013 -0500
@@ -173,7 +173,7 @@
 octave_base_scalar<ST>::short_disp (void) const
 {
   std::ostringstream buf;
-  octave_print_internal (buf, scalar);
+  octave_print_internal (buf, scalar, true);
   return buf.str ();
 }