lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

lynx-dev Re: [PATCH 2.8.5-dev16c7] table missing fix


From: Ilya Zakharevich
Subject: lynx-dev Re: [PATCH 2.8.5-dev16c7] table missing fix
Date: Mon, 6 Oct 2003 13:56:56 -0700
User-agent: Mutt/1.4i

On Mon, Oct 06, 2003 at 01:42:30PM -0700, Ilya Zakharevich wrote:
> I think this edit was omited (it fixes the remaining problem) in
> dev16c7.  Some other patches of mine are not applied yet:
> 
>   _A=.a               in Makefiles
>   [PATCH 2.8.5-dev15] table indentation

The last patch would not apply cleanly.  Here is the replacement:

--- ./src/GridText.c.orig       Mon Oct  6 13:29:08 2003
+++ ./src/GridText.c    Mon Oct  6 13:45:18 2003
@@ -2912,8 +2912,9 @@ PRIVATE void split_line ARGS2(
 {
     HTStyle * style = text->style;
     int spare;
-    int indent = text->in_line_1 ?
+    int indent = text->stbl ? 0 : text->in_line_1 ?
          text->style->indent1st : text->style->leftIndent;
+    int extra_space = indent + (text->stbl ? 0 : text->style->rightIndent);
     short alignment;
     TextAnchor * a;
     int CurLine = text->Lines;
@@ -3005,7 +3006,7 @@ PRIVATE void split_line ARGS2(
     text->permissible_split = 0;  /* 12/13/93 */
     line->data[0] = '\0';
 
-    alignment = style->alignment;
+    alignment = text->stbl ? HT_LEFT : style->alignment;
 
     if (split > 0) { /* Restore flags to the value at the splitting point */
        if (!(dump_output_immediately && use_underscore))
@@ -3261,8 +3262,7 @@ PRIVATE void split_line ARGS2(
            ctrl_chars_on_previous_line--;
 
        /* @@ first line indent */
-       spare =  (WRAP_COLS(text)-1) -
-           (int)style->rightIndent - indent +
+       spare =  (WRAP_COLS(text)-1) - extra_space +
            ctrl_chars_on_previous_line - previous->size;
        if (spare < 0 && LYwideLines)   /* Can be wider than screen */
            spare = 0;
@@ -3436,8 +3436,7 @@ PRIVATE void split_line ARGS2(
      && justify_max_void_percent <= 100
      && justify_max_void_percent >= ((100*spare)
                                  / ((WRAP_COLS(text) - 1)
-                                  - (int)style->rightIndent
-                                  - indent
+                                  - extra_space
                                   + ctrl_chars_on_previous_line))) {
        /* this is the only case when we need justification*/
        char* jp = previous->data + justify_start_position;
@@ -3720,8 +3719,10 @@ PUBLIC void HText_appendCharacter ARGS2(
        int,            ch)
 {
     HTLine * line;
-    HTStyle * style;
-    int indent;
+    HTStyle * style = text->style;
+    int indent = text->stbl ? 0 
+       : text->in_line_1 ? (int)style->indent1st : (int)style->leftIndent;
+    int right_indent = text->stbl ? 0 : text->style->rightIndent;
     int limit = 0;
     int actual;
     int flush_cell = 1;
@@ -3947,9 +3948,6 @@ PUBLIC void HText_appendCharacter ARGS2(
     }
 
     line = text->last_line;
-    style = text->style;
-
-    indent = text->in_line_1 ? (int)style->indent1st : (int)style->leftIndent;
 
     if (HTCJK != NOCJK) {
        switch(text->state) {
@@ -4368,7 +4366,7 @@ PUBLIC void HText_appendCharacter ARGS2(
        else
            target_cu = target + (here_cu - here);
 
-       if (target > (WRAP_COLS(text)-1) - (int)style->rightIndent &&
+       if (target > (WRAP_COLS(text)-1) - right_indent &&
            HTOutputFormat != WWW_SOURCE) {
            new_line(text);
        } else {
@@ -4399,7 +4397,7 @@ check_WrapSource:
         */
        int target = (int)(line->offset + line->size) - ctrl_chars_on_this_line;
        int target_cu = target + UTFXTRA_ON_THIS_LINE;
-       if (target >= (WRAP_COLS(text)-1) - style->rightIndent -
+       if (target >= (WRAP_COLS(text)-1) - right_indent -
            (((HTCJK != NOCJK) && text->kanji_buf) ? 1 : 0) ||
            (text->T.output_utf8 &&
             target_cu + UTF_XLEN(ch) >= (LYcols_cu(text)-1))) {
@@ -4456,7 +4454,7 @@ check_WrapSource:
                                        ? 2
                                        : 1))))) + 2;
        }
-       if ((nominal + (int)style->rightIndent) >= limit
+       if ((nominal + right_indent) >= limit
         || (nominal + UTFXTRA_ON_THIS_LINE) >= (LYcols_cu(text) - 1)) {
            return;
        }
@@ -4475,7 +4473,7 @@ check_WrapSource:
        limit = (LYcols_cu(text) - 1);
     } else {
        actual +=
-        (int)style->rightIndent - ctrl_chars_on_this_line +
+        right_indent - ctrl_chars_on_this_line +
         (((HTCJK != NOCJK) && text->kanji_buf) ? 1 : 0);
        limit = (WRAP_COLS(text) - 1);
     }
@@ -4790,12 +4788,13 @@ PRIVATE int HText_insertBlanksInStblLine
 #endif
     int                added_chars_before = 0;
     int lines_changed = 0;
-    int max_width = 0, indent, spare, table_offset;
+    int max_width = 0, indent, spare, table_offset, right_indent;
     HTStyle *style;
     short alignment;
     int i = 0, prevline_len = -1, do_unsplit, deleted = 0;
     int row_start_line = -1, cur_col = -1, cell_line_count = -1;
     int last_row_start_line, startrow_deleted = 0, vert_move = 1;
+    STable_info *enclosing;
 
     lineno = first_lineno = Stbl_getStartLine(me->stbl);
     if (lineno < 0 || lineno > me->Lines)
@@ -5002,21 +5001,22 @@ PRIVATE int HText_insertBlanksInStblLine
      *  HTML_TABLE should take care of this.
      */
     style = me->style;
-    alignment = Stbl_getAlignment(me->stbl);
+    enclosing = Stbl_get_enclosing(me->stbl);
+    alignment = enclosing ? HT_LEFT : Stbl_getAlignment(me->stbl);
     if (alignment == HT_ALIGN_NONE)
        alignment = style->alignment;
-    indent = style->leftIndent;
+    indent = enclosing ? 0 : style->leftIndent;
+    right_indent = enclosing ? 0 : style->rightIndent;
     /* Calculate spare character positions */
-    spare = (WRAP_COLS(me)-1) -
-       (int)style->rightIndent - indent - max_width;
-    if (spare < 0 && (int)style->rightIndent + spare >= 0) {
+    spare = (WRAP_COLS(me)-1) -        right_indent - indent - max_width;
+    if (spare < 0 && right_indent + spare >= 0) {
        /*
         *  Not enough room!  But we can fit if we ignore right indentation,
         *  so let's do that.
         */
        spare = 0;
     } else if (spare < 0) {
-       spare += style->rightIndent; /* ignore right indent, but need more */
+       spare += right_indent; /* ignore right indent, but need more */
     }
     if (spare < 0 && indent + spare >= 0) {
        /*

; To UNSUBSCRIBE: Send "unsubscribe lynx-dev" to address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]