mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-03 08:28:25 +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
|
docstring InsetTableCell::xhtml(XHTMLStream & xs, OutputParams const & rp) const
|
||||||
{
|
{
|
||||||
if (!isFixedWidth)
|
if (!isFixedWidth)
|
||||||
|
@ -70,6 +70,8 @@ public:
|
|||||||
docstring asString(bool intoInsets = true);
|
docstring asString(bool intoInsets = true);
|
||||||
///
|
///
|
||||||
docstring xhtml(XHTMLStream &, OutputParams const &) const;
|
docstring xhtml(XHTMLStream &, OutputParams const &) const;
|
||||||
|
///
|
||||||
|
void addToToc(DocIterator const & di, bool output_active) const;
|
||||||
private:
|
private:
|
||||||
/// unimplemented
|
/// unimplemented
|
||||||
InsetTableCell();
|
InsetTableCell();
|
||||||
|
@ -815,6 +815,13 @@ void InsetText::addToToc(DocIterator const & cdit, bool output_active) const
|
|||||||
{
|
{
|
||||||
DocIterator dit = cdit;
|
DocIterator dit = cdit;
|
||||||
dit.push_back(CursorSlice(const_cast<InsetText &>(*this)));
|
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");
|
Toc & toc = buffer().tocBackend().toc("tableofcontents");
|
||||||
|
|
||||||
BufferParams const & bufparams = buffer_->params();
|
BufferParams const & bufparams = buffer_->params();
|
||||||
|
@ -217,6 +217,8 @@ protected:
|
|||||||
docstring getCaptionText(OutputParams const &) const;
|
docstring getCaptionText(OutputParams const &) const;
|
||||||
///
|
///
|
||||||
docstring getCaptionHTML(OutputParams const &) const;
|
docstring getCaptionHTML(OutputParams const &) const;
|
||||||
|
///
|
||||||
|
void iterateForToc(DocIterator const & cdit, bool output_active) const;
|
||||||
private:
|
private:
|
||||||
///
|
///
|
||||||
bool drawFrame_;
|
bool drawFrame_;
|
||||||
|
Loading…
Reference in New Issue
Block a user