More precise fix for bug 1654

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9783 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Martin Vermeer 2005-04-06 07:38:24 +00:00
parent 46ecd6b11c
commit 719dc8c0b2
2 changed files with 9 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2005-04-06 Martin Vermeer <martin.vermeer@hut.fi>
* 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 <lasgouttes@lyx.org> 2005-03-30 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* lyxfunc.C (dispatch): translate message before sending it to the * lyxfunc.C (dispatch): translate message before sending it to the

View File

@ -670,6 +670,7 @@ void eraseSelection(LCursor & cur)
CursorSlice const & i1 = cur.selBegin(); CursorSlice const & i1 = cur.selBegin();
CursorSlice const & i2 = cur.selEnd(); CursorSlice const & i2 = cur.selEnd();
if (i1.inset().asMathInset()) { if (i1.inset().asMathInset()) {
cur.top() = i1;
if (i1.idx() == i2.idx()) { if (i1.idx() == i2.idx()) {
i1.cell().erase(i1.pos(), i2.pos()); i1.cell().erase(i1.pos(), i2.pos());
} else { } else {
@ -680,9 +681,9 @@ void eraseSelection(LCursor & cur)
for (InsetBase::row_type row = r1; row <= r2; ++row) for (InsetBase::row_type row = r1; row <= r2; ++row)
for (InsetBase::col_type col = c1; col <= c2; ++col) for (InsetBase::col_type col = c1; col <= c2; ++col)
p->cell(p->index(row, col)).clear(); 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(); cur.resetAnchor();
} else { } else {
lyxerr << "can't erase this selection 1" << endl; lyxerr << "can't erase this selection 1" << endl;