]> git.lyx.org Git - lyx.git/blobdiff - src/BufferParams.cpp
Correct tex2lyx/roundtrip/test-structure.tex test.
[lyx.git] / src / BufferParams.cpp
index fa2f97bb87869c41ffa336834b4c8634e47ccbb0..029e5b524c27cbb1c2c900b99c57f76b5e7f8f64 100644 (file)
@@ -429,6 +429,9 @@ BufferParams::BufferParams()
 
        output_sync = false;
        use_refstyle = true;
+
+       // map current author
+       author_map_[pimpl_->authorlist.get(0).bufferId()] = 0;
 }
 
 
@@ -504,6 +507,12 @@ AuthorList const & BufferParams::authors() const
 }
 
 
+void BufferParams::addAuthor(Author a)
+{
+       author_map_[a.bufferId()] = pimpl_->authorlist.record(a);
+}
+
+
 BranchList & BufferParams::branchlist()
 {
        return pimpl_->branchlist;
@@ -876,7 +885,7 @@ string BufferParams::readToken(Lexer & lex, string const & token,
                istringstream ss(lex.getString());
                Author a;
                ss >> a;
-               author_map[a.bufferId()] = pimpl_->authorlist.record(a);
+               addAuthor(a);
        } else if (token == "\\paperorientation") {
                string orient;
                lex >> orient;
@@ -3141,14 +3150,13 @@ string const BufferParams::loadFonts(LaTeXFeatures & features) const
 
 Encoding const & BufferParams::encoding() const
 {
-       // FIXME: For export with XeTeX and TeX fonts,
-       //   this function returns the wrong value.
-       //   The combination of XeTeX and TeX-fonts requires ASCII (see #9740).
-       //   However, the flavor is no buffer parameter but only known once export started.
-       //   Currently, we set runparams.encoding to ASCII in Buffer::makeLaTeXFile
-       //   (for export) and Buffer::writeLaTeXSource (for preview)
-       //   and prevent overwriting it with another encoding in Paragraph::latex
-       //   and at four places in output_latex.cpp.
+       // Main encoding for LaTeX output.
+       // 
+       // Exception: XeTeX with 8-bit TeX fonts requires ASCII (see #9740).
+       // As the "flavor" is only known once export started, this
+       // cannot be handled here. Instead, runparams.encoding is set
+       // to ASCII in Buffer::makeLaTeXFile (for export)
+       // and Buffer::writeLaTeXSource (for preview).
        if (useNonTeXFonts)
                return *(encodings.fromLyXName("utf8-plain"));
        if (inputenc == "auto" || inputenc == "default")