diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp index 916756e147..f8d23ba3af 100644 --- a/src/BufferParams.cpp +++ b/src/BufferParams.cpp @@ -907,7 +907,7 @@ bool BufferParams::writeLaTeX(odocstream & os, LaTeXFeatures & features, } // handle inputenc etc. - os << writeEncodingPreamble(features, texrow); + writeEncodingPreamble(os, features, texrow); if (!listings_params.empty()) { os << "\\usepackage{listings}\n"; @@ -1369,11 +1369,9 @@ string const BufferParams::babelCall(string const & lang_opts) const } -docstring const BufferParams::writeEncodingPreamble(LaTeXFeatures & features, - TexRow & texrow) const +void BufferParams::writeEncodingPreamble(odocstream & os, + LaTeXFeatures & features, TexRow & texrow) const { - odocstringstream os; - if (inputenc == "auto") { string const doc_encoding = language->encoding()->latexName(); @@ -1429,8 +1427,6 @@ docstring const BufferParams::writeEncodingPreamble(LaTeXFeatures & features, os << "\\usepackage{armtex}\n"; texrow.newline(); } - - return os.str(); } diff --git a/src/BufferParams.h b/src/BufferParams.h index 11049c3380..9b9136ff0e 100644 --- a/src/BufferParams.h +++ b/src/BufferParams.h @@ -254,7 +254,7 @@ public: /// set up if and how babel is called std::string const babelCall(std::string const & lang_opts) const; /// handle inputenc etc. - docstring const writeEncodingPreamble(LaTeXFeatures & features, + void writeEncodingPreamble(odocstream & os, LaTeXFeatures & features, TexRow & texrow) const; /// set up the document fonts std::string const loadFonts(std::string const & rm, diff --git a/src/graphics/PreviewLoader.cpp b/src/graphics/PreviewLoader.cpp index a06ca467fa..e87f773d27 100644 --- a/src/graphics/PreviewLoader.cpp +++ b/src/graphics/PreviewLoader.cpp @@ -594,7 +594,7 @@ void PreviewLoader::Impl::startLoading() of << "\\batchmode\n"; dumpPreamble(of); // handle inputenc etc. - of << buffer_.params().writeEncodingPreamble(features, texrow); + buffer_.params().writeEncodingPreamble(of, features, texrow); of << "\n\\begin{document}\n"; dumpData(of, inprogress.snippets); of << "\n\\end{document}\n";