]> git.lyx.org Git - features.git/commitdiff
fix bug #8209: polyglossia commands ignored partial source preview
authorJuergen Spitzmueller <spitz@lyx.org>
Thu, 28 Jun 2012 16:15:43 +0000 (18:15 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Thu, 28 Jun 2012 16:15:43 +0000 (18:15 +0200)
src/Buffer.cpp

index 437a64a7db8312181ef6cdad65ca7612f48d85fc..b6d9da14ae4480d699bcba0259c4ff6f4069d6be 100644 (file)
@@ -1473,6 +1473,7 @@ void Buffer::writeLaTeXSource(otexstream & os,
        LYXERR(Debug::LATEX, "  Validating buffer...");
        LaTeXFeatures features(*this, params(), runparams);
        validate(features);
+       runparams.use_polyglossia = features.usePolyglossia();
        LYXERR(Debug::LATEX, "  Buffer validation done.");
 
        bool const output_preamble =
@@ -1570,7 +1571,6 @@ void Buffer::writeLaTeXSource(otexstream & os,
                MacroSet parentMacros;
                listParentMacros(parentMacros, features);
 
-               runparams.use_polyglossia = features.usePolyglossia();
                // Write the preamble
                runparams.use_babel = params().writeLaTeX(os, features,
                                                          d->filename.onlyPath());
@@ -3336,6 +3336,12 @@ void Buffer::getSourceCode(odocstream & os, string const format,
                } else if (params().isDocBook()) {
                        docbookParagraphs(text(), *this, os, runparams);
                } else {
+                       // We need to validate the Buffer params' features here
+                       // in order to know if we should output polyglossia
+                       // macros (instead of babel macros)
+                       LaTeXFeatures features(*this, params(), runparams);
+                       params().validate(features);
+                       runparams.use_polyglossia = features.usePolyglossia();
                        TexRow texrow;
                        texrow.reset();
                        texrow.newline();