comparison libinterp/corefcn/variables.cc @ 17818:f1b59ef34eda

attempt to avoid setting persistent state on i/o streams (bug #40396) * utils.h, utils.cc (octave_preserve_stream_state): New class. * debug.cc, pr-output.cc, variables.cc, ov-base-sparse.cc: Use it to save and restore stream flags, precision, field width, and fill character.
author John W. Eaton <jwe@octave.org>
date Thu, 31 Oct 2013 17:26:04 -0400
parents 175b392e91fe
children 870f3e12e163
comparison
equal deleted inserted replaced
17817:9c8988786053 17818:f1b59ef34eda
937 print_descriptor (std::ostream& os, std::list<whos_parameter> params) 937 print_descriptor (std::ostream& os, std::list<whos_parameter> params)
938 { 938 {
939 // This method prints a line of information on a given symbol 939 // This method prints a line of information on a given symbol
940 std::list<whos_parameter>::iterator i = params.begin (); 940 std::list<whos_parameter>::iterator i = params.begin ();
941 std::ostringstream param_buf; 941 std::ostringstream param_buf;
942
943 octave_preserve_stream_state stream_state (os);
942 944
943 while (i != params.end ()) 945 while (i != params.end ())
944 { 946 {
945 whos_parameter param = *i; 947 whos_parameter param = *i;
946 948
1069 { 1071 {
1070 std::string dims_str = get_dims_str (varval); 1072 std::string dims_str = get_dims_str (varval);
1071 1073
1072 std::list<whos_parameter>::const_iterator i = params.begin (); 1074 std::list<whos_parameter>::const_iterator i = params.begin ();
1073 1075
1076 octave_preserve_stream_state stream_state (os);
1077
1074 while (i != params.end ()) 1078 while (i != params.end ())
1075 { 1079 {
1076 whos_parameter param = *i; 1080 whos_parameter param = *i;
1077 1081
1078 if (param.command != '\0') 1082 if (param.command != '\0')