commit b82e0d6d7f30dc327bba0f4364a5e29cc440e09b
Author: Enrico Forestieri <[email protected]>
Date: Mon Apr 27 12:27:42 2015 +0200
Fix instant preview for documents not specifying a specific output format.
Fixes the regression introduced at 0bb378ba.
diff --git a/src/graphics/PreviewLoader.cpp b/src/graphics/PreviewLoader.cpp
index 3fd8fef..6dfec9b 100644
--- a/src/graphics/PreviewLoader.cpp
+++ b/src/graphics/PreviewLoader.cpp
@@ -587,7 +587,13 @@ void PreviewLoader::Impl::startLoading(bool wait)
LYXERR(Debug::LATEX, "Format = " <<
buffer_.params().getDefaultOutputFormat());
string latexparam = "";
- OutputParams::FLAVOR flavor = buffer_.params().getOutputFlavor();
+ bool docformat = !buffer_.params().default_output_format.empty()
+ && buffer_.params().default_output_format != "default";
+ // Use LATEX flavor if the document does not specify a specific
+ // output format (see bug 9371).
+ OutputParams::FLAVOR flavor = docformat
+ ? buffer_.params().getOutputFlavor()
+ : OutputParams::LATEX;
if (buffer_.params().encoding().package() == Encoding::japanese) {
latexparam = " --latex=platex";
flavor = OutputParams::LATEX;