From bab1459e30bb7fdec6871f719f78720dcd16b60a Mon Sep 17 00:00:00 2001 From: Werner LEMBERG Date: Thu, 3 Apr 2003 06:43:54 +0000 Subject: [PATCH] * src/devices/grohtml/html-table.cc (html_table::emit_col, html_table::is_gap): Compute table widths after converting border positions to avoid rounding errors. * src/devices/grohtml/html-text.cc (html_text::do_space): Handle `space_emitted' properly. --- ChangeLog | 11 +++++++++++ src/devices/grohtml/html-table.cc | 22 ++++++++++++++++------ src/devices/grohtml/html-text.cc | 3 ++- 3 files changed, 29 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index f3c52203..1c30e040 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2003-04-02 Werner LEMBERG + + * src/devices/grohtml/html-table.cc (html_table::emit_col, + html_table::is_gap): Compute table widths after converting border + positions to avoid rounding errors. + +2003-04-01 Werner LEMBERG + + * src/devices/grohtml/html-text.cc (html_text::do_space): Handle + `space_emitted' properly. + 2003-03-31 Werner LEMBERG * src/devices/grohtml/html-table.cc: Fix column width calculation. diff --git a/src/devices/grohtml/html-table.cc b/src/devices/grohtml/html-table.cc index 458dbd02..9ff41fe9 100644 --- a/src/devices/grohtml/html-table.cc +++ b/src/devices/grohtml/html-table.cc @@ -388,8 +388,12 @@ void html_table::emit_col (int n) // move across to column n while (b != c) { - width = ((get_right(b) - b->left)*100 + get_effective_linelength()/2) - / get_effective_linelength(); + // we compute the difference after converting positions + // to avoid rounding errors + width = (get_right(b)*100 + get_effective_linelength()/2) + / get_effective_linelength() + - (b->left*100 + get_effective_linelength()/2) + /get_effective_linelength(); if (width) out->put_string("next; } - width = ((get_right(b) - b->left)*100 + get_effective_linelength()/2) - / get_effective_linelength(); + width = (get_right(b)*100 + get_effective_linelength()/2) + / get_effective_linelength() + - (b->left*100 + get_effective_linelength()/2) + /get_effective_linelength(); switch (b->alignment) { case 'C': out->put_string("right <= 0 || c->next == NULL) return 0; else - return ((c->next->left - c->right)*100 + get_effective_linelength()/2) - / get_effective_linelength(); + // we compute the difference after converting positions + // to avoid rounding errors + return (c->next->left*100 + get_effective_linelength()/2) + / get_effective_linelength() + - (c->right*100 + get_effective_linelength()/2) + / get_effective_linelength(); } /* diff --git a/src/devices/grohtml/html-text.cc b/src/devices/grohtml/html-text.cc index 31e43116..8087dd22 100644 --- a/src/devices/grohtml/html-text.cc +++ b/src/devices/grohtml/html-text.cc @@ -1,5 +1,5 @@ // -*- C++ -*- -/* Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc. * * Gaius Mulley (gaius@glam.ac.uk) wrote html-text.cc * @@ -707,6 +707,7 @@ void html_text::do_space (void) else { do_emittext("", 0); out->nl(); + space_emitted = TRUE; } } else { html_indent *i = remove_indent(P_TAG); -- 2.11.4.GIT