lynx-dev
[Top][All Lists]
Advanced

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

lynx-dev more tweaks for JUSTIFY patch


From: Vlad Harchev
Subject: lynx-dev more tweaks for JUSTIFY patch
Date: Sat, 17 Jul 1999 21:25:55 +0500 (SAMST)

 Here is a patch that will make rendering of DL correct (will inhibbit
justificaion of DT's content).

 Best regards,
  -Vlad

diff -ru orig/GridText.c fixed/GridText.c
--- orig/GridText.c     Fri Jul 16 07:56:28 1999
+++ fixed/GridText.c    Sat Jul 17 21:15:02 1999
@@ -276,6 +276,7 @@
     ok_justify ==FALSE or in psrcview. */
 PUBLIC BOOL form_in_htext;/*to indicate that we are in form (since HTML_FORM is
   not stacked in the HTML.c */
+PUBLIC BOOL in_DT=FALSE;  
 #ifdef DEBUG_JUSTIFY
 PUBLIC BOOL can_justify_stack_depth;/* can be 0 or 1 if all code is correct*/
 #endif
@@ -311,6 +312,7 @@
 
     last_anchor_of_previous_line = NULL;
     this_line_was_splitted = FALSE;
+    in_DT = FALSE;
 }
 
 PUBLIC void mark_justify_start_position ARGS1(void*,text)
@@ -323,7 +325,7 @@
 #define REALLY_CAN_JUSTIFY(text) ( (wait_for_this_stacked_elt<0) && \
        ( text->style->alignment == HT_LEFT     || \
          text->style->alignment == HT_JUSTIFY) && \
-       HTCJK == NOCJK && \
+       HTCJK == NOCJK && !in_DT && \
        can_justify_here && can_justify_this_line && !form_in_htext )
 
 #endif /* EXP_JUSTIFY_ELTS */
diff -ru orig/HTML.c fixed/HTML.c
--- orig/HTML.c Fri Jul 16 08:03:03 1999
+++ fixed/HTML.c        Sat Jul 17 21:14:38 1999
@@ -5715,6 +5715,13 @@
 #endif
     }
 
+#ifdef EXP_JUSTIFY_ELTS    
+    if (in_DT && ElementNumber == HTML_DD)
+       in_DT = FALSE;
+    else if (ElementNumber == HTML_DT)
+       in_DT = TRUE;
+#endif 
+
 #if defined(USE_COLOR_STYLE)
 /* end really empty tags straight away */
 #define REALLY_EMPTY(e) ((HTML_dtd.tags[e].contents == SGML_EMPTY) && \
@@ -6271,6 +6278,10 @@
        me->List_Nesting_Level--;
        CTRACE(tfp, "HTML_end_element: Reducing List Nesting Level to %d\n",
                    me->List_Nesting_Level);
+#ifdef EXP_JUSTIFY_ELTS    
+       if (element_number == HTML_DL)
+           in_DT = FALSE; /*close the term that was without definition. */
+#endif 
        change_paragraph_style(me, me->sp->style);  /* Often won't really 
change */
        UPDATE_STYLE;
        if (me->List_Nesting_Level >= 0)
diff -ru orig/LYJustify.h fixed/LYJustify.h
--- orig/LYJustify.h    Thu Jul 15 09:50:48 1999
+++ fixed/LYJustify.h   Sat Jul 17 21:01:38 1999
@@ -17,6 +17,10 @@
 extern int wait_for_this_stacked_elt;
 extern BOOL form_in_htext;
 
+    /*this is the element with SGML_EMPTY content, so it won't
+    get on the stack, so we can't trap it with wait_for_this_stacked_elt */
+extern BOOL in_DT;
+
 /*disabled by default*/
 /*#define DEBUG_JUSTIFY*/
 #ifdef DEBUG_JUSTIFY


reply via email to

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