John Levon wrote: > On Thu, Aug 08, 2002 at 07:30:29PM +0200, Andre Poenitz wrote: > > >>Well, I think 100 and the error boxes fixed will do... > > > It looks quite complicated to fix. I don't understand what this > freeze/unfreeze business is all about (and we seem to do it > recursively). > > Of course, like most things, one simple insertInset is actually about 30 > different methods all over the place :/
Well this is the patch to solve this problem and I don't think it's overly complicated, but well maybe this depends on the point of view #:O) Jug Index: src/BufferView2.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView2.C,v retrieving revision 1.141 diff -u -p -r1.141 BufferView2.C --- src/BufferView2.C 12 Aug 2002 00:15:15 -0000 1.141 +++ src/BufferView2.C 12 Aug 2002 08:09:15 -0000 @@ -276,10 +276,12 @@ void BufferView::insertErrors(TeXErrors if (texrowpar == 0) continue; + freezeUndo(); InsetError * new_inset = new InsetError(msgtxt); text->setCursorIntern(this, texrowpar, tmppos); text->insertInset(this, new_inset); text->fullRebreak(this); + unFreezeUndo(); } // Restore the cursor position text->setCursorIntern(this, cursor.par(), cursor.pos()); Index: src/ChangeLog =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ChangeLog,v retrieving revision 1.877 diff -u -p -r1.877 ChangeLog --- src/ChangeLog 12 Aug 2002 00:15:16 -0000 1.877 +++ src/ChangeLog 12 Aug 2002 08:09:16 -0000 @@ -1,3 +1,10 @@ +2002-08-12 Juergen Vigna <[EMAIL PROTECTED]> + + * BufferView2.C (insertErrors): forbid undo when inserting error + insets. + + * CutAndPaste.C (SwitchLayoutsBetweenClasses): ditto + 2002-08-12 Lars Gullik Bjønnes <[EMAIL PROTECTED]> * ParagraphList.[Ch]: new files Index: src/CutAndPaste.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/CutAndPaste.C,v retrieving revision 1.63 diff -u -p -r1.63 CutAndPaste.C --- src/CutAndPaste.C 10 Aug 2002 15:20:57 -0000 1.63 +++ src/CutAndPaste.C 12 Aug 2002 08:09:16 -0000 @@ -24,7 +24,7 @@ #include "gettext.h" #include "iterators.h" #include "lyxtextclasslist.h" - +#include "undo_funcs.h" #include "insets/inseterror.h" using std::pair; @@ -427,6 +427,7 @@ int CutAndPaste::SwitchLayoutsBetweenCla + _("\nbecause of class conversion from\n") + tclass1.name() + _(" to ") + tclass2.name(); + freezeUndo(); InsetError * new_inset = new InsetError(s); LyXText * txt = current_view->getLyXText(); LyXCursor cur = txt->cursor; @@ -434,6 +435,7 @@ int CutAndPaste::SwitchLayoutsBetweenCla txt->insertInset(current_view, new_inset); txt->fullRebreak(current_view); txt->setCursorIntern(current_view, cur.par(), cur.pos()); + unFreezeUndo(); } } return ret; -- -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ Dr. Jürgen Vigna E-Mail: [EMAIL PROTECTED] Mitterstrich 151/A Tel/Fax: +39-0471-450260 / +39-0471-450253 I-39050 Steinegg Web: http://www.lyx.org/~jug -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._