Re: [patch] bug 4330: lyx crashes for outline-commands within math-environment

2007-11-07 Thread Abdelrazak Younes
Jean-Marc Lasgouttes wrote: Abdelrazak Younes <[EMAIL PROTECTED]> writes: True. But most LFUNs in Text::dispatch() do not really belong there. This is part of your desire to redefine what Text is, if I understand correctly. In this case, the handling should be moved to InsetText. Yes, proba

Re: [patch] bug 4330: lyx crashes for outline-commands within math-environment

2007-11-07 Thread Jean-Marc Lasgouttes
Abdelrazak Younes <[EMAIL PROTECTED]> writes: > True. But most LFUNs in Text::dispatch() do not really belong there. This is part of your desire to redefine what Text is, if I understand correctly. In this case, the handling should be moved to InsetText. JMarc

Re: [patch] bug 4330: lyx crashes for outline-commands within math-environment

2007-11-07 Thread Jean-Marc Lasgouttes
Abdelrazak Younes <[EMAIL PROTECTED]> writes: > Because conceptually Text doesn't know where the cursor is, only > Cursor itself knows. So Cursor should ask the current paragraph if it > is a TOC type or not. Absolutely no property of Text is used during > this decision process. This way, we won't

Re: [patch] bug 4330: lyx crashes for outline-commands within math-environment

2007-11-06 Thread Abdelrazak Younes
Andre Poenitz wrote: On Tue, Nov 06, 2007 at 03:13:35PM +0100, Abdelrazak Younes wrote: Jürgen Spitzmüller wrote: Jean-Marc Lasgouttes wrote: And what about moving this from BufferView (which is for all highly editable insets == text+math) to Text3.cpp (which is only for text)? Like this?

Re: [patch] bug 4330: lyx crashes for outline-commands within math-environment

2007-11-06 Thread Andre Poenitz
On Tue, Nov 06, 2007 at 03:13:35PM +0100, Abdelrazak Younes wrote: > Jürgen Spitzmüller wrote: >> Jean-Marc Lasgouttes wrote: >>> And what about moving this from BufferView (which is for all >>> highly editable insets == text+math) to Text3.cpp (which is only for >>> text)? >> Like this? > > > +

Re: [patch] bug 4330: lyx crashes for outline-commands within math-environment

2007-11-06 Thread Abdelrazak Younes
Jürgen Spitzmüller wrote: Jean-Marc Lasgouttes wrote: Yes, but see below. I've fixed the remaining issues and committed to branch. For trunk, there's the difference that Outline is a(n anonymous) function of BufferView. Abdel, what are your plans? Should this function be moved to text with

Re: [patch] bug 4330: lyx crashes for outline-commands within math-environment

2007-11-06 Thread Jürgen Spitzmüller
Jean-Marc Lasgouttes wrote: > Yes, but see below. I've fixed the remaining issues and committed to branch. For trunk, there's the difference that Outline is a(n anonymous) function of BufferView. Abdel, what are your plans? Should this function be moved to text with the LFUN's or made public?

Re: [patch] bug 4330: lyx crashes for outline-commands within math-environment

2007-11-06 Thread Abdelrazak Younes
Jürgen Spitzmüller wrote: Jean-Marc Lasgouttes wrote: Are the curly braces needed? No, but most of the other elements in the switch embrace their content, so I thought I adapt to that. I don't care. I'll remove them again. FYI, they are only needed if you do declaration inside the case.

Re: [patch] bug 4330: lyx crashes for outline-commands within math-environment

2007-11-06 Thread Jean-Marc Lasgouttes
[EMAIL PROTECTED] (Jürgen Spitzmüller) writes: > Jean-Marc Lasgouttes wrote: >> Are the curly braces needed? > > No, but most of the other elements in the switch embrace their content, so I > thought I adapt to that. Only when they declare a variable. JMarc

Re: [patch] bug 4330: lyx crashes for outline-commands within math-environment

2007-11-06 Thread Abdelrazak Younes
Jean-Marc Lasgouttes wrote: Abdelrazak Younes <[EMAIL PROTECTED]> writes: Jürgen Spitzmüller wrote: Jean-Marc Lasgouttes wrote: And what about moving this from BufferView (which is for all highly editable insets == text+math) to Text3.cpp (which is only for text)? Like this? + case L

Re: [patch] bug 4330: lyx crashes for outline-commands within math-environment

2007-11-06 Thread Jürgen Spitzmüller
Jean-Marc Lasgouttes wrote: > Are the curly braces needed? No, but most of the other elements in the switch embrace their content, so I thought I adapt to that. I don't care. I'll remove them again. > I think cur.paragraph() is enough since we are in Text. You're right. Jürgen

Re: [patch] bug 4330: lyx crashes for outline-commands within math-environment

2007-11-06 Thread Jean-Marc Lasgouttes
Abdelrazak Younes <[EMAIL PROTECTED]> writes: > Jürgen Spitzmüller wrote: >> Jean-Marc Lasgouttes wrote: >>> And what about moving this from BufferView (which is for all >>> highly editable insets == text+math) to Text3.cpp (which is only for text)? >> >> Like this? > > > + case LFUN_OUTLINE_U

Re: [patch] bug 4330: lyx crashes for outline-commands within math-environment

