from_utf8(incfile), true);
}
- FileName const writefile(makeAbsPath(mangled, masterBuffer->temppath()));
+ FileName const writefile(makeAbsPath(mangled, runparams.for_preview ?
+ buffer().temppath() : masterBuffer->temppath()));
LYXERR(Debug::LATEX, "incfile:" << incfile);
LYXERR(Debug::LATEX, "exportfile:" << exportfile);
// 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;
return;
preview_->removePreview(*buffer);
- add_preview(*preview_.get(), *this, *buffer);
+ add_preview(*preview_, *this, *buffer);
preview_->startLoading(*buffer);
}
// by latex() anyway.
OutputParams runparams(0);
runparams.flavor = OutputParams::LATEX;
+ runparams.for_preview = true;
inset.latex(os, runparams);
return ods.str();
}
-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");
if (caption.empty())
return;
- Toc & toc = backend.toc("listing");
- docstring str = convert<docstring>(toc.size() + 1)
+ shared_ptr<Toc> toc = backend.toc("listing");
+ docstring str = convert<docstring>(toc->size() + 1)
+ ". " + from_utf8(caption);
DocIterator pit = cpit;
- toc.push_back(TocItem(pit, 0, str, output_active));
- return;
- }
- Buffer const * const childbuffer = getChildBuffer();
- if (!childbuffer)
- return;
+ toc->push_back(TocItem(pit, 0, str, output_active));
+ } else {
+ Buffer const * const childbuffer = getChildBuffer();
+ if (!childbuffer)
+ return;
- Toc & toc = backend.toc("child");
- docstring str = childbuffer->fileName().displayName();
- toc.push_back(TocItem(cpit, 0, str, output_active));
-
- TocList & toclist = backend.tocs();
- childbuffer->tocBackend().update(output_active);
- TocList const & childtoclist = childbuffer->tocBackend().tocs();
- TocList::const_iterator it = childtoclist.begin();
- TocList::const_iterator const end = childtoclist.end();
- for(; it != end; ++it)
- toclist[it->first].insert(toclist[it->first].end(),
- it->second.begin(), it->second.end());
+ shared_ptr<Toc> toc = backend.toc("child");
+ docstring str = childbuffer->fileName().displayName();
+ toc->push_back(TocItem(cpit, 0, str, 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();
+ for(; it != end; ++it) {
+ shared_ptr<Toc> toc = backend.toc(it->first);
+ toc->insert(toc->end(), it->second->begin(), it->second->end());
+ }
+ }
}