From 6d396fc1362e6c89328a0e49a502171a1351110c Mon Sep 17 00:00:00 2001 From: Michael Schmitt Date: Sat, 17 Feb 2007 15:43:11 +0000 Subject: [PATCH] * src/output_plaintext.C: avoid empty line at the end of a paragraph if the previous line exceeds runparams.linelen git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17233 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/output_plaintext.C | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/output_plaintext.C b/src/output_plaintext.C index 809db27eb0..6ccb342265 100644 --- a/src/output_plaintext.C +++ b/src/output_plaintext.C @@ -243,14 +243,18 @@ void writePlaintextParagraph(Buffer const & buf, } } - if (runparams.linelen > 0 && - currlinelen + word.length() > runparams.linelen) { - os << '\n'; - pair p = addDepth(depth, ltype_depth); - os << p.second; - currlinelen = p.first; + // currlinelen may be greater than runparams.linelen! + // => check whether word is empty and do nothing in this case + if (!word.empty()) { + if (runparams.linelen > 0 && + currlinelen + word.length() > runparams.linelen) { + os << '\n'; + pair p = addDepth(depth, ltype_depth); + os << p.second; + currlinelen = p.first; + } + os << word; } - os << word; } -- 2.39.2