]> git.lyx.org Git - lyx.git/blobdiff - src/Font.cpp
Fix footnote output in tables outside floats and longtable header/footer
[lyx.git] / src / Font.cpp
index 2f77c9bd951be4c3f6d815e3c6cd9ac6eddfff0b..450d67fa3a1b794fbbd6717c0ef451fdf8f3099e 100644 (file)
@@ -94,7 +94,7 @@ char const * LaTeXSizeNames[NUM_SIZE + 4] =
 { "tiny", "scriptsize", "footnotesize", "small", "normalsize", "large",
   "Large", "LARGE", "huge", "Huge", "error8", "error9", "error10", "error11" };
 
-} // namespace anon
+} // namespace
 
 
 Font::Font(FontInfo bits, Language const * l)
@@ -293,7 +293,7 @@ int Font::latexWriteStartChanges(odocstream & os, BufferParams const & bparams,
                        tmp += "{";
                        os << from_ascii(tmp);
                        count += tmp.length();
-                       pushPolyglossiaLang(language()->polyglossia(), true);
+                       pushLanguageName(language()->polyglossia(), true);
                } else if (language()->encoding()->package() != Encoding::CJK) {
                        os << '{';
                        count += 1;
@@ -329,6 +329,8 @@ int Font::latexWriteStartChanges(odocstream & os, BufferParams const & bparams,
                                      "$$lang", language()->babel());
                        os << from_ascii(tmp);
                        count += tmp.length();
+                       if (!lyxrc.language_command_end.empty())
+                               pushLanguageName(language()->babel(), true);
                } else if (language()->encoding()->package() != Encoding::CJK) {
                        os << '{';
                        count += 1;
@@ -352,7 +354,7 @@ int Font::latexWriteStartChanges(odocstream & os, BufferParams const & bparams,
        if (!runparams.pass_thru && bits_.number() == FONT_ON
            && prev.fontInfo().number() != FONT_ON
            && (language()->lang() == "hebrew"
-               || language()->lang() == "farsi" 
+               || language()->lang() == "farsi"
                || language()->lang() == "arabic_arabi")) {
                os << "{\\beginL ";
                count += 9;
@@ -460,6 +462,7 @@ int Font::latexWriteEndChanges(otexstream & os, BufferParams const & bparams,
                                  OutputParams const & runparams,
                                  Font const & base,
                                  Font const & next,
+                                 bool & needPar,
                                  bool const & closeLanguage) const
 {
        int count = 0;
@@ -504,6 +507,11 @@ int Font::latexWriteEndChanges(otexstream & os, BufferParams const & bparams,
        if (f.size() != FONT_SIZE_INHERIT) {
                // We only have to close if only size changed
                if (!env) {
+                       if (needPar && !closeLanguage) {
+                               os << "\\par";
+                               count += 4;
+                               needPar = false;
+                       }
                        os << '}';
                        ++count;
                }
@@ -564,8 +572,11 @@ int Font::latexWriteEndChanges(otexstream & os, BufferParams const & bparams,
            && language()->encoding()->package() != Encoding::CJK) {
                os << '}';
                ++count;
-               if (runparams.use_polyglossia)
-                       popPolyglossiaLang();
+               bool const using_begin_end =
+                       runparams.use_polyglossia ||
+                               !lyxrc.language_command_end.empty();
+               if (using_begin_end)
+                       popLanguageName();
        }
 
        return count;