X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Foutput_plaintext.cpp;h=2dfc836f1aceb4906cbc596e532cb63bcbdc65dd;hb=d4ac337f0bd89c279b2133e2475a662a3ada641b;hp=f0a383df4c02591c6afb0851f0cfc8873d1021ff;hpb=aafd52f44167d5510be1ddcb974daa9dae486933;p=lyx.git diff --git a/src/output_plaintext.cpp b/src/output_plaintext.cpp index f0a383df4c..2dfc836f1a 100644 --- a/src/output_plaintext.cpp +++ b/src/output_plaintext.cpp @@ -41,6 +41,7 @@ void writePlaintextFile(Buffer const & buf, FileName const & fname, // make sure we are ready to export buf.updateBuffer(); buf.updateMacroInstances(OutputUpdate); + buf.makeCitationLabels(); writePlaintextFile(buf, ofs, runparams); } @@ -74,9 +75,9 @@ static pair addDepth(int depth, int ldepth) void writePlaintextParagraph(Buffer const & buf, Paragraph const & par, - odocstream & os, + odocstream & ods, OutputParams const & runparams, - bool & ref_printed) + bool & ref_printed, size_t max_length) { int ltype = 0; depth_type ltype_depth = 0; @@ -120,6 +121,7 @@ void writePlaintextParagraph(Buffer const & buf, string::size_type currlinelen = 0; + odocstringstream os; os << docstring(depth * 2, ' '); currlinelen += depth * 2; @@ -183,6 +185,9 @@ void writePlaintextParagraph(Buffer const & buf, if (par.isDeleted(i)) continue; + if (os.str().size() > max_length) + break; + char_type c = par.getUChar(buf.params(), i); if (par.isInset(i) || c == ' ') { @@ -201,7 +206,7 @@ void writePlaintextParagraph(Buffer const & buf, if (par.isInset(i)) { OutputParams rp = runparams; rp.depth = par.params().depth(); - int len = par.getInset(i)->plaintext(os, rp); + int len = par.getInset(i)->plaintext(os, rp, max_length); if (len >= Inset::PLAINTEXT_NEWLINE) currlinelen = len - Inset::PLAINTEXT_NEWLINE; else @@ -237,6 +242,7 @@ void writePlaintextParagraph(Buffer const & buf, } os << word; } + ods << os.str(); }