[w3m-dev 03169] Can't calculate table height if number of cells > 20.
* table.c (check_table_height): change row, rowspan, indexarray, height from array to pointer From: Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
2002-04-09 Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
|
||||||
|
|
||||||
|
* [w3m-dev 03169] Can't calculate table height if number of cells > 20.
|
||||||
|
* table.c (check_table_height): change row, rowspan, indexarray, height
|
||||||
|
from array to pointer
|
||||||
|
|
||||||
2002-04-09 Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
|
2002-04-09 Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
|
||||||
|
|
||||||
* [w3m-dev 03167] xface2xbm -> xface2xpm (current imlib can't handle XBM)
|
* [w3m-dev 03167] xface2xbm -> xface2xpm (current imlib can't handle XBM)
|
||||||
@@ -3334,4 +3340,4 @@
|
|||||||
* release-0-2-1
|
* release-0-2-1
|
||||||
* import w3m-0.2.1
|
* import w3m-0.2.1
|
||||||
|
|
||||||
$Id: ChangeLog,v 1.368 2002/04/09 14:45:58 ukai Exp $
|
$Id: ChangeLog,v 1.369 2002/04/09 14:53:54 ukai Exp $
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: table.c,v 1.22 2002/03/12 16:59:50 ukai Exp $ */
|
/* $Id: table.c,v 1.23 2002/04/09 14:53:54 ukai Exp $ */
|
||||||
/*
|
/*
|
||||||
* HTML table
|
* HTML table
|
||||||
*/
|
*/
|
||||||
@@ -1475,14 +1475,16 @@ check_table_height(struct table *t)
|
|||||||
{
|
{
|
||||||
int i, j, k;
|
int i, j, k;
|
||||||
struct {
|
struct {
|
||||||
short row[MAXCELL];
|
short *row;
|
||||||
short rowspan[MAXCELL];
|
short *rowspan;
|
||||||
char indexarray[MAXCELL];
|
char *indexarray;
|
||||||
short maxcell;
|
short maxcell;
|
||||||
short height[MAXCELL];
|
short size;
|
||||||
|
short *height;
|
||||||
} cell;
|
} cell;
|
||||||
int space = 0;
|
int space = 0;
|
||||||
|
|
||||||
|
cell.size = 0;
|
||||||
cell.maxcell = -1;
|
cell.maxcell = -1;
|
||||||
|
|
||||||
for (j = 0; j <= t->maxrow; j++) {
|
for (j = 0; j <= t->maxrow; j++) {
|
||||||
@@ -1509,21 +1511,36 @@ check_table_height(struct table *t)
|
|||||||
if (cell.row[idx] == j && cell.rowspan[idx] == rowspan)
|
if (cell.row[idx] == j && cell.rowspan[idx] == rowspan)
|
||||||
c = idx;
|
c = idx;
|
||||||
}
|
}
|
||||||
if (c < MAXCELL) {
|
if (c >= cell.size) {
|
||||||
if (c > cell.maxcell) {
|
if (cell.size == 0) {
|
||||||
cell.maxcell++;
|
cell.size = max(MAXCELL, c + 1);
|
||||||
cell.row[cell.maxcell] = j;
|
cell.row = NewAtom_N(short, cell.size);
|
||||||
cell.rowspan[cell.maxcell] = rowspan;
|
cell.rowspan = NewAtom_N(short, cell.size);
|
||||||
cell.height[cell.maxcell] = 0;
|
cell.indexarray = NewAtom_N(char, cell.size);
|
||||||
if (cell.maxcell > k)
|
cell.height = NewAtom_N(short, cell.size);
|
||||||
bcopy(cell.indexarray + k, cell.indexarray + k + 1,
|
} else {
|
||||||
cell.maxcell - k);
|
cell.size = max(cell.size + MAXCELL, c + 1);
|
||||||
cell.indexarray[k] = cell.maxcell;
|
cell.row = New_Reuse(short, cell.row, cell.size);
|
||||||
|
cell.rowspan = New_Reuse(short, cell.rowspan,
|
||||||
|
cell.size);
|
||||||
|
cell.indexarray = New_Reuse(char, cell.indexarray,
|
||||||
|
cell.size);
|
||||||
|
cell.height = New_Reuse(short, cell.height, cell.size);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cell.height[c] < t_dep)
|
|
||||||
cell.height[c] = t_dep;
|
|
||||||
}
|
}
|
||||||
|
if (c > cell.maxcell) {
|
||||||
|
cell.maxcell++;
|
||||||
|
cell.row[cell.maxcell] = j;
|
||||||
|
cell.rowspan[cell.maxcell] = rowspan;
|
||||||
|
cell.height[cell.maxcell] = 0;
|
||||||
|
if (cell.maxcell > k)
|
||||||
|
bcopy(cell.indexarray + k, cell.indexarray + k + 1,
|
||||||
|
cell.maxcell - k);
|
||||||
|
cell.indexarray[k] = cell.maxcell;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cell.height[c] < t_dep)
|
||||||
|
cell.height[c] = t_dep;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (t->tabheight[j] < t_dep)
|
if (t->tabheight[j] < t_dep)
|
||||||
|
|||||||
Reference in New Issue
Block a user