Split different indices in the outliner

Fixes: #7012.
This commit is contained in:
Juergen Spitzmueller 2015-05-09 15:30:10 +02:00
parent 760b7cf2b6
commit 4ed8caaf1c
2 changed files with 14 additions and 1 deletions

View File

@ -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))

View File

@ -353,8 +353,11 @@ void InsetIndex::addToToc(DocIterator const & cpit, bool output_active) const
DocIterator pit = cpit;
pit.push_back(CursorSlice(const_cast<InsetIndex &>(*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);
}