Fix bug 3225.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17181 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2007-02-14 11:21:39 +00:00
parent f11fdd307a
commit aaf4cf6f9f

View File

@ -546,16 +546,17 @@ void cutSelection(LCursor & cur, bool doclear, bool realcut)
cur.selBegin().pos(), endpos,
doclear);
// sometimes necessary
if (doclear)
text->paragraphs()[begpit].stripLeadingSpaces(bp.trackChanges);
// cutSelection can invalidate the cursor so we need to set
// it anew. (Lgb)
// we prefer the end for when tracking changes
cur.pos() = endpos;
cur.pit() = endpit;
// sometimes necessary
if (doclear
&& text->paragraphs()[begpit].stripLeadingSpaces(bp.trackChanges))
cur.fixIfBroken();
// need a valid cursor. (Lgb)
cur.clearSelection();
updateLabels(cur.buffer());