mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 05:16:21 +00:00
Table cells are insets, but not from the point of view of DocIterators
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.
This commit is contained in:
parent
214f7ed262
commit
6a85db2307
@ -3432,6 +3432,12 @@ docstring InsetTableCell::asString(bool intoInsets)
|
||||
}
|
||||
|
||||
|
||||
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)
|
||||
|
@ -70,6 +70,8 @@ public:
|
||||
docstring asString(bool intoInsets = true);
|
||||
///
|
||||
docstring xhtml(XHTMLStream &, OutputParams const &) const;
|
||||
///
|
||||
void addToToc(DocIterator const & di, bool output_active) const;
|
||||
private:
|
||||
/// unimplemented
|
||||
InsetTableCell();
|
||||
|
@ -815,6 +815,13 @@ void InsetText::addToToc(DocIterator const & cdit, bool output_active) const
|
||||
{
|
||||
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();
|
||||
|
@ -217,6 +217,8 @@ protected:
|
||||
docstring getCaptionText(OutputParams const &) const;
|
||||
///
|
||||
docstring getCaptionHTML(OutputParams const &) const;
|
||||
///
|
||||
void iterateForToc(DocIterator const & cdit, bool output_active) const;
|
||||
private:
|
||||
///
|
||||
bool drawFrame_;
|
||||
|
Loading…
Reference in New Issue
Block a user