}
MenuDefinition other_lists;
- TocList const & toc_list = buf->tocBackend().tocs();
- TocList::const_iterator cit = toc_list.begin();
- TocList::const_iterator end = toc_list.end();
- for (; cit != end; ++cit) {
+ // In the navigation menu, only add tocs from this document
+ TocBackend const & backend = buf->tocBackend();
+ TocList const & toc_list = backend.tocs();
+ for (pair<string, shared_ptr<Toc>> const & toc : toc_list) {
// Handle table of contents later
- if (cit->first == "tableofcontents" || cit->second->empty())
+ if (toc.first == "tableofcontents" || toc.second->empty())
continue;
MenuDefinition submenu;
- submenu.expandTocSubmenu(cit->first, *cit->second);
- MenuItem item(MenuItem::Submenu, guiName(cit->first, buf->params()));
+ submenu.expandTocSubmenu(toc.first, *toc.second);
+ docstring const toc_name = backend.outlinerName(toc.first);
+ MenuItem item(MenuItem::Submenu, toqstr(toc_name));
item.setSubmenu(submenu);
// deserves to be in the main menu?
- if (!TocBackend::isOther(cit->first))
+ if (!TocBackend::isOther(toc.first))
add(item);
else
other_lists.add(item);
}
// Handle normal TOC
add(MenuItem(MenuItem::Separator));
- cit = toc_list.find("tableofcontents");
- if (cit == end)
+ TocList::const_iterator cit = toc_list.find("tableofcontents");
+ if (cit == toc_list.end())
LYXERR(Debug::GUI, "No table of contents.");
else {
if (!cit->second->empty())
static_cast<InsetCitation const *>(inset);
Buffer const * buf = &bv->buffer();
- BufferParams const & bp = buf->params();
+ BufferParams const & bp = buf->masterParams();
string const cmd = citinset->params().getCmdName();
docstring const & key = citinset->getParam("key");
vector<docstring> const keys = getVectorFromString(key);
- vector<CitationStyle> const citeStyleList = buf->params().citeStyles();
+ vector<CitationStyle> const citeStyleList = bp.citeStyles();
+
+ CitationStyle cs = citinset->getCitationStyle(bp, cmd, citeStyleList);
+ bool const qualified = cs.hasQualifiedList
+ && (keys.size() > 1
+ || !citinset->getParam("pretextlist").empty()
+ || !citinset->getParam("posttextlist").empty());
+ std::map<docstring, docstring> pres =
+ citinset->getQualifiedLists(citinset->getParam("pretextlist"));
+ std::map<docstring, docstring> posts =
+ citinset->getQualifiedLists(citinset->getParam("posttextlist"));
+
CiteItem ci;
ci.textBefore = citinset->getParam("before");
ci.textAfter = citinset->getParam("after");
ci.Starred = star;
ci.context = CiteItem::Dialog;
ci.max_size = 40;
+ ci.isQualified = qualified;
+ ci.pretexts = pres;
+ ci.posttexts = posts;
vector<docstring> citeStrings =
buf->masterBibInfo().getCiteStrings(keys, citeStyleList, bv->buffer(), ci);
"changetype " + from_utf8(citationStyleToString(cs)))));
}
- // Extra features of the citation styles
- CitationStyle cs = citinset->getCitationStyle(bp, cmd, citeStyleList);
-
if (cs.hasStarredVersion) {
docstring starred = _("All authors|h");
// Check if we have a custom string/tooltip for the starred version
for (pair<docstring, InsetLayout> const & il : dc.insetLayouts()) {
docstring instype;
docstring const type = split(il.first, instype, ':');
- if (instype == "Caption") {
+ if (instype == from_ascii("Caption")) {
// skip forbidden caption types
FuncRequest const cmd = switchcap
? FuncRequest(LFUN_INSET_MODIFY, from_ascii("changetype ") + type)