]> git.lyx.org Git - features.git/commitdiff
* src/output_plaintext.C: avoid empty line at the end of
authorMichael Schmitt <michael.schmitt@teststep.org>
Sat, 17 Feb 2007 15:43:11 +0000 (15:43 +0000)
committerMichael Schmitt <michael.schmitt@teststep.org>
Sat, 17 Feb 2007 15:43:11 +0000 (15:43 +0000)
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

index 809db27eb0435a5973fbfe7847d89140c30d2ba5..6ccb342265f101371b7cf3305af9e63b4fe96e35 100644 (file)
@@ -243,14 +243,18 @@ void writePlaintextParagraph(Buffer const & buf,
                }
        }
 
-       if (runparams.linelen > 0 &&
-           currlinelen + word.length() > runparams.linelen) {
-               os << '\n';
-               pair<int, docstring> 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<int, docstring> p = addDepth(depth, ltype_depth);
+                       os << p.second;
+                       currlinelen = p.first;
+               }
+               os << word;
        }
-       os << word;
 }