From d1d8ea2e49e5a2b02d1fd76133d2f60eec8fa047 Mon Sep 17 00:00:00 2001 From: wl Date: Mon, 19 Jan 2009 08:01:59 +0000 Subject: Fix incorrect grops color state before \X'...'. Problem reported by Miklos Somogyi . * src/devices/grops/ps.cpp (ps_printer::special): Check color state before doing a PS special and flush buffer. Update called functions. --- src/devices/grops/ps.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/devices/grops/ps.cpp b/src/devices/grops/ps.cpp index 37fd4efa..ab1b0809 100644 --- a/src/devices/grops/ps.cpp +++ b/src/devices/grops/ps.cpp @@ -1557,6 +1557,9 @@ void ps_printer::special(char *arg, const environment *env, char type) } for (unsigned int i = 0; i < sizeof(proc_table)/sizeof(proc_table[0]); i++) if (strncmp(command, proc_table[i].name, p - command) == 0) { + flush_sbuf(); + if (sbuf_color != *env->col) + set_color(env->col); (this->*(proc_table[i].proc))(p, env); return; } @@ -1583,7 +1586,6 @@ static int check_line_lengths(const char *p) void ps_printer::do_exec(char *arg, const environment *env) { - flush_sbuf(); while (csspace(*arg)) arg++; if (*arg == '\0') { @@ -1609,7 +1611,6 @@ void ps_printer::do_exec(char *arg, const environment *env) void ps_printer::do_file(char *arg, const environment *env) { - flush_sbuf(); while (csspace(*arg)) arg++; if (*arg == '\0') { @@ -1636,7 +1637,6 @@ void ps_printer::do_file(char *arg, const environment *env) void ps_printer::do_def(char *arg, const environment *) { - flush_sbuf(); while (csspace(*arg)) arg++; if (!check_line_lengths(arg)) @@ -1652,7 +1652,6 @@ void ps_printer::do_def(char *arg, const environment *) void ps_printer::do_mdef(char *arg, const environment *) { - flush_sbuf(); char *p; int n = (int)strtol(arg, &p, 10); if (n == 0 && p == arg) { @@ -1677,7 +1676,6 @@ void ps_printer::do_mdef(char *arg, const environment *) void ps_printer::do_import(char *arg, const environment *env) { - flush_sbuf(); while (*arg == ' ' || *arg == '\n') arg++; char *p; -- cgit v1.2.1