From ddc06a6e295d1ce31a2f5df859cdfbc42d7b0662 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Vigna?= Date: Mon, 12 Aug 2002 08:16:01 +0000 Subject: [PATCH] Don't create undos for inserting Error insets. What is missing still is that before actually doing any undo we should remove "AutoInsets". git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4939 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/BufferView2.C | 2 ++ src/ChangeLog | 7 +++++++ src/CutAndPaste.C | 4 +++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/BufferView2.C b/src/BufferView2.C index fd42b2873c..b32045a32f 100644 --- a/src/BufferView2.C +++ b/src/BufferView2.C @@ -276,10 +276,12 @@ void BufferView::insertErrors(TeXErrors & terr) 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()); diff --git a/src/ChangeLog b/src/ChangeLog index 82fc02e351..afe84ae8c6 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2002-08-12 Juergen Vigna + + * BufferView2.C (insertErrors): forbid undo when inserting error + insets. + + * CutAndPaste.C (SwitchLayoutsBetweenClasses): ditto + 2002-08-12 Lars Gullik Bjønnes * ParagraphList.[Ch]: new files diff --git a/src/CutAndPaste.C b/src/CutAndPaste.C index ba7f093c06..6117a50481 100644 --- a/src/CutAndPaste.C +++ b/src/CutAndPaste.C @@ -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::SwitchLayoutsBetweenClasses(textclass_type c1, + _("\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::SwitchLayoutsBetweenClasses(textclass_type c1, txt->insertInset(current_view, new_inset); txt->fullRebreak(current_view); txt->setCursorIntern(current_view, cur.par(), cur.pos()); + unFreezeUndo(); } } return ret;