[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - editeng/source
Miklos Vajna
vmiklos at collabora.co.uk
Fri Apr 10 06:27:09 PDT 2015
editeng/source/editeng/editview.cxx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit f1a41636743eb96307a559e6b0b0a49488574afc
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Fri Apr 10 15:23:29 2015 +0200
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
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx
index 11d041d..6d0c556 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
More information about the Libreoffice-commits
mailing list