From c83c649542e6eefbb72b73d3e33c05f2e372b646 Mon Sep 17 00:00:00 2001 From: simon Date: Sun, 11 Aug 2002 18:20:32 +0000 Subject: [PATCH] Fix the bug in the text back end whereby bulletted paragraphs' width failed to be decreased to compensate for the additional indent. git-svn-id: svn://svn.tartarus.org/sgt/halibut@1834 cda61777-01e9-0310-a592-d414129be87e --- bk_text.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/bk_text.c b/bk_text.c index 1583cbd..5df678e 100644 --- a/bk_text.c +++ b/bk_text.c @@ -91,7 +91,7 @@ static textconfig text_configure(paragraph *source) { } else if (!ustricmp(source->keyword, L"text-chapter-underline")) { ret.achapter.underline = *uadv(source->keyword); } else if (!ustricmp(source->keyword, L"text-chapter-numeric")) { - ret.achapter.underline = utob(uadv(source->keyword)); + ret.achapter.just_numbers = utob(uadv(source->keyword)); } else if (!ustricmp(source->keyword, L"text-section-align")) { wchar_t *p = uadv(source->keyword); int n = 0; @@ -269,7 +269,8 @@ void text_backend(paragraph *sourceform, keywordlist *keywords, body = p->words; } text_para(fp, prefix, prefixextra, body, - conf.indent + indentb, indenta, conf.width); + conf.indent + indentb, indenta, + conf.width - indentb - indenta); if (wp) { wp->next = NULL; free_word_list(body); @@ -535,15 +536,16 @@ static void text_para(FILE *fp, word *prefix, char *prefixextra, word *text, if (prefixextra) rdaddsc(&pfx, prefixextra); fprintf(fp, "%*s%s", indent, "", pfx.text); + /* If the prefix is too long, shorten the first line to fit. */ e = extraindent - strlen(pfx.text); if (e < 0) { - e = 0; - firstlinewidth -= e; + firstlinewidth += e; /* this decreases it, since e < 0 */ if (firstlinewidth < 0) { e = indent + extraindent; firstlinewidth = width; fprintf(fp, "\n"); - } + } else + e = 0; } sfree(pfx.text); } else -- 2.11.0