]> git.lyx.org Git - lyx.git/blobdiff - src/Buffer.cpp
Cmake build:
[lyx.git] / src / Buffer.cpp
index b0db5c7136a4b906dea108c33dbd409561e9b322..8b052ad597021732130a7efb8f36aa819eca17d9 100644 (file)
@@ -1592,8 +1592,12 @@ void Buffer::writeLaTeXSource(otexstream & os,
 
                runparams.use_japanese = features.isRequired("japanese");
 
-               if (!output_body)
+               if (!output_body) {
+                       // Restore the parenthood if needed
+                       if (!runparams.is_child)
+                               d->ignore_parent = false;
                        return;
+               }
 
                // make the body.
                os << "\\begin{document}\n";
@@ -3303,7 +3307,7 @@ void Buffer::changeRefsIfUnique(docstring const & from, docstring const & to,
 
 void Buffer::getSourceCode(odocstream & os, string const format,
                           pit_type par_begin, pit_type par_end,
-                          OutputWhat output) const
+                          OutputWhat output, bool master) const
 {
        OutputParams runparams(&params().encoding());
        runparams.nice = true;
@@ -3350,8 +3354,8 @@ void Buffer::getSourceCode(odocstream & os, string const format,
                        // child of some other buffer, let's cut the link here,
                        // so that no concurring settings from the master
                        // (e.g. branch state) interfere (see #8101).
-                       // FIXME: Add an optional "from master" perspective.
-                       d->ignore_parent = true;
+                       if (!master)
+                               d->ignore_parent = true;
                        // We need to validate the Buffer params' features here
                        // in order to know if we should output polyglossia
                        // macros (instead of babel macros)
@@ -3369,7 +3373,8 @@ void Buffer::getSourceCode(odocstream & os, string const format,
                        latexParagraphs(*this, text(), ots, runparams);
 
                        // Restore the parenthood
-                       d->ignore_parent = false;
+                       if (!master)
+                               d->ignore_parent = false;
                }
        } else {
                os << "% ";
@@ -3404,6 +3409,8 @@ void Buffer::getSourceCode(odocstream & os, string const format,
                        d->texrow.newline();
                        d->texrow.newline();
                        otexstream ots(os, d->texrow);
+                       if (master)
+                               runparams.is_child = true;
                        writeLaTeXSource(ots, string(), runparams, output);
                }
        }