Abdelrazak Younes wrote: > Alfredo Braunstein wrote: > >> [*] in other words, if you iterate with DocIterator, the inset * member >> [of >> CUrsorSlice will never point to a tabular owned insettext but to the >> tabular inset. > > I didn't know that, thanks. But this is bad and inconsistent IMHO. We > should change that and implement a new virtual method in Inset:
It is inconsistent only if you think about InsetText as an inset. Think about InsetText as a helper class. It should probably change name (e.g. TextCell). It is comfortable to have it inside the Inset hierarchy in order to inherit from it in insets that have only one cell: it saves a great deal of forwarding... > /// \return the Inset at position idx or "this" if the Inset contains > /// no cell. > virtual Inset & cell(idx_type idx); I don't see where this would really help much (could you give some example in which it's useful?). Note that we have already something similar with DocIterator::Text() (there's 1 to 1 correspondence Text <-> InsetText) > I see that InsetMath already contains a cell() method which returns a > MathData. We should merge that with Inset::cell(); either by making > MathData a proper Inset or by returning the englobing InsetMathNest (I > am not sure there is one). My knowledge about the mathed hierarchy is feeble so I can't help you here... A/