Re: how to get current cell in insettabular?

2004-11-18 Thread Georg Baum
Alfredo Braunstein wrote: > Seems ok to me. So if it works, I'd shove it in, as it fixes a major bug > in tabulars. Very minor nitpick: I'd eliminate "cell" altogheter and just > set active_cell_ = cur[i].idx() inside the loop. Done. Georg

Re: how to get current cell in insettabular?

2004-11-17 Thread Alfredo Braunstein
Georg Baum wrote: > Am Dienstag, 16. November 2004 03:47 schrieb Alfredo Braunstein: >> Georg Baum wrote: >> > Is the attached patch ok? >> >> No, seems like you picked the wrong patch ;-) > > Ok, second try. It was obviously too late ;-) Seems ok to me. So if it works, I'd shove it in, as it f

Re: how to get current cell in insettabular?

2004-11-16 Thread Georg Baum
Am Dienstag, 16. November 2004 03:47 schrieb Alfredo Braunstein: > Georg Baum wrote: > > Is the attached patch ok? > > No, seems like you picked the wrong patch ;-) Ok, second try. It was obviously too late ;-) Georg diff -p -r -U 3 -X excl.tmp lyx-1.4-clean/src/frontends/controllers/ChangeLog

Re: how to get current cell in insettabular?

2004-11-15 Thread Alfredo Braunstein
Georg Baum wrote: > Am Montag, 15. November 2004 15:05 schrieb Alfredo Braunstein: >> I thought that dialogs were associated with insets somehow. No idea > how ;-) > > The only connection I found so far is parameter exchange via the mailers > in string form. Right. In fact the "association" woul

Re: how to get current cell in insettabular?

2004-11-15 Thread Georg Baum
Am Montag, 15. November 2004 15:05 schrieb Alfredo Braunstein: > I thought that dialogs were associated with insets somehow. No idea how ;-) The only connection I found so far is parameter exchange via the mailers in string form. > We could just apply the change to the most inner InsetTabular.

Re: how to get current cell in insettabular?

2004-11-15 Thread Alfredo Braunstein
Alfredo Braunstein wrote: > Something like > > for (unsigned i = cur.size() - 1; i >= 0; --i) > ifÂ(cur[i].inset().lyxCode()Â==ÂInsetBase::TABULAR_CODE) { > in = cur[i].inset(); > idxÂ=Âcur[i].idx(); > ... > } Better use a ">" or an int and a

Re: how to get current cell in insettabular?

2004-11-15 Thread Alfredo Braunstein
Georg Baum wrote: > Alfredo Braunstein wrote: > >> Btw, please shout if you need a hand with the cursor stuff. > > I don't understand it, but I figured out that I somehow need idx(), and > that is enough for now. > >> For "in" being the pointer to the tabular, you could do something like > > T

Re: how to get current cell in insettabular?

2004-11-15 Thread Georg Baum
Alfredo Braunstein wrote: > Btw, please shout if you need a hand with the cursor stuff. I don't understand it, but I figured out that I somehow need idx(), and that is enough for now. > For "in" being the pointer to the tabular, you could do something like The problem is now: How to get "in" fr

Re: how to get current cell in insettabular?

2004-11-14 Thread Andre Poenitz
On Sun, Nov 14, 2004 at 08:36:50PM +0100, Alfredo Braunstein wrote: > Andre Poenitz wrote: > > > Is the cursor in the cell if we call this code? If so, we'd take the > > idx() of the correct slice. If not, the 'easy' way out would be to > > revive 'actcell_', even if I don't like it. > > Acutally

Re: how to get current cell in insettabular?

2004-11-14 Thread Alfredo Braunstein
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 th

Re: how to get current cell in insettabular?

2004-11-14 Thread Alfredo Braunstein
Georg Baum wrote: > 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 th

Re: how to get current cell in insettabular?

2004-11-14 Thread Georg Baum
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

Re: how to get current cell in insettabular?

2004-11-14 Thread Alfredo Braunstein
Andre Poenitz wrote: > Is the cursor in the cell if we call this code? If so, we'd take the > idx() of the correct slice. If not, the 'easy' way out would be to > revive 'actcell_', even if I don't like it. Acutally actcell_ *is* wrong, as we shouldn't store a view-dependent state in the view-ind

Re: how to get current cell in insettabular?

2004-11-14 Thread Georg Baum
Am Sonntag, 14. November 2004 08:45 schrieb Andre Poenitz: > Is the cursor in the cell if we call this code? If so, we'd take the > idx() of the correct slice. If not, the 'easy' way out would be to > revive 'actcell_', even if I don't like it. It is in the tabular cell (otherwise we have no curre

Re: how to get current cell in insettabular?

2004-11-14 Thread Andre Poenitz
On Sat, Nov 13, 2004 at 10:16:52PM +0100, Georg Baum wrote: > André, > > this code in InsetTabularMailer::params2string(): > > #ifdef WITH_WARNINGS > #warning wrong! > #endif > //data << name_ << " \\active_cell " << inset.getActCell() << '\n'; > data << name_ << " \\active_cell " << 0 << '\n';

Re: how to get current cell in insettabular?

2004-11-13 Thread Alfredo Braunstein
Georg Baum wrote: > #ifdef WITH_WARNINGS > #warning wrong! > #endif > //data << name_ << " \\active_cell " << inset.getActCell() << '\n'; > data << name_ << " \\active_cell " << 0 << '\n'; > > is responsible for wrong cell information in the qt tabular dialog. You > removed the actcell member o

how to get current cell in insettabular?

2004-11-13 Thread Georg Baum
André, this code in InsetTabularMailer::params2string(): #ifdef WITH_WARNINGS #warning wrong! #endif //data << name_ << " \\active_cell " << inset.getActCell() << '\n'; data << name_ << " \\active_cell " << 0 << '\n'; is responsible for wrong cell information in the qt tabular dialog. You rem