X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Foutput_plaintext.cpp;h=09d7a3847cbeedf87230b3c00b8b6d6a6491bb65;hb=027563eec2d2a1b81391b221f9ca40d823713235;hp=2ce6aee5c75d44aa713d984d8accb0e471e35b6b;hpb=b89cc942eb458284f40f4d4e7db58890c3288979;p=lyx.git diff --git a/src/output_plaintext.cpp b/src/output_plaintext.cpp index 2ce6aee5c7..09d7a3847c 100644 --- a/src/output_plaintext.cpp +++ b/src/output_plaintext.cpp @@ -14,8 +14,6 @@ #include "Buffer.h" #include "BufferParams.h" -#include "support/debug.h" -#include "support/gettext.h" #include "Layout.h" #include "output.h" #include "OutputParams.h" @@ -23,6 +21,8 @@ #include "ParagraphList.h" #include "ParagraphParameters.h" +#include "support/debug.h" +#include "support/gettext.h" #include "support/lstrings.h" using namespace std; @@ -34,7 +34,7 @@ namespace lyx { void writePlaintextFile(Buffer const & buf, FileName const & fname, OutputParams const & runparams) { - odocfstream ofs("UTF-8"); + odocfstream ofs; if (!openFileWrite(ofs, fname)) return; writePlaintextFile(buf, ofs, runparams); @@ -58,9 +58,7 @@ void writePlaintextFile(Buffer const & buf, odocstream & os, } -namespace { - -pair const addDepth(int depth, int ldepth) +static pair addDepth(int depth, int ldepth) { int d = depth * 2; if (ldepth > depth) @@ -68,9 +66,6 @@ pair const addDepth(int depth, int ldepth) return make_pair(d, docstring(d, ' ')); } -} - - void writePlaintextParagraph(Buffer const & buf, Paragraph const & par, odocstream & os, @@ -82,7 +77,7 @@ void writePlaintextParagraph(Buffer const & buf, depth_type depth = par.params().depth(); // First write the layout - string const tmp = to_utf8(par.layout()->name()); + string const tmp = to_utf8(par.layout().name()); if (compare_ascii_no_case(tmp, "itemize") == 0) { ltype = 1; ltype_depth = depth + 1; @@ -200,7 +195,7 @@ void writePlaintextParagraph(Buffer const & buf, if (par.isInset(i)) { OutputParams rp = runparams; rp.depth = par.params().depth(); - int len = par.getInset(i)->plaintext(buf, os, rp); + int len = par.getInset(i)->plaintext(os, rp); if (len >= Inset::PLAINTEXT_NEWLINE) currlinelen = len - Inset::PLAINTEXT_NEWLINE; else