diff options
| author | Simon Tatham <anakin@pobox.com> | 2002-08-11 18:20:32 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2002-08-11 18:20:32 +0000 |
| commit | 6c0b49bfcbe1081f749a9e4c72118b014319b190 (patch) | |
| tree | 35a847bdddd7ced0fd2d00105524d75149037f59 | |
| parent | 621a10b40a76b5f7600e041c6293cc186e878fdc (diff) | |
| download | halibut-6c0b49bfcbe1081f749a9e4c72118b014319b190.zip halibut-6c0b49bfcbe1081f749a9e4c72118b014319b190.tar.gz halibut-6c0b49bfcbe1081f749a9e4c72118b014319b190.tar.bz2 halibut-6c0b49bfcbe1081f749a9e4c72118b014319b190.tar.xz | |
Fix the bug in the text back end whereby bulletted paragraphs' width
failed to be decreased to compensate for the additional indent.
[originally from svn r1834]
| -rw-r--r-- | bk_text.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -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 |