]> git.lyx.org Git - lyx.git/blobdiff - src/Buffer.cpp
Cmake tests: Display process while executing for target updatetex2lyxtests
[lyx.git] / src / Buffer.cpp
index f7f12c812727bd84f6d2ec790d98603e5123ef4b..e6096af747d328d284e3c8d13eb62744cb13c989 100644 (file)
@@ -1586,10 +1586,10 @@ bool Buffer::makeLaTeXFile(FileName const & fname,
 {
        OutputParams runparams = runparams_in;
 
-       // This is necessary for LuaTeX/XeTeX with tex fonts.
-       // See FIXME in BufferParams::encoding()
-       if (runparams.isFullUnicode())
-               runparams.encoding = encodings.fromLyXName("utf8-plain");
+       // XeTeX with TeX fonts is only safe with ASCII encoding,
+       // See #9740 and FIXME in BufferParams::encoding()
+       if (!params().useNonTeXFonts && (runparams.flavor == OutputParams::XETEX))
+               runparams.encoding = encodings.fromLyXName("ascii");
 
        string const encoding = runparams.encoding->iconvName();
        LYXERR(Debug::LATEX, "makeLaTeXFile encoding: " << encoding << ", fname=" << fname.realPath());
@@ -1673,10 +1673,10 @@ void Buffer::writeLaTeXSource(otexstream & os,
 
        OutputParams runparams = runparams_in;
 
-       // This is necessary for LuaTeX/XeTeX with tex fonts.
-       // See FIXME in BufferParams::encoding()
-       if (runparams.isFullUnicode())
-               runparams.encoding = encodings.fromLyXName("utf8-plain");
+       // XeTeX with TeX fonts is only safe with ASCII encoding,
+       // See #9740 and FIXME in BufferParams::encoding()
+       if (!params().useNonTeXFonts && (runparams.flavor == OutputParams::XETEX))
+               runparams.encoding = encodings.fromLyXName("ascii");
 
        // If we are compiling a file standalone, even if this is the
        // child of some other buffer, let's cut the link here, so the
@@ -2440,7 +2440,7 @@ bool Buffer::getStatus(FuncRequest const & cmd, FuncStatus & flag)
 
        case LFUN_BUFFER_VIEW_CACHE:
                (d->preview_file_).refresh();
-               enable = (d->preview_file_).exists();
+               enable = (d->preview_file_).exists() && !(d->preview_file_).isFileEmpty();
                break;
 
        default: