]> git.lyx.org Git - lyx.git/commitdiff
Disable "Show Output Anyway" button if empty file
authorScott Kostyshak <skostysh@lyx.org>
Thu, 29 Oct 2015 02:51:24 +0000 (22:51 -0400)
committerScott Kostyshak <skostysh@lyx.org>
Thu, 29 Oct 2015 06:27:27 +0000 (02:27 -0400)
Sometimes when compilation fails a PDF file is created but is empty
and the viewer gives an error when trying to view it. One such
example is compiling the current lib/examples/PDF-comment.lyx file
with TeX fonts and the following version of LuaTeX:

  beta-0.80.0 (TeX Live 2015) (rev 5238)

src/Buffer.cpp

index ae06ff89f46e2164d78e0e721fdb652604b56c55..e6096af747d328d284e3c8d13eb62744cb13c989 100644 (file)
@@ -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: