On Fri, Jul 01, 2005 at 11:43:45PM +0300, Martin Vermeer wrote:
> OK, I see it now: idx_type should be a struct with two int members, .row
> and .col. And suitable operator definitions added. No duplication of
> information, and still "idx() = ..." will work. Does that sound like a 
> plan?

I still don't think so. idx_ is just an integer offset in the cell
vector. These cells may be laid out in a grid as in, well, a
MathGridInset, or even a MathFracInset, but do not have to (as shown
by e.g. MathSqrtInset).

This single-number idx member is chosen as primary information as it is
directly useful when accessing the cell vector.

For grid-like structures it is sometimes convienient to extract row and
col from idx. So there are some helper functions. And sometimes it is
useful to give the user the impression that row and col are primary
because that's what the user expects if he e.g. works in grids. In this 
situation we just adjust the idx. You found places where this adjsutment
was not or not properly done. But that means just that: The adjustment
is wrong, not the scheme.

You propose to make row and col primary information but that does not
fit well into the current scheme. We'd need to compute idx ach time we
access the cell vector. For some insets like sqrt it would not even be
clear what values for row and col are permissable etc.

Andre'

Reply via email to