]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetInclude.cpp
Some things did not need to be mutable after all
[lyx.git] / src / insets / InsetInclude.cpp
index 3883d2267de8085c57a80317e90c03fa3e56ce5f..47c9a613436cb262818da8d226178b8c81b408c4 100644 (file)
@@ -36,6 +36,7 @@
 #include "output_plaintext.h"
 #include "output_xhtml.h"
 #include "OutputParams.h"
+#include "texstream.h"
 #include "TextClass.h"
 #include "TocBackend.h"
 
@@ -688,9 +689,9 @@ void InsetInclude::latex(otexstream & os, OutputParams const & runparams) const
                // and language.
                Encoding const * const oldEnc = runparams.encoding;
                Language const * const oldLang = runparams.master_language;
-               // If the master has full unicode flavor (XeTeX, LuaTeX),
+               // If the master uses non-TeX fonts (XeTeX, LuaTeX),
                // the children must be encoded in plain utf8!
-               runparams.encoding = runparams.isFullUnicode() ?
+               runparams.encoding = masterBuffer->params().useNonTeXFonts ?
                        encodings.fromLyXName("utf8-plain")
                        : &tmp->params().encoding();
                runparams.master_language = buffer().params().language;
@@ -1067,7 +1068,7 @@ void InsetInclude::fileChanged() const
                return;
 
        preview_->removePreview(*buffer);
-       add_preview(*preview_.get(), *this, *buffer);
+       add_preview(*preview_, *this, *buffer);
        preview_->startLoading(*buffer);
 }
 
@@ -1085,9 +1086,8 @@ bool preview_wanted(InsetCommandParams const & params, Buffer const & buffer)
 
 docstring latexString(InsetInclude const & inset)
 {
-       TexRow texrow;
        odocstringstream ods;
-       otexstream os(ods, texrow);
+       otexstream os(ods, false);
        // We don't need to set runparams.encoding since this will be done
        // by latex() anyway.
        OutputParams runparams(0);
@@ -1125,13 +1125,14 @@ void InsetInclude::addPreview(DocIterator const & /*inset_pos*/,
 }
 
 
-void InsetInclude::addToToc(DocIterator const & cpit, bool output_active) const
+void InsetInclude::addToToc(DocIterator const & cpit, bool output_active,
+                                                       UpdateType utype) const
 {
        TocBackend & backend = buffer().tocBackend();
 
        if (isListings(params())) {
                if (label_)
-                       label_->addToToc(cpit, output_active);
+                       label_->addToToc(cpit, output_active, utype);
 
                InsetListingsParams p(to_utf8(params()["lstparams"]));
                string caption = p.getParamValue("caption");
@@ -1151,8 +1152,7 @@ void InsetInclude::addToToc(DocIterator const & cpit, bool output_active) const
                docstring str = childbuffer->fileName().displayName();
                toc->push_back(TocItem(cpit, 0, str, output_active));
 
-               //TocList & toclist = backend.tocs();
-               childbuffer->tocBackend().update(output_active);
+               childbuffer->tocBackend().update(output_active, utype);
                TocList const & childtoclist = childbuffer->tocBackend().tocs();
                TocList::const_iterator it = childtoclist.begin();
                TocList::const_iterator const end = childtoclist.end();