aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2002-01-28 14:42:30 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2002-01-28 14:42:30 +0000
commit4c805fe5095c72a76b528b6195b4688dd26d1153 (patch)
treea56842d62b77aa9354d24644e7ad8dee14f63665
parent[w3m-dev 02918] fixed scripts/w3mmail.cgi.in (diff)
downloadw3m-4c805fe5095c72a76b528b6195b4688dd26d1153.tar.gz
w3m-4c805fe5095c72a76b528b6195b4688dd26d1153.zip
[w3m-dev 02919] wrong table width calculation
* table.c (set_table_matrix0): refine width calculation From: Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
-rw-r--r--ChangeLog7
-rw-r--r--table.c24
2 files changed, 12 insertions, 19 deletions
diff --git a/ChangeLog b/ChangeLog
index 50efff4..7c8b14f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2002-01-28 Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
+ * [w3m-dev 02919] wrong table width calculation
+ * table.c (set_table_matrix0): refine width calculation
+
+2002-01-28 Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
+
* [w3m-dev 02918] fixed scripts/w3mmail.cgi.in
* scripts/w3mmail.cgi.in: add width=80 for header field name
* scripts/w3mmail.cgi.in (url_unquote): use pack instead of chr
@@ -2322,4 +2327,4 @@
* release-0-2-1
* import w3m-0.2.1
-$Id: ChangeLog,v 1.266 2002/01/27 18:59:57 ukai Exp $
+$Id: ChangeLog,v 1.267 2002/01/28 14:42:30 ukai Exp $
diff --git a/table.c b/table.c
index 713d42f..45f77fe 100644
--- a/table.c
+++ b/table.c
@@ -1,4 +1,4 @@
-/* $Id: table.c,v 1.17 2002/01/25 17:25:44 ukai Exp $ */
+/* $Id: table.c,v 1.18 2002/01/28 14:42:30 ukai Exp $ */
/*
* HTML table
*/
@@ -3216,7 +3216,7 @@ set_table_matrix0(struct table *t, int maxwidth)
int size = t->maxcol + 1;
int i, j, k, bcol, ecol;
int width;
- double w0, w1, w, e, s, b;
+ double w0, w1, w, s, b;
#ifdef __GNUC__
double we[size];
char expand[size];
@@ -3249,22 +3249,14 @@ set_table_matrix0(struct table *t, int maxwidth)
j = cell->eindex[k];
bcol = cell->col[j];
ecol = bcol + cell->colspan[j];
- for (i = bcol; i < ecol; i++) {
- expand[i]++;
- }
- }
-
- for (k = 0; k < cell->necell; k++) {
- j = cell->eindex[k];
- bcol = cell->col[j];
- ecol = bcol + cell->colspan[j];
width = cell->width[j] - (cell->colspan[j] - 1) * t->cellspacing;
- e = 0.;
+ w1 = 0.;
for (i = bcol; i < ecol; i++) {
- e += expand[i];
+ w1 += t->tabwidth[i] + 0.1;
+ expand[i]++;
}
for (i = bcol; i < ecol; i++) {
- w = weight(width * expand[i] / e);
+ w = weight(width * (t->tabwidth[i] + 0.1) / w1);
if (w > we[i])
we[i] = w;
}
@@ -3286,11 +3278,7 @@ set_table_matrix0(struct table *t, int maxwidth)
width = cell->width[j] - (cell->colspan[j] - 1) * t->cellspacing;
w = weight(width);
s = w / (w1 + w);
-#if 0
- b = sigma_td_nw((int)(s * maxwidth * cell->colspan[j]));
-#else
b = sigma_td_nw((int)(s * maxwidth));
-#endif
correct_table_matrix4(t, bcol, cell->colspan[j], expand, s, b);
}