From 37b1fcadeaf8f415061191419dc2787c8e97b505 Mon Sep 17 00:00:00 2001 From: Laurent MONIN Date: Thu, 1 Dec 2005 11:39:39 +0100 Subject: [PATCH] distribute_table_widths(): simplify. --- src/document/html/tables.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/document/html/tables.c b/src/document/html/tables.c index 5716f9ca..d9a6ecc9 100644 --- a/src/document/html/tables.c +++ b/src/document/html/tables.c @@ -1229,13 +1229,14 @@ draw_table_bad_html(struct html_context *html_context, struct table *table) static void distribute_table_widths(struct table *table) { - /* DBG("%d %d %d", t->min_width, t->max_width, table->width); */ - if (table->min_width >= table->width) - distribute_widths(table, table->min_width); - else if (table->max_width < table->width && table->full_width) - distribute_widths(table, table->max_width); - else - distribute_widths(table, table->width); + int width = table->width; + + if (table->min_width >= width) + width = table->min_width; + else if (table->max_width < width && table->full_width) + width = table->max_width; + + distribute_widths(table, width); } void