]> 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:43:19 +0000 (01:43 -0400)
commit.)

src/Buffer.cpp

index bcefe52513f324fb372754ac6f2321811b7a5c4e..888fb93d9b16a7dbc19f0186b02ed28e3c730f01 100644 (file)
@@ -4322,12 +4322,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);