and Cursors. So just calling InsetText::addToToc for the cells causes
problems, because InsetText::addToToc then adds the cell inset itself
as part of the DocIterator. This then leads to assertions, such as bug
The solution is to refactor InsetText::addToToc so that we can call the
iterating part without adding the inset.
+void InsetTableCell::addToToc(DocIterator const & di, bool output_active) const
+{
+ InsetText::iterateForToc(di, output_active);
+}
+
+
docstring InsetTableCell::xhtml(XHTMLStream & xs, OutputParams const & rp) const
{
if (!isFixedWidth)
docstring InsetTableCell::xhtml(XHTMLStream & xs, OutputParams const & rp) const
{
if (!isFixedWidth)
docstring asString(bool intoInsets = true);
///
docstring xhtml(XHTMLStream &, OutputParams const &) const;
docstring asString(bool intoInsets = true);
///
docstring xhtml(XHTMLStream &, OutputParams const &) const;
+ ///
+ void addToToc(DocIterator const & di, bool output_active) const;
private:
/// unimplemented
InsetTableCell();
private:
/// unimplemented
InsetTableCell();
{
DocIterator dit = cdit;
dit.push_back(CursorSlice(const_cast<InsetText &>(*this)));
{
DocIterator dit = cdit;
dit.push_back(CursorSlice(const_cast<InsetText &>(*this)));
+ iterateForToc(dit, output_active);
+}
+
+
+void InsetText::iterateForToc(DocIterator const & cdit, bool output_active) const
+{
+ DocIterator dit = cdit;
Toc & toc = buffer().tocBackend().toc("tableofcontents");
BufferParams const & bufparams = buffer_->params();
Toc & toc = buffer().tocBackend().toc("tableofcontents");
BufferParams const & bufparams = buffer_->params();
docstring getCaptionText(OutputParams const &) const;
///
docstring getCaptionHTML(OutputParams const &) const;
docstring getCaptionText(OutputParams const &) const;
///
docstring getCaptionHTML(OutputParams const &) const;
+ ///
+ void iterateForToc(DocIterator const & cdit, bool output_active) const;
private:
///
bool drawFrame_;
private:
///
bool drawFrame_;