changeset 23351:5ea6c6d0c2db

Use octave_base_value::print_name_tag for old style classes (bug #50640). * ov-class.cc (octave_class::print_name_tag): Remove code for overloading print and call octave_base_value::print_name_tag() instead. * scripts/@ftp/disp.m, scripts/audio/@audioplayer/disp.m, scripts/audio/@audiorecorder/disp.m: Remove trailing newline from disp() routines for old-style classes.
author Rik <rik@octave.org>
date Wed, 05 Apr 2017 14:11:18 -0700
parents 0f18524973eb
children 778fdffc09df
files libinterp/octave-value/ov-class.cc scripts/@ftp/disp.m scripts/audio/@audioplayer/disp.m scripts/audio/@audiorecorder/disp.m
diffstat 4 files changed, 2 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/octave-value/ov-class.cc	Wed Apr 05 14:00:21 2017 -0700
+++ b/libinterp/octave-value/ov-class.cc	Wed Apr 05 14:11:18 2017 -0700
@@ -997,15 +997,7 @@
 bool
 octave_class::print_name_tag (std::ostream& os, const std::string& name) const
 {
-  bool retval = false;
-
-  indent (os);
-  os << name << " =";
-  newline (os);
-  if (! Vcompact_format)
-    newline (os);
-
-  return retval;
+  return octave_base_value::print_name_tag (os, name);
 }
 
 void
--- a/scripts/@ftp/disp.m	Wed Apr 05 14:00:21 2017 -0700
+++ b/scripts/@ftp/disp.m	Wed Apr 05 14:11:18 2017 -0700
@@ -26,6 +26,6 @@
   printf ("    host: %s\n", obj.host);
   printf ("    user: %s\n", obj.username);
   printf ("     dir: %s\n", __ftp_pwd__ (obj.curlhandle));
-  printf ("    mode: %s\n\n", __ftp_mode__ (obj.curlhandle));
+  printf ("    mode: %s\n", __ftp_mode__ (obj.curlhandle));
 
 endfunction
--- a/scripts/audio/@audioplayer/disp.m	Wed Apr 05 14:00:21 2017 -0700
+++ b/scripts/audio/@audioplayer/disp.m	Wed Apr 05 14:11:18 2017 -0700
@@ -31,7 +31,5 @@
   for [val, prop] = __get_properties__ (player)
     printf ("  %s = ", prop), disp (val);
   endfor
-  ## FIXME: display in pr-output.cc should add "\n", not this function. 
-  printf ("\n");
 
 endfunction
--- a/scripts/audio/@audiorecorder/disp.m	Wed Apr 05 14:00:21 2017 -0700
+++ b/scripts/audio/@audiorecorder/disp.m	Wed Apr 05 14:11:18 2017 -0700
@@ -31,7 +31,5 @@
   for [val, prop] = __get_properties__ (recorder)
     printf ("  %s = ", prop), disp (val);
   endfor
-  ## FIXME: display in pr-output.cc should add "\n", not this function. 
-  printf ("\n");
 
 endfunction