diff --git a/src/insets/InsetIndex.cpp b/src/insets/InsetIndex.cpp index f5a1e4d306..398281d2a2 100644 --- a/src/insets/InsetIndex.cpp +++ b/src/insets/InsetIndex.cpp @@ -165,19 +165,12 @@ void InsetIndex::write(ostream & os) const } -void InsetIndex::textString(odocstream & os) const -{ - os << text().asString(0, 1, AS_STR_LABEL | AS_STR_INSETS); -} - - void InsetIndex::addToToc(DocIterator const & cpit) { DocIterator pit = cpit; pit.push_back(CursorSlice(*this)); - odocstringstream ods; - textString(ods); - buffer().tocBackend().toc("index").push_back(TocItem(pit, 0, ods.str())); + docstring const item = text().asString(0, 1, AS_STR_LABEL | AS_STR_INSETS); + buffer().tocBackend().toc("index").push_back(TocItem(pit, 0, item)); // Proceed with the rest of the inset. InsetCollapsable::addToToc(cpit); } diff --git a/src/insets/InsetIndex.h b/src/insets/InsetIndex.h index 4391c4f003..5f4492884f 100644 --- a/src/insets/InsetIndex.h +++ b/src/insets/InsetIndex.h @@ -45,8 +45,6 @@ private: /// should the user be allowed to customize alignment, etc.? virtual bool allowParagraphCustomization(idx_type = 0) const { return false; } /// - void textString(odocstream &) const; - /// void addToToc(DocIterator const &); /// Inset * clone() const { return new InsetIndex(*this); }