Mercurial > jwe > octave
changeset 20742:5e2da9a66510
maint: periodic merge of stable to default
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 23 Nov 2015 21:00:14 -0500 |
parents | a5ab31b52ae8 (current diff) ab0d9d7f479c (diff) |
children | b6408331bfa2 |
files | libinterp/corefcn/graphics.cc scripts/io/textread.m |
diffstat | 4 files changed, 34 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/corefcn/graphics.cc Mon Nov 23 20:50:07 2015 -0500 +++ b/libinterp/corefcn/graphics.cc Mon Nov 23 21:00:14 2015 -0500 @@ -10972,10 +10972,18 @@ { graphics_object go = gh_manager::get_object (h); + // FIXME: when using qt toolkit the print_figure method + // returns immediately and Canvas::print doesn't have + // enough time to lock the mutex before we lock it here + // again. We thus wait 50 ms (which may not be enough) to + // give it a chance: see http://octave.1599824.n4.nabble.com/Printing-issues-with-Qt-toolkit-tp4673270.html + gh_manager::unlock (); - go.get_toolkit ().print_figure (go, term, file, - mono, debug_file); + go.get_toolkit ().print_figure (go, term, file, mono, + debug_file); + + Fsleep (octave_value (0.05)); gh_manager::lock (); }
--- a/scripts/io/textread.m Mon Nov 23 20:50:07 2015 -0500 +++ b/scripts/io/textread.m Mon Nov 23 21:00:14 2015 -0500 @@ -171,6 +171,9 @@ ## 'endofline' option set by user. if (ischar (varargin{endofline + 1})) eol_char = varargin{endofline + 1}; + if (strcmp (typeinfo (eol_char), "sq_string")) + eol_char = do_string_escapes (eol_char); + endif if (! any (strcmp (eol_char, {"", "\n", "\r", "\r\n"}))) error ("textread: invalid EndOfLine character value specified"); endif @@ -486,6 +489,16 @@ %! assert (d, {"a"; "b"; "c"}); %! unlink (f); +## Properly process single-quoted EOL args (bug #46477) +%!test +%! f = tempname (); +%! fid = fopen (f, "w"); +%! fprintf (fid, "hello, world!"); +%! fclose (fid); +%! [a, b] = textread (f, "%s%s", "endofline", '\n'); +%! assert (a{1}, "hello,"); +%! assert (b{1}, "world!"); + ## Test input validation %!error textread () %!error textread (1)
--- a/scripts/io/textscan.m Mon Nov 23 20:50:07 2015 -0500 +++ b/scripts/io/textscan.m Mon Nov 23 21:00:14 2015 -0500 @@ -224,6 +224,9 @@ if (! isempty (endofline)) if (ischar (args{endofline + 1})) eol_char = args{endofline + 1}; + if (strcmp (typeinfo (eol_char), "sq_string")) + eol_char = do_string_escapes (eol_char); + endif if (! any (strcmp (eol_char, {"", "\n", "\r", "\r\n"}))) error ("textscan: illegal EndOfLine character value specified"); endif @@ -696,3 +699,10 @@ ## Illegal format specifiers %!test %!error <no valid format conversion specifiers> textscan ("1.0", "%z"); + +## Properly process single-quoted EOL args (bug #46477) +%!test +%! C = textscan ("hello, world!", "%s%s", "endofline", '\n'); +%! assert (C{1}{1}, "hello,"); +%! assert (C{2}{1}, "world!"); +
--- a/scripts/plot/util/private/__ghostscript__.m Mon Nov 23 20:50:07 2015 -0500 +++ b/scripts/plot/util/private/__ghostscript__.m Mon Nov 23 21:00:14 2015 -0500 @@ -66,7 +66,7 @@ format_for_printer = true; endif - gs_opts = ["-dQUIET -dNOPAUSE -dBATCH -dSAFER -sDEVICE=" opts.device]; + gs_opts = ["-dQUIET -dNOPAUSE -dBATCH -dSAFER -dAutoRotatePages=/None -sDEVICE=" opts.device]; if (! isempty (opts.level) && ismember (opts.level, [1, 2, 3])) gs_opts = sprintf ("%s -dLanguageLevel=%d", gs_opts, opts.level);