From 4ed8caaf1c9998800f94e3f111cd73b355c2315a Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Sat, 9 May 2015 15:30:10 +0200 Subject: [PATCH] Split different indices in the outliner Fixes: #7012. --- src/frontends/qt4/qt_helpers.cpp | 10 ++++++++++ src/insets/InsetIndex.cpp | 5 ++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/frontends/qt4/qt_helpers.cpp b/src/frontends/qt4/qt_helpers.cpp index bf869a3eeb..eb495f56fd 100644 --- a/src/frontends/qt4/qt_helpers.cpp +++ b/src/frontends/qt4/qt_helpers.cpp @@ -21,6 +21,7 @@ #include "BufferParams.h" #include "FloatList.h" +#include "IndicesList.h" #include "Language.h" #include "Length.h" #include "TextClass.h" @@ -618,6 +619,15 @@ QString guiName(string const & type, BufferParams const & bp) return qt_("Branches"); if (type == "change") return qt_("Changes"); + if (prefixIs(type, "index:")) { + string const itype = split(type, ':'); + IndicesList const & indiceslist = bp.indiceslist(); + Index const * index = indiceslist.findShortcut(from_utf8(itype)); + docstring indextype = _("unknown type!"); + if (index) + indextype = index->index(); + return toqstr(bformat(_("Index Entries (%1$s)"), indextype)); + } FloatList const & floats = bp.documentClass().floats(); if (floats.typeExist(type)) diff --git a/src/insets/InsetIndex.cpp b/src/insets/InsetIndex.cpp index a2539b00d7..9c722f9d09 100644 --- a/src/insets/InsetIndex.cpp +++ b/src/insets/InsetIndex.cpp @@ -353,8 +353,11 @@ void InsetIndex::addToToc(DocIterator const & cpit, bool output_active) const DocIterator pit = cpit; pit.push_back(CursorSlice(const_cast(*this))); docstring str; + string type = "index"; + if (buffer().masterBuffer()->params().use_indices) + type += ":" + to_utf8(params_.index); text().forOutliner(str, 0); - buffer().tocBackend().toc("index").push_back(TocItem(pit, 0, str, output_active)); + buffer().tocBackend().toc(type).push_back(TocItem(pit, 0, str, output_active)); // Proceed with the rest of the inset. InsetCollapsable::addToToc(cpit, output_active); }