Re: [PATCH] Bug 2727: LyX crashes when undoing super/subscript deletion

2006-08-19 Thread Jean-Marc Lasgouttes
> "Andre" == Andre Poenitz <[EMAIL PROTECTED]> writes: >> - in MathScriptInset::notifyCursorLeave, there were no >> recordUndoInset calls. This fix seems safe and obvious to me Andre> Worst case scenario is that an additional C-z is needed to undo Andre> stuff. Could be mildly annoying if it

Re: [PATCH] Bug 2727: LyX crashes when undoing super/subscript deletion

2006-08-19 Thread Andre Poenitz
On Mon, Aug 14, 2006 at 05:21:49PM +0200, Jean-Marc Lasgouttes wrote: > > The following patch fixes this bug for me. However I have questions > about whether I did it right. > > There are 3 mostly independent parts in the patch: > > - in MathScriptInset::notifyCursorLeave, there were no recordUn

Re: [PATCH] Bug 2727: LyX crashes when undoing super/subscript deletion

2006-08-19 Thread Andre Poenitz
On Wed, Aug 16, 2006 at 04:44:34AM +0200, Enrico Forestieri wrote: > On Mon, Aug 14, 2006 at 05:21:49PM +0200, Jean-Marc Lasgouttes wrote: > > > The following patch fixes this bug for me. > > Indeed, the crash is gone. However, after applying this patch I still > observe a weird behavior which ma

Re: [PATCH] Bug 2727: LyX crashes when undoing super/subscript deletion

2006-08-18 Thread Jean-Marc Lasgouttes
> "Enrico" == Enrico Forestieri <[EMAIL PROTECTED]> writes: Enrico> On Thu, Aug 17, 2006 at 09:55:09PM +0200, Jean-Marc Lasgouttes Enrico> wrote: >> OK, this new patch fixes this problem too. Enrico> This is excellent, JMarc! Enrico> I was not able to trigger any weird behavior and I like a

Re: [PATCH] Bug 2727: LyX crashes when undoing super/subscript deletion

2006-08-17 Thread Enrico Forestieri
On Thu, Aug 17, 2006 at 09:55:09PM +0200, Jean-Marc Lasgouttes wrote: > OK, this new patch fixes this problem too. This is excellent, JMarc! I was not able to trigger any weird behavior and I like a lot the automatic removal/addition of the brace inset. An improvement over a bug fix, IMHO. --

Re: [PATCH] Bug 2727: LyX crashes when undoing super/subscript deletion

2006-08-17 Thread Jean-Marc Lasgouttes
> "Jean-Marc" == Jean-Marc Lasgouttes <[EMAIL PROTECTED]> writes: I applied all the bits except for this latest patch. I attach the remaining bits. Jean-Marc> OK, this new patch fixes this problem too. There are two Jean-Marc> parts: Jean-Marc> - easy one: export x^2, but {xy}^2 and {x^{2}}^

Re: [PATCH] Bug 2727: LyX crashes when undoing super/subscript deletion

2006-08-17 Thread Jean-Marc Lasgouttes
> "Enrico" == Enrico Forestieri <[EMAIL PROTECTED]> writes: Enrico> This patch fixes it. However, as I am a bad guy, I found Enrico> another problem ;-) (I wish I have a better grasp of the Enrico> sources such that to be helpful instead of simply reporting Enrico> misbehavior) Enrico> With t

Re: [PATCH] Bug 2727: LyX crashes when undoing super/subscript deletion

2006-08-17 Thread Juergen Spitzmueller
Jean-Marc Lasgouttes wrote: > Yes, probably. I am not sure whether the part that deals with script > insets is still useful (but it may). I leave it to you, since you have your hands in the code nevertheless, and I'm leaving for holidays the day after tomorrow. Jürgen

Re: [PATCH] Bug 2727: LyX crashes when undoing super/subscript deletion

2006-08-17 Thread Jean-Marc Lasgouttes
> "Enrico" == Enrico Forestieri <[EMAIL PROTECTED]> writes: Enrico> This patch fixes it. However, as I am a bad guy, I found Enrico> another problem ;-) (I wish I have a better grasp of the Enrico> sources such that to be helpful instead of simply reporting Enrico> misbehavior) I am glad to s

Re: [PATCH] Bug 2727: LyX crashes when undoing super/subscript deletion

2006-08-17 Thread Jean-Marc Lasgouttes
> "Georg" == Georg Baum <[EMAIL PROTECTED]> writes: >> Stylistic complaints, or LaTeX errors? Georg> The former. "\sum_{}xxx" works fine and gives the same output Georg> as "\sum xxx", but I would not be surprised if that would be Georg> different with other bases than \sum. Since it is vis

Re: [PATCH] Bug 2727: LyX crashes when undoing super/subscript deletion

2006-08-17 Thread Jean-Marc Lasgouttes
> "Juergen" == Juergen Spitzmueller <[EMAIL PROTECTED]> writes: Juergen> Jean-Marc Lasgouttes wrote: >> -void MathNestInset::notifyCursorLeaves(LCursor & cur) +bool >> MathNestInset::notifyCursorLeaves(LCursor & cur)  {  #ifdef >> WITH_WARNINGS  #warning look here @@ -373,6 +373,7 @@ void >> M

Re: [PATCH] Bug 2727: LyX crashes when undoing super/subscript deletion

2006-08-17 Thread Juergen Spitzmueller
Jean-Marc Lasgouttes wrote: > -void MathNestInset::notifyCursorLeaves(LCursor & cur) > +bool MathNestInset::notifyCursorLeaves(LCursor & cur) >  { >  #ifdef WITH_WARNINGS >  #warning look here > @@ -373,6 +373,7 @@ void MathNestInset::notifyCursorLeaves(L > } > } >  #endif >

Re: [PATCH] Bug 2727: LyX crashes when undoing super/subscript deletion

2006-08-17 Thread Georg Baum
Jean-Marc Lasgouttes wrote: >> "Georg" == Georg Baum >> <[EMAIL PROTECTED]> >> writes: > > Georg> IIRC we have that in bugzilla. > > Part of this one? > http://bugzilla.lyx.org/show_bug.cgi?id=2582 I think so, but am not sure. > I did not know we has so many bugs about scriptinset.

Re: [PATCH] Bug 2727: LyX crashes when undoing super/subscript deletion

2006-08-17 Thread Jean-Marc Lasgouttes
> "Jean-Marc" == Jean-Marc Lasgouttes <[EMAIL PROTECTED]> writes: Jean-Marc> If I click outside of the math inset LyX crashes :) I'll Jean-Marc> have a look. This update patch fixes the problem by making notifyCursorLeaves return true if cursor is not invalid. I also changed recordUndoInset t

Re: [PATCH] Bug 2727: LyX crashes when undoing super/subscript deletion

2006-08-17 Thread Enrico Forestieri
On Thu, Aug 17, 2006 at 01:13:37PM +0200, Jean-Marc Lasgouttes wrote: > OK, I see it indeed. What happens is that, when the script inset > deletes its superscript, all that remains is a script inset with only > one cell. Any undo concerning this inset will contain only the script > "x", which is p

Re: [PATCH] Bug 2727: LyX crashes when undoing super/subscript deletion

2006-08-17 Thread Jean-Marc Lasgouttes
> "Georg" == Georg Baum <[EMAIL PROTECTED]> writes: Georg> Jean-Marc Lasgouttes wrote: >> Actually, when it does not have any script, the script inset should >> commit suicide and replace itself with its contents. Georg> IIRC we have that in bugzilla. Part of this one? http://bugzilla.lyx.or

Re: [PATCH] Bug 2727: LyX crashes when undoing super/subscript deletion

2006-08-17 Thread Georg Baum
Jean-Marc Lasgouttes wrote: > Actually, when it does not have any script, the script inset should > commit suicide and replace itself with its contents. IIRC we have that in bugzilla. > This is what this > updated patch does. I checked that it works and valgrind does not > complain. > > Please

Re: [PATCH] Bug 2727: LyX crashes when undoing super/subscript deletion

2006-08-17 Thread Jean-Marc Lasgouttes
> "Enrico" == Enrico Forestieri <[EMAIL PROTECTED]> writes: Enrico> On Mon, Aug 14, 2006 at 05:21:49PM +0200, Jean-Marc Lasgouttes Enrico> wrote: >> The following patch fixes this bug for me. Enrico> Indeed, the crash is gone. However, after applying this patch Enrico> I still observe a weird

Re: [PATCH] Bug 2727: LyX crashes when undoing super/subscript deletion

2006-08-16 Thread Jean-Marc Lasgouttes
> "Enrico" == Enrico Forestieri <[EMAIL PROTECTED]> writes: Enrico> Indeed, the crash is gone. However, after applying this patch Enrico> I still observe a weird behavior which may be reproduced by Enrico> the following steps: Enrico> 1) Ctrl-N (new document) 2) Shift-Ctrl-M (math display) 3)

Re: [PATCH] Bug 2727: LyX crashes when undoing super/subscript deletion

2006-08-16 Thread Georg Baum
Enrico Forestieri wrote: > Omitting step 6 above, everything is ok. So, maybe I am only being picky. No, it is good you found that out. Neither navigating with the cursor keys around nor undo/redo should ever produce such an infinite loop. I guess the reason is similar to the one of the fixed pro

Re: [PATCH] Bug 2727: LyX crashes when undoing super/subscript deletion

2006-08-15 Thread Enrico Forestieri
On Mon, Aug 14, 2006 at 05:21:49PM +0200, Jean-Marc Lasgouttes wrote: > The following patch fixes this bug for me. Indeed, the crash is gone. However, after applying this patch I still observe a weird behavior which may be reproduced by the following steps: 1) Ctrl-N (new document) 2) Shift-Ctrl

[PATCH] Bug 2727: LyX crashes when undoing super/subscript deletion

2006-08-14 Thread Jean-Marc Lasgouttes
The following patch fixes this bug for me. However I have questions about whether I did it right. There are 3 mostly independent parts in the patch: - in MathScriptInset::notifyCursorLeave, there were no recordUndoInset calls. This fix seems safe and obvious to me - when doing record undo, th