]> git.lyx.org Git - features.git/commitdiff
Simplify logic a bit. (This was meant to be part of a previous
authorRichard Heck <rgheck@lyx.org>
Sun, 10 Jul 2016 05:43:19 +0000 (01:43 -0400)
committerRichard Heck <rgheck@lyx.org>
Sun, 10 Jul 2016 05:45:05 +0000 (01:45 -0400)
commit.)

(cherry picked from commit 2104d41f71ff39f5c3f9f5a485707633b1bfb25b)

src/Buffer.cpp

index 22c993ca8b93401096459768007352e1e4599851..c20ce12b032f1752f01617fb1fc50ed63bfa50d5 100644 (file)
@@ -4318,12 +4318,11 @@ Buffer::ExportStatus Buffer::preview(string const & format, bool includeall) con
 
        if (status != ExportSuccess)
                return status;
-       if (previewFile.exists()) {
-               if (!formats.view(*this, previewFile, format))
-                       return PreviewError;
-               else
-                       return PreviewSuccess;
-       } 
+
+       if (previewFile.exists())
+               return formats.view(*this, previewFile, format) ?
+                       PreviewSuccess : PreviewError;
+
        // Successful export but no output file?
        // Probably a bug in error detection.
        LATTEST(status != ExportSuccess);