From: Martin Vermeer Date: Wed, 6 Apr 2005 07:38:24 +0000 (+0000) Subject: More precise fix for bug 1654 X-Git-Tag: 1.6.10~14424 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=719dc8c0b2a234f8ce291be57f04b168bebe8263;p=features.git More precise fix for bug 1654 git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9783 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/ChangeLog b/src/ChangeLog index d8d82c72c2..9930e770a9 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2005-04-06 Martin Vermeer + + * CutAndPaste.C (eraseSelection): more precise fix for bug 1654, + preventing inserted font, deco, delim insets jumping to start of + surrounding inset. + 2005-03-30 Jean-Marc Lasgouttes * lyxfunc.C (dispatch): translate message before sending it to the diff --git a/src/CutAndPaste.C b/src/CutAndPaste.C index af8912c0fd..4c5195cfbe 100644 --- a/src/CutAndPaste.C +++ b/src/CutAndPaste.C @@ -670,6 +670,7 @@ void eraseSelection(LCursor & cur) CursorSlice const & i1 = cur.selBegin(); CursorSlice const & i2 = cur.selEnd(); if (i1.inset().asMathInset()) { + cur.top() = i1; if (i1.idx() == i2.idx()) { i1.cell().erase(i1.pos(), i2.pos()); } else { @@ -680,9 +681,9 @@ void eraseSelection(LCursor & cur) for (InsetBase::row_type row = r1; row <= r2; ++row) for (InsetBase::col_type col = c1; col <= c2; ++col) p->cell(p->index(row, col)).clear(); + // We've deleted the whole cell. Only pos 0 is valid. + cur.pos() = 0; } - cur.top() = i1; - cur.pos() = 0; // We've deleted the whole cell. Only pos 0 is valid. cur.resetAnchor(); } else { lyxerr << "can't erase this selection 1" << endl;