Abdelrazak Younes wrote:

> Alfredo Braunstein wrote:
>> Abdelrazak Younes wrote:
>> 
>>>> Yes, they have meaning in tabulars (the only multi-text insets we
>>>> have),
>>>>
>>>> inset -> tabular
>>>> idx -> tabular cell
>>>> pit -> paragraph inside this cell
>>>> pos -> position inside the paragraph
>>> OK but I don't think this is a valid use of pit and pos in this case.
>>> One should use:
>>>
>>> idx -> tabular cell
>>> getText(idx).pit -> paragraph inside this cell
>>> getText(idx).pos -> position inside the paragraph
>>>
>>> using pit and pos as shortcuts is wrong IMHO.
>> 
>> I must confess I don't understand what are you talking about. What
>> shorcuts?
> 
> There should be another CursorSlice inside the cell pointing to the
> InsetText isn't it?
> 
> inset -> InsetText
> pit -> paragraph inside this text
> pos -> position inside the paragraph
> 
> If the CursorSlice points to an InsetTabular (i.e. inset -> tabular),
> pit and pos have no signification at all. Unless of course you assume
> that a cell is mandatorily an InsetText (which it is in our case). In
> this case pos and pit are really the pos and pit of the inner InsetText.
> That's why I call them shortcut.
> 
> Is that clearer? It is also possible that I don't understand this stuff
> as well as I think :-(

Yes, now it's clear thanks. In fact I was advocating for something like this
at some point when this decision was made (my impression was that in that
way one could flatten a bit the inheritance tree and this would mean
simplification). It was decided otherwise based on the state of the code at
that time, math unification, and other arguments. But this is not the
current code.

As the code stands, InsetText is not a real inset but rather a cell[*]. So a
tabular one has just one DocIterator level as I descibed:

inset -> tabular
idx -> tabular cell
pit -> paragraph inside this cell
pos -> position inside the paragraph

[*] 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.

>> Maybe the best would be to move the method to CursorSlice where it
>> belongs, there you don't have the constraint of keeping a valid cursor
>> position... In DocIterator now it's misleading because it's the only
>> forward* method that travels into an invalid cursor position...
> 
> good idea.

Don't worry, I can do this myself when I put my arse in gear ;-)

A/


Reply via email to