From 9a56c45a7b409bf105fc949d6e3f9d641dc0d605 Mon Sep 17 00:00:00 2001 From: Stefan Schimanski Date: Fri, 29 Feb 2008 10:02:40 +0000 Subject: [PATCH] * insertParam assumes that the cursor has the macro template in the top slice. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23351 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/MathMacroTemplate.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/mathed/MathMacroTemplate.cpp b/src/mathed/MathMacroTemplate.cpp index fd0a5874bb..f439d1fc3b 100644 --- a/src/mathed/MathMacroTemplate.cpp +++ b/src/mathed/MathMacroTemplate.cpp @@ -617,7 +617,13 @@ void MathMacroTemplate::edit(Cursor & cur, bool front, EntryDirection entry_from bool MathMacroTemplate::notifyCursorLeaves(Cursor const & old, Cursor & cur) { - commitEditChanges(cur); + // find this in cursor old + Cursor insetCur = old; + int scriptSlice = insetCur.find(this); + BOOST_ASSERT(scriptSlice != -1); + insetCur.cutOff(scriptSlice); + + commitEditChanges(insetCur); updateLook(); cur.updateFlags(Update::Force); return InsetMathNest::notifyCursorLeaves(old, cur);