changeset 1963:159ae640c8b1

flush the Textblock we last added to In Html_write_raw() the current textblock can change while parsing HTML. Instead of flushing the Textblock we started with, we now flush the current one. This fixes a long standing drawing bug where text was not positioned initially.
author Johannes Hofmann <Johannes.Hofmann@gmx.de>
date Sun, 03 Apr 2011 21:25:53 +0200
parents 9cce482083ef
children 7c7ff4d0202b
files src/html.cc
diffstat 1 files changed, 1 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/html.cc	Sat Apr 02 18:52:49 2011 +0100
+++ b/src/html.cc	Sun Apr 03 21:25:53 2011 +0200
@@ -3718,11 +3718,8 @@
 static int Html_write_raw(DilloHtml *html, char *buf, int bufsize, int Eof)
 {
    char ch = 0, *p, *text;
-   Textblock *textblock;
    int token_start, buf_index;
 
-   dReturn_val_if_fail ((textblock = HT2TB(html)) != NULL, 0);
-
    /* Now, 'buf' and 'bufsize' define a buffer aligned to start at a token
     * boundary. Iterate through tokens until end of buffer is reached. */
    buf_index = 0;
@@ -3841,7 +3838,7 @@
       }
    }/*while*/
 
-   textblock->flush ();
+   HT2TB(html)->flush ();
 
    return token_start;
 }