[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - editeng/source
Miklos Vajna
vmiklos at collabora.co.uk
Tue Mar 17 06:25:36 PDT 2015
editeng/source/editeng/editview.cxx | 24 ++++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)
New commits:
commit f1bafcb9305cb16dc649d8d76072df52f052ff92
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Tue Mar 17 14:14:26 2015 +0100
editeng tiled rendering: implement drag of start/end selection handle
With this, it's possible to drag the handle of not only the normal
cursor, but also the start/end handle of a range selection in editeng
text, e.g. Writer shape text.
Change-Id: I5b9f548fb6365ecb499c68cef0d89f7f8ff3a11d
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx
index db3b6cf..e9ec245 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -1320,9 +1320,29 @@ Selection EditView::GetSurroundingTextSelection() const
}
}
-void EditView::SetCursorLogicPosition(const Point& rPosition, bool /*bPoint*/, bool /*bClearMark*/)
+void EditView::SetCursorLogicPosition(const Point& rPosition, bool bPoint, bool bClearMark)
{
- pImpEditView->SetCursorAtPoint(rPosition);
+ Point aDocPos(pImpEditView->GetDocPos(rPosition));
+ EditPaM aPaM = pImpEditView->pEditEngine->GetPaM(aDocPos);
+ EditSelection aSelection(pImpEditView->GetEditSelection());
+
+ // Explicitly create or delete the selection.
+ if (bClearMark)
+ pImpEditView->DeselectAll();
+ else
+ pImpEditView->CreateAnchor();
+
+ if (bPoint)
+ aSelection.Max() = aPaM;
+ else
+ aSelection.Min() = aPaM;
+
+ if (pImpEditView->GetEditSelection().Min() != aSelection.Min())
+ pImpEditView->pEditEngine->CursorMoved(pImpEditView->GetEditSelection().Min().GetNode());
+ pImpEditView->DrawSelection(aSelection);
+ if (pImpEditView->GetEditSelection() != aSelection)
+ pImpEditView->SetEditSelection(aSelection);
+ ShowCursor(/*bGotoCursor=*/false, /*bForceCursor=*/true);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
More information about the Libreoffice-commits
mailing list