Re: r30602 - lyx-devel/trunk/src/insets

2009-08-03 Thread Abdelrazak Younes
Jean-Marc Lasgouttes wrote: Abdelrazak Younes writes: This is (1) irrelevant to the discussion Well, provided that Inset has a buffer_ member, this will at least solve the problem of Buffer access in Paragraph ;-) Except that paragraph already has buffer access. No, becau

Re: r30602 - lyx-devel/trunk/src/insets

2009-08-03 Thread Jean-Marc Lasgouttes
Abdelrazak Younes writes: >> This is (1) irrelevant to the discussion > > Well, provided that Inset has a buffer_ member, this will at least > solve the problem of Buffer access in Paragraph ;-) Except that paragraph already has buffer access. >> and (2) not a good idea since >> this mixes vert

Re: r30602 - lyx-devel/trunk/src/insets

2009-08-03 Thread Abdelrazak Younes
Jean-Marc Lasgouttes wrote: Abdelrazak Younes writes: But I would go much farther: Paragraph should inherit Inset. This is (1) irrelevant to the discussion Well, provided that Inset has a buffer_ member, this will at least solve the problem of Buffer access in Paragraph ;-) and

Re: r30602 - lyx-devel/trunk/src/insets

2009-08-03 Thread Jean-Marc Lasgouttes
Abdelrazak Younes writes: > But I would go much farther: Paragraph should inherit Inset. This is (1) irrelevant to the discussion and (2) not a good idea since this mixes vertical mode and horizontal mode. We could however have specialized versions of Paragraph for some uses. But we had this dis

Re: r30602 - lyx-devel/trunk/src/insets

2009-08-03 Thread Jean-Marc Lasgouttes
"Vincent van Ravesteijn - TNW" writes: > Paragraph has a member function setBuffer(Buffer & b) which sets the > buffer member of all Insets. Paragraph itself has no Buffer member > whatsoever. I'd think that if something would be related to the buffer, > a paragraph would be one of the closest. >

Re: r30602 - lyx-devel/trunk/src/insets

2009-08-03 Thread Abdelrazak Younes
Vincent van Ravesteijn - TNW wrote: However, not having a buffer() member for some sorts of insets complicates the rest of the code. I noticed the following: Paragraph has a member function setBuffer(Buffer & b) which sets the buffer member of all Insets. Paragraph itself has no Buffer me

RE: r30602 - lyx-devel/trunk/src/insets

2009-08-03 Thread Vincent van Ravesteijn - TNW
> However, not having a buffer() member for some sorts > of insets complicates the rest of the code. I noticed the following: Paragraph has a member function setBuffer(Buffer & b) which sets the buffer member of all Insets. Paragraph itself has no Buffer member whatsoever. I'd think that if somet

Re: r30602 - lyx-devel/trunk/src/insets

2009-08-03 Thread Jean-Marc Lasgouttes
Andre Poenitz writes: > At the time it was a conscious decision to not have a buffer_ member > in math, as we have one inset per character (if not more) in math > and the additional member was heavier than in text where usually > an inset contains several dozen or hundreds char. > > Now the situa

Re: r30602 - lyx-devel/trunk/src/insets

2009-08-03 Thread Andre Poenitz
On Sat, Aug 01, 2009 at 11:45:25PM +0200, Jean-Marc Lasgouttes wrote: > Le 01/08/2009 18:29, Abdelrazak Younes a écrit : >> In case this question was left unanswered, we don't want a buffer_ >> member in InsetMathChar because this sucks 4 bytes of memory for each >> inset. And, AFAICS, there's no n

Re: r30602 - lyx-devel/trunk/src/insets

2009-08-02 Thread Abdelrazak Younes
On 01/08/2009 23:45, Jean-Marc Lasgouttes wrote: Le 01/08/2009 18:29, Abdelrazak Younes a écrit : In case this question was left unanswered, we don't want a buffer_ member in InsetMathChar because this sucks 4 bytes of memory for each inset. And, AFAICS, there's no need to access the Buffer in a

Re: r30602 - lyx-devel/trunk/src/insets

2009-08-01 Thread Jean-Marc Lasgouttes
Le 01/08/2009 18:29, Abdelrazak Younes a écrit : In case this question was left unanswered, we don't want a buffer_ member in InsetMathChar because this sucks 4 bytes of memory for each inset. And, AFAICS, there's no need to access the Buffer in an InsetMathChar. First, removing a setBuffer met

Re: r30602 - lyx-devel/trunk/src/insets

2009-08-01 Thread Abdelrazak Younes
On 15/07/2009 18:16, rgheck wrote: Well, the problem here is that InsetMathChar *explicitly* doesn't have its buffer_ set. Abdel did this at r23362, with the message: "We don't want a buffer_ member in InsetMathChar." But I don't know why we wouldn't. In any event, if one removes the lines he a

Re: r30602 - lyx-devel/trunk/src/insets

2009-07-15 Thread rgheck
On 07/15/2009 01:19 PM, Jean-Marc Lasgouttes wrote: Well, the problem here is that InsetMathChar *explicitly* doesn't have its buffer_ set. Abdel did this at r23362, with the message: "We don't want a buffer_ member in InsetMathChar." But I don't know why we wouldn't. In any event, if one remov

Re: r30602 - lyx-devel/trunk/src/insets

2009-07-15 Thread Jean-Marc Lasgouttes
Le 15 juil. 09 à 19:23, Vincent van Ravesteijn - TNW a écrit : Anyway, I propose to commit the attached and see what happens. It looks very good, especially since adding an empty setBuffer does not remove the buffer_ member which is inherited... Adding ? Bah. Adding, removing, it is always

RE: r30602 - lyx-devel/trunk/src/insets

2009-07-15 Thread Vincent van Ravesteijn - TNW
>> >> Anyway, I propose to commit the attached and see what happens. > >It looks very good, especially since adding an empty >setBuffer does not remove the buffer_ member which is >inherited... Adding ? >Please apply, and change the assertion from >+ LASSERT(cur.buffer() == &buffer(), return

Re: r30602 - lyx-devel/trunk/src/insets

2009-07-15 Thread Jean-Marc Lasgouttes
Well, the problem here is that InsetMathChar *explicitly* doesn't have its buffer_ set. Abdel did this at r23362, with the message: "We don't want a buffer_ member in InsetMathChar." But I don't know why we wouldn't. In any event, if one removes the lines he added there, then the crash goes

Re: r30602 - lyx-devel/trunk/src/insets

2009-07-15 Thread rgheck
On 07/15/2009 11:02 AM, Vincent van Ravesteijn - TNW wrote: Is it possible that the Buffer is being *copied* somewhere in the mouse code? Since this is checking for the same address, that would do it. When it crashes the Inset::buffer_ is 0. Unfortunately, I hav

Re: r30602 - lyx-devel/trunk/src/insets

2009-07-15 Thread Jean-Marc Lasgouttes
"Vincent van Ravesteijn - TNW" writes: > If Inset::buffer_ is 0, then you'd expect an assert in Inset::buffer() > > So, if we get an assert in Inset::dispatch, it comes from cur.buffer() > ... No the code is this: void Inset::dispatch(Cursor & cur, FuncRequest & cmd) { //LASSERT(cur.buf

RE: r30602 - lyx-devel/trunk/src/insets

2009-07-15 Thread Vincent van Ravesteijn - TNW
>>> >> Is it possible that the Buffer is being *copied* somewhere in the >> mouse code? Since this is checking for the same address, that would do >> it. > >When it crashes the Inset::buffer_ is 0. Unfortunately, I have >not been able to find out what inset this is. Try to uncomment >the ass

Re: r30602 - lyx-devel/trunk/src/insets

2009-07-15 Thread Jean-Marc Lasgouttes
rgheck writes: > On 07/15/2009 09:53 AM, lasgout...@lyx.org wrote: >> Author: lasgouttes >> Date: Wed Jul 15 15:53:26 2009 >> New Revision: 30602 >> URL: http://www.lyx.org/trac/changeset/30602 >> >> Log: >> comment out assertion enabled in r30540. It triggered when entering a math >> inset with

Re: r30602 - lyx-devel/trunk/src/insets

2009-07-15 Thread rgheck
On 07/15/2009 09:53 AM, lasgout...@lyx.org wrote: Author: lasgouttes Date: Wed Jul 15 15:53:26 2009 New Revision: 30602 URL: http://www.lyx.org/trac/changeset/30602 Log: comment out assertion enabled in r30540. It triggered when entering a math inset with the mouse. I have not been able to unde