diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-04-10 15:23:29 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-04-13 09:07:04 +0200 |
commit | 060dcbf6d118cef164c75a8cb603d6a4179abf53 (patch) | |
tree | a43419cee9c273178eaed8b57074c253c691b430 /editeng | |
parent | 2cd35b8ddfe8fa6504cea0cf55f8dbaf15c9e530 (diff) |
EditView::SetCursorLogicPosition: first deselect, then get the selection
If you tap to nearly the end of an editeng paragraph, then drag the
cursor using EditView::SetCursorLogicPosition(bPoint=true,
bClearMark=true) to the end of the paragraph, finally hit enter, the
text between the tap position and the end of the paragraph gets deleted.
Fix this by calling GetEditSelection() after DeselectAll(), so that the
original cursor position (before the drag started) never survives, which
gives back the lost text, too.
Change-Id: I777256765f1c8f1a7f22c549eaca19e575fdae21
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/editview.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx index 11d041d96086..6d0c556f17a5 100644 --- a/editeng/source/editeng/editview.cxx +++ b/editeng/source/editeng/editview.cxx @@ -1323,7 +1323,6 @@ void EditView::SetCursorLogicPosition(const Point& rPosition, bool bPoint, bool { Point aDocPos(pImpEditView->GetDocPos(rPosition)); EditPaM aPaM = pImpEditView->pEditEngine->GetPaM(aDocPos); - EditSelection aSelection(pImpEditView->GetEditSelection()); // Explicitly create or delete the selection. if (bClearMark) @@ -1331,6 +1330,7 @@ void EditView::SetCursorLogicPosition(const Point& rPosition, bool bPoint, bool else pImpEditView->CreateAnchor(); + EditSelection aSelection(pImpEditView->GetEditSelection()); if (bPoint) aSelection.Max() = aPaM; else |