[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
lynx-dev [PATCH 2.8.4dev.19] table cleanup
From: |
Ilya Zakharevich |
Subject: |
lynx-dev [PATCH 2.8.4dev.19] table cleanup |
Date: |
Sun, 18 Mar 2001 19:34:57 -0500 |
User-agent: |
Mutt/1.2.5i |
This unobfuscates some arguments, and makes trailing <BR> in table
cells to "behave well" again (the following cell would not be
horizontally offset).
Enjoy,
Ilya
--- ./src/GridText.c-pre-br Sat Mar 17 20:57:38 2001
+++ ./src/GridText.c Sun Mar 18 16:27:40 2001
@@ -4809,7 +4809,7 @@ PUBLIC void HText_endStblTD ARGS1(
{
if (!me || !me->stbl)
return;
- if (Stbl_finishCellInTable(me->stbl, YES,
+ if (Stbl_finishCellInTable(me->stbl, TRST_ENDCELL_ENDTD,
me->Lines, HText_LastLineSize(me,FALSE)) < 0)
HText_cancelStbl(me); /* give up */
}
--- ./src/TRSTable.c-pre-br Sun Mar 18 18:26:16 2001
+++ ./src/TRSTable.c Sun Mar 18 16:31:02 2001
@@ -632,7 +632,7 @@ PRIVATE int Stbl_finishCellInRow ARGS5(
cellstate_s(s->prev_state), cellstate_s(s->state)));
if (multiline) {
- if (!end_td) { /* processing line-break */
+ if ((end_td & TRST_ENDCELL_MASK) == TRST_ENDCELL_LINEBREAK) {
switch (s->state) {
case CS_invalid:
newstate = empty ? CS_invalid : CS__cbc;
@@ -874,7 +874,7 @@ PRIVATE int Stbl_finishCellInRow ARGS5(
}
}
} else { /* (!multiline) */
- if (!end_td) { /* processing line-break */
+ if ((end_td & TRST_ENDCELL_MASK) == TRST_ENDCELL_LINEBREAK) {
switch (s->state) {
case CS_invalid:
case CS__0new:
@@ -1380,7 +1380,7 @@ PRIVATE int Stbl_fakeFinishCellInTable A
int cs = lastrow->cells[lastrow->ncells - 1].colspan;
int rs = 1; /* XXXX How to find rowspan? */
int ih = 0; /* XXXX How to find is_header? */
- int end_td = 1;
+ int end_td = (TRST_ENDCELL_ENDTD | TRST_FAKING_CELLS);
int need_reserved = 0;
int prev_reserved_last = -1;
STable_rowinfo *prev_row;
@@ -1667,15 +1667,14 @@ PUBLIC int Stbl_finishCellInTable ARGS4(
if (icell < 0)
return icell;
if (s->x_td == -1) {
- if (end_td)
+ if ((end_td & TRST_ENDCELL_MASK) == TRST_ENDCELL_ENDTD)
return -1;
lastrow->ended = ROW_ended_by_splitline;
return 0;
}
#ifdef EXP_NESTED_TABLES
- /* This check for pos saves us from infinite recursion... */
- if (!NO_AGGRESSIVE_NEWROW && pos) {
+ if (!NO_AGGRESSIVE_NEWROW && !(end_td & TRST_FAKING_CELLS)) {
int rc = Stbl_fakeFinishCellInTable(me, lastrow, lineno, 1);
if (rc) {
@@ -1778,7 +1777,7 @@ PUBLIC int Stbl_finishCellInTable ARGS4(
}
#endif
- if (!end_td)
+ if ((end_td & TRST_ENDCELL_MASK) == TRST_ENDCELL_LINEBREAK)
lastrow->ended = ROW_ended_by_splitline;
#ifdef EXP_NESTED_TABLES /* maxlen may already include contribution of a cell
in this column */
if (me->maxlen > MAX_STBL_POS)
--- ./src/TRSTable.h-pre-br Tue Mar 13 04:56:36 2001
+++ ./src/TRSTable.h Sun Mar 18 16:30:38 2001
@@ -15,7 +15,13 @@ extern int Stbl_finishCellInTable PARAMS
extern int Stbl_addColInfo PARAMS((STable_info *, int, short, BOOL));
extern int Stbl_finishColGroup PARAMS((STable_info *));
extern int Stbl_addRowGroup PARAMS((STable_info *, short));
-#define Stbl_lineBreak(stbl,l,pos) Stbl_finishCellInTable(stbl, NO, l, pos)
+
+#define TRST_ENDCELL_ENDTD 1
+#define TRST_ENDCELL_LINEBREAK 0
+#define TRST_ENDCELL_MASK 1
+#define TRST_FAKING_CELLS 2
+#define Stbl_lineBreak(stbl,l,pos) Stbl_finishCellInTable(stbl,
TRST_ENDCELL_LINEBREAK, l, pos)
+
extern int Stbl_getStartLine PARAMS((STable_info *));
extern int Stbl_getStartLineDeep PARAMS((STable_info *));
extern int Stbl_getFixupPositions PARAMS((
; To UNSUBSCRIBE: Send "unsubscribe lynx-dev" to address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- lynx-dev [PATCH 2.8.4dev.19] table cleanup,
Ilya Zakharevich <=