// e.g. \index{LyX@\LyX}, \index{text@\textbf{text}}
// Don't do that if the user entered '@' himself, though.
if (contains(ods.str(), '\\') && !contains(ods.str(), '@')) {
- if (InsetText::plaintext(os, runparams) > 0) {
+ odocstringstream odss;
+ if (InsetText::plaintext(odss, runparams) > 0) {
+ // remove remaining \'s for the sorting part
+ os << subst(odss.str(), from_ascii("\\"), docstring());
os << '@';
sorted = true;
}
}
-void InsetIndex::addToToc(ParConstIterator const & cpit) const
+void InsetIndex::addToToc(DocIterator const & cpit)
{
- ParConstIterator pit = cpit;
- pit.push_back(*this);
+ DocIterator pit = cpit;
+ pit.push_back(CursorSlice(*this));
Toc & toc = buffer().tocBackend().toc("index");
docstring str;