]> git.lyx.org Git - lyx.git/blobdiff - src/BufferParams.cpp
Honor trailing spaces in LabelString and friends
[lyx.git] / src / BufferParams.cpp
index 38ca643400698da1c4247edc177423ac02437896..5e8f6126dd613378bf01215b32ded8ff8895ee88 100644 (file)
@@ -323,7 +323,7 @@ bool inSystemDir(FileName const & document_dir, string & system_dir)
        return false;
 }
 
-} // anon namespace
+} // namespace
 
 
 class BufferParams::Impl
@@ -459,6 +459,7 @@ BufferParams::BufferParams()
        html_css_as_file = false;
        display_pixel_ratio = 1.0;
 
+       shell_escape = false;
        output_sync = false;
        use_refstyle = true;
        use_minted = false;
@@ -1119,7 +1120,7 @@ namespace {
                        return "\"" + str + "\"";
                return str;
        }
-}
+} // namespace
 
 
 void BufferParams::writeFile(ostream & os, Buffer const * buf) const
@@ -1553,7 +1554,7 @@ void BufferParams::validate(LaTeXFeatures & features) const
 
        if (useNonTeXFonts && fontsMath() != "auto")
                features.require("unicode-math");
-       
+
        if (use_microtype)
                features.require("microtype");
 
@@ -2049,13 +2050,12 @@ bool BufferParams::writeLaTeX(otexstream & os, LaTeXFeatures & features,
        // http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg144349.html
        os << from_ascii(features.getColorOptions());
 
-       // If we use hyperref, jurabib, japanese, varioref or vietnamese,
+       // If we use hyperref, jurabib, japanese or varioref,
        // we have to call babel before
        if (use_babel
            && (features.isRequired("jurabib")
                || features.isRequired("hyperref")
                || features.isRequired("varioref")
-               || features.isRequired("vietnamese")
                || features.isRequired("japanese"))) {
                        os << features.getBabelPresettings();
                        // FIXME UNICODE
@@ -2251,8 +2251,7 @@ bool BufferParams::writeLaTeX(otexstream & os, LaTeXFeatures & features,
        // called after babel, though.
        if (use_babel && !features.isRequired("jurabib")
            && !features.isRequired("hyperref")
-               && !features.isRequired("varioref")
-           && !features.isRequired("vietnamese")
+           && !features.isRequired("varioref")
            && !features.isRequired("japanese")) {
                os << features.getBabelPresettings();
                // FIXME UNICODE
@@ -2578,7 +2577,7 @@ FormatList const & BufferParams::exportableFormats(bool only_viewable) const
 {
        FormatList & cached = only_viewable ?
                        pimpl_->viewableFormatList : pimpl_->exportableFormatList;
-       bool & valid = only_viewable ? 
+       bool & valid = only_viewable ?
                        pimpl_->isViewCacheValid : pimpl_->isExportCacheValid;
        if (valid)
                return cached;
@@ -2593,7 +2592,7 @@ FormatList const & BufferParams::exportableFormats(bool only_viewable) const
                theConverters().getReachable(backs[0], only_viewable, true, excludes);
        for (vector<string>::const_iterator it = backs.begin() + 1;
             it != backs.end(); ++it) {
-               FormatList r = theConverters().getReachable(*it, only_viewable, 
+               FormatList r = theConverters().getReachable(*it, only_viewable,
                                false, excludes);
                result.insert(result.end(), r.begin(), r.end());
        }
@@ -2622,8 +2621,16 @@ vector<string> BufferParams::backends() const
                        v.push_back("luatex");
                        v.push_back("dviluatex");
                }
-       } else
-               v.push_back(buffmt);
+       } else {
+               string rbuffmt = buffmt;
+               // If we use an OutputFormat in Japanese docs,
+               // we need special format in order to get the path
+               // via pLaTeX (#8823)
+               if (documentClass().hasOutputFormat()
+                   && encoding().package() == Encoding::japanese)
+                       rbuffmt += "-ja";
+               v.push_back(rbuffmt);
+       }
 
        v.push_back("xhtml");
        v.push_back("text");
@@ -3368,7 +3375,7 @@ string const BufferParams::loadFonts(LaTeXFeatures & features) const
 Encoding const & BufferParams::encoding() const
 {
        // Main encoding for LaTeX output.
-       // 
+       //
        // Exception: XeTeX with 8-bit TeX fonts requires ASCII (see #9740).
        // As the "flavor" is only known once export started, this
        // cannot be handled here. Instead, runparams.encoding is set