2007-11-06 Thread Jean-Marc Lasgouttes
[EMAIL PROTECTED] (Jürgen Spitzmüller) writes: > Jean-Marc Lasgouttes wrote: >> And what about moving this from BufferView (which is for all >> highly editable insets == text+math) to Text3.cpp (which is only for text)? > > Like this? Yes, but see below. > + case LFUN_OUTLINE_UP: { > +

Re: [patch] bug 4330: lyx crashes for outline-commands within math-environment

2007-11-06 Thread Jürgen Spitzmüller
Abdelrazak Younes wrote: > Can't we put these and (many others) in a new Cursor::getStatus instead? > Text is used (abused) for many things already. But not for branch. Jürgen

Re: [patch] bug 4330: lyx crashes for outline-commands within math-environment

2007-11-06 Thread Abdelrazak Younes
Jürgen Spitzmüller wrote: Jean-Marc Lasgouttes wrote: And what about moving this from BufferView (which is for all highly editable insets == text+math) to Text3.cpp (which is only for text)? Like this? + case LFUN_OUTLINE_UP: + case LFUN_OUTLINE_DOWN: + case LFUN_OUTLINE_I

Re: [patch] bug 4330: lyx crashes for outline-commands within math-environment

2007-11-06 Thread Jürgen Spitzmüller
Jean-Marc Lasgouttes wrote: > And what about moving this from BufferView (which is for all > highly editable insets == text+math) to Text3.cpp (which is only for text)? Like this? Jürgen Index: src/BufferView.cpp === --- src/BufferVi

Re: [patch] bug 4330: lyx crashes for outline-commands within math-environment

2007-11-06 Thread Jürgen Spitzmüller
Jean-Marc Lasgouttes wrote: > No, if the lfun is only handled in Text what happens is that > > - Cursor::dispatch asks the top slice (mathed) whether it knows about >   outline ==> no > > - Cursor::dispatch asks the next slice (text) whether it knows about >   outline ==> yes! > > - the outline stu

Re: [patch] bug 4330: lyx crashes for outline-commands within math-environment

2007-11-06 Thread Jean-Marc Lasgouttes
[EMAIL PROTECTED] (Jürgen Spitzmüller) writes: > Jean-Marc Lasgouttes wrote: >> OK then. But I still think that moving the code to Text is better >> (since the code only works in text). > > So you think the lfun should be disabled if the cursor is in mathed, even if > the formula is part of a sec

Re: [patch] bug 4330: lyx crashes for outline-commands within math-environment

2007-11-06 Thread Abdelrazak Younes
Jürgen Spitzmüller wrote: Jean-Marc Lasgouttes wrote: OK then. But I still think that moving the code to Text is better (since the code only works in text). So you think the lfun should be disabled if the cursor is in mathed, even if the formula is part of a section? No, you should enable a

Re: [patch] bug 4330: lyx crashes for outline-commands within math-environment

2007-11-06 Thread Jürgen Spitzmüller
Jean-Marc Lasgouttes wrote: > OK then. But I still think that moving the code to Text is better > (since the code only works in text). So you think the lfun should be disabled if the cursor is in mathed, even if the formula is part of a section? Jürgen

Re: [patch] bug 4330: lyx crashes for outline-commands within math-environment

2007-11-06 Thread Jean-Marc Lasgouttes
[EMAIL PROTECTED] (Jürgen Spitzmüller) writes: > Jean-Marc Lasgouttes wrote: >> What happens if you just remove mention of these LFUNS from the mathed >> getstatus? This should be enough to get everything working. > > they are not mentioned in mathed/ anywhere. Sorry. And what about moving this f

Re: [patch] bug 4330: lyx crashes for outline-commands within math-environment

2007-11-06 Thread Jürgen Spitzmüller
Jean-Marc Lasgouttes wrote: > What happens if you just remove mention of these LFUNS from the mathed > getstatus? This should be enough to get everything working. they are not mentioned in mathed/ anywhere. > I suspect that your patch does not work for nested math insets. It does. I have tested

Re: [patch] bug 4330: lyx crashes for outline-commands within math-environment

2007-11-06 Thread Jean-Marc Lasgouttes
[EMAIL PROTECTED] (Jürgen Spitzmüller) writes: > Jürgen Spitzmüller wrote: >> Objections? > > It turned out that the attached extension is needed, else LyX still crashes. > BTW if you wonder why I don't just disable those lfuns for mathed: they work > if you are in a formula in a section, for ins

Re: [patch] bug 4330: lyx crashes for outline-commands within math-environment

2007-11-06 Thread Abdelrazak Younes
Jürgen Spitzmüller wrote: Objections? Looks correct. Abdel.

Re: [patch] bug 4330: lyx crashes for outline-commands within math-environment

2007-11-06 Thread Jürgen Spitzmüller
Jürgen Spitzmüller wrote: > Objections? It turned out that the attached extension is needed, else LyX still crashes. BTW if you wonder why I don't just disable those lfuns for mathed: they work if you are in a formula in a section, for instance (and they should be disabled for simple paragraphs,

[patch] bug 4330: lyx crashes for outline-commands within math-environment

2007-11-06 Thread Jürgen Spitzmüller
Objections? Jürgen Index: src/BufferView.cpp === --- src/BufferView.cpp (Revision 21446) +++ src/BufferView.cpp (Arbeitskopie) @@ -645,11 +645,6 @@ case LFUN_FONT_STATE: case LFUN_LABEL_INSERT: case LFUN_PARAGRAPH_GOTO: - // FIX