Georg Baum wrote:

> Am Sonntag, 14. November 2004 20:36 schrieb Alfredo Braunstein:
>> Acutally actcell_ *is* wrong, as we shouldn't store a view-dependent
> state
>> in the view-independent [wanna-be] data struct insettabular...
> 
> This explains why it is so difficult to get this data inside the inset ;-)
> 
>> Dunno what is the correct fix, as I'm not very familiar with the mailer
>> stuff. The fact is that we need a bufferview somehow: with that you can
> get
>> bv.cursor() and check if the cursor is in the tabular, then use
> the .idx()
>> if yes.
> 
> Would the following work?
> 
> - static int InsetTabularMailer::string2params(...)
> + static void InsetTabularMailer::string2params(...)
> 
> and then use kernel().bufferview() in the controller to get the cursor
> (and active cell). InsetTabularMailer::string2params is btw the only
> string2params that returns an int (the active cell), all others return
> nothing.
> We don't need the active cell with this solution in
> InsetTabularMailer::string2params() anymore.

Btw, please shout if you need a hand with the cursor stuff.

For "in" being the pointer to the tabular, you could do something like

LCursor & cur = bv.cursor();

int idx = -1;
for (unsigned i = 0; i < cur.size(); ++i)
        if (&cur[i].inset() == in)
                idx = cur[i].idx();

or some more elegant equivalent ;-)

Alfredo


Reply via email to