]> git.lyx.org Git - features.git/commitdiff
* insertParam assumes that the cursor has the macro template in the top slice.
authorStefan Schimanski <sts@lyx.org>
Fri, 29 Feb 2008 10:02:40 +0000 (10:02 +0000)
committerStefan Schimanski <sts@lyx.org>
Fri, 29 Feb 2008 10:02:40 +0000 (10:02 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23351 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/MathMacroTemplate.cpp

index fd0a5874bbd4e021bb8194b55c406be5b6204f0a..f439d1fc3bcd407ec6f7f55a0a4a9ae7cc2c4d10 100644 (file)
@@ -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);