From: Scott Kostyshak Date: Thu, 29 Oct 2015 02:51:24 +0000 (-0400) Subject: Disable "Show Output Anyway" button if empty file X-Git-Tag: 2.2.0alpha1~120 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=0ca63f4e27edd749331b3e94b84538b7af5f776b;p=lyx.git Disable "Show Output Anyway" button if empty file 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) --- diff --git a/src/Buffer.cpp b/src/Buffer.cpp index ae06ff89f4..e6096af747 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -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: