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-dev14] ladder in tables [Part II]


From: Ilya Zakharevich
Subject: lynx-dev Re: [PATCH 2.8.5-dev14] ladder in tables [Part II]
Date: Sun, 27 Apr 2003 12:57:30 -0700
User-agent: Mutt/1.4i

On Sat, Apr 12, 2003 at 11:04:21PM -0700, Ilya Zakharevich wrote:
> On Sat, Apr 12, 2003 at 06:00:55PM -0700, Ilya Zakharevich wrote:
> > This is the second part.

I retested with fresh 2.8.5-dev14, and found no conflict of patches.

[I applied the following patches (this is the chronological order)
  Quadratic time in setting up a table
  The first part of the ladder patch
  Table memory was quadratic
  The second part of the ladder patch
  Update to the second part

I sent many other patches, but they should not conflict with these.]

One function was indeed missing.

--- ./src/GridText.c-bad        Sun Apr 27 12:17:38 2003
+++ ./src/GridText.c    Sun Apr 27 12:49:48 2003
@@ -579,6 +579,9 @@ PRIVATE int HText_TrueLineSize PARAMS((
        HText *         text,
        BOOL            IgnoreSpaces));
 
+PRIVATE void HText_RemoveEmptyLastLine PARAMS((
+       HText *         text));
+
 #ifdef CHECK_FREE_MEM
 
 /*
@@ -8727,6 +8730,29 @@ PUBLIC void HText_RemovePreviousLine ARG
     previous = line->prev;
     previous->next = text->last_line;
     text->last_line->prev = previous;
+    text->Lines--;
+}
+
+/*
+ *  This function is for removing the last blank lines.
+ *  It should be called after
+ *  checking the situation with HText_LastLineSize().
+ *  With POOLed allocation is should be wrapped into code restoring the
+ *  expected POOLed/unPOOLed state of the line chain.
+ */
+PRIVATE void HText_RemoveEmptyLastLine ARGS1(
+       HText *,        text)
+{
+    HTLine *line, *previous;
+
+    if (!(text && text->Lines >= 1))   /* Lines is 0-based */
+       return;
+
+    line = text->last_line;
+    previous = line->prev;
+    previous->next = line->next;
+    previous->next->prev = previous;
+    text->last_line = previous;
     text->Lines--;
 }
 

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

reply via email to

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