From ce05aa1f374bb07d3b55487263ea9f21dcdc422e Mon Sep 17 00:00:00 2001 From: Kalle Olavi Niemitalo Date: Thu, 26 Apr 2007 23:46:03 +0300 Subject: [PATCH] Bug 947, set_hline: Also recognize NBSP_CHAR #ifndef CONFIG_UTF8. --- src/document/html/renderer.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/document/html/renderer.c b/src/document/html/renderer.c index a723b78e..bafacf29 100644 --- a/src/document/html/renderer.c +++ b/src/document/html/renderer.c @@ -584,13 +584,12 @@ good_char: len = x - x2; } else { /* not UTF-8 */ for (; charslen > 0; charslen--, x++, chars++) { - unsigned char c = *chars; - - if (c == NBSP_CHAR - && html_context->options->wrap_nbsp) - c = ' '; - part->spaces[x] = (c == ' '); part->char_width[x] = 1; + if (*chars == NBSP_CHAR) { + part->spaces[x] = html_context->options->wrap_nbsp; + } else { + part->spaces[x] = (*chars == ' '); + } } } } /* end of part->document check */ @@ -633,7 +632,11 @@ set_hline(struct html_context *html_context, unsigned char *chars, int charslen, } } else { for (; charslen > 0; charslen--, x++, chars++) { - part->spaces[x] = (*chars == ' '); + if (*chars == NBSP_CHAR) { + part->spaces[x] = html_context->options->wrap_nbsp; + } else { + part->spaces[x] = (*chars == ' '); + } } } } -- 2.11.4.GIT