lynx-dev
[Top][All Lists]
Advanced

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

lynx-dev [PATCH 2.8.3.dev6] various fixes


From: Vlad Harchev
Subject: lynx-dev [PATCH 2.8.3.dev6] various fixes
Date: Sun, 15 Aug 1999 18:42:25 +0500 (SAMST)

 This is the patch that fixes yet another bug in justification code (anchor
position recalculation) and fixes the GridText.c:*TrimHightext (it was not
designed to support LY_SOFT_NEWLINES) - this corrects rendering of links on
wrapped lines in psrc mode.

 Best regards,
  -Vlad

diff -ru old/src/GridText.c fixed/src/GridText.c
--- old/src/GridText.c  Sat Aug 14 18:39:18 1999
+++ fixed/src/GridText.c        Sun Aug 15 18:34:22 1999
@@ -2868,10 +2868,9 @@
                                     * be text->Lines-3
                                     */
                                    a2->extent += spare;
-                               else {
+                               else if (onp2sz < a2->extent)
                                    a2->extent += justified_text_map[onp1sz-1]
-                                        - onp1sz + 1;
-                               }
+                                        - onp1sz + 1;                          
                            }
 
                        }
@@ -2895,17 +2894,6 @@
                    *p = (*p == HT_NON_BREAK_SPACE ? ' ' : *p);
                
            };
-           
-           if (!a2)
-               a2 = text->first_anchor;
-           else if (a2 == text->last_anchor)
-               a2 = NULL;
-           else
-               a2 = a2->next; /* 1st anchor on line we justify */
-
-           if (a2)
-               for (; a2 && a2->line_num <= text->Lines-1;
-                   last_anchor_of_previous_line = a2, a2 = a2->next);
        }
     } else {
        if (REALLY_CAN_JUSTIFY(text) ) {
@@ -2939,20 +2927,6 @@
 
        /* else HT_NON_BREAK_SPACEs were substituted with spaces in
           HText_appendCharacter */
-       {
-           /* keep maintaining 'last_anchor_of_previous_line' */
-           TextAnchor* a2 = last_anchor_of_previous_line;
-           if (!a2)
-               a2 = text->first_anchor;
-           else if (a2 == text->last_anchor)
-               a2 = NULL;
-           else
-               a2 = a2->next; /*1st anchor on line we justify */
-
-           if (a2)
-               for (; a2 && a2->line_num <= text->Lines-1;
-                   last_anchor_of_previous_line = a2, a2 = a2->next);
-       }
     }
        /* cleanup */
     can_justify_this_line = TRUE;
@@ -4638,6 +4612,11 @@
                               strlen(anchor_ptr->hightext)));
                anchor_ptr->hightext2offset = line_ptr2->offset;
                remove_special_attr_chars(anchor_ptr->hightext2);
+               
+               /*handle LY_SOFT_NEWLINEs -VH */                
+               anchor_ptr->hightext2offset += 
+                   (line_ptr2->data[0] == LY_SOFT_NEWLINE);            
+                   
                if (anchor_ptr->link_type & HYPERTEXT_ANCHOR) {
                    LYTrimTrailing(anchor_ptr->hightext2);
                    if (anchor_ptr->hightext2[0] == '\0') {
@@ -4670,6 +4649,9 @@
         */
        anchor_ptr->line_pos += line_ptr->offset;
        anchor_ptr->line_num  = cur_line;
+       
+       /*handle LY_SOFT_NEWLINEs -VH */
+       anchor_ptr->line_pos += (line_ptr->data[0] == LY_SOFT_NEWLINE); 
 
        CTRACE(tfp, "GridText:     add link on line %d col %d [%d] %s\n",
               cur_line, anchor_ptr->line_pos,


reply via email to

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