[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - editeng/source
Marco Cecchetti (via logerrit)
logerrit at kemper.freedesktop.org
Fri May 29 12:39:41 UTC 2020
editeng/source/editeng/impedit.cxx | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
New commits:
commit c9868576160c093178e9f0e6fee6b73201d01a3e
Author: Marco Cecchetti <marco.cecchetti at collabora.com>
AuthorDate: Thu Apr 9 18:51:46 2020 +0200
Commit: Marco Cecchetti <marco.cecchetti at collabora.com>
CommitDate: Fri May 29 14:39:10 2020 +0200
lok: calc: formula bar: improve selection handling
This patch provides some improvements for the single input line case
with a multi-line text selection:
- selection rectangles are correct when selection is expanded to the
previous or the next line
- two flag parameters for notifying the client if the start/end
selection handles should be visible or they don't
Change-Id: Ica0428786183c4b5a15870c43490bc69452c2a49
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92121
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Andras Timar <andras.timar at collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95106
Tested-by: Marco Cecchetti <marco.cecchetti at collabora.com>
Reviewed-by: Marco Cecchetti <marco.cecchetti at collabora.com>
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx
index 56970d8ea6cf..8bcb2caa68c1 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -282,6 +282,10 @@ void ImpEditView::DrawSelectionXOR( EditSelection aTmpSel, vcl::Region* pRegion,
const sal_Int32 nEndPara = pEditEngine->GetEditDoc().GetPos(pEndNode);
if (nStartPara == EE_PARA_NOT_FOUND || nEndPara == EE_PARA_NOT_FOUND)
return;
+
+ bool bStartHandleVisible = false;
+ bool bEndHandleVisible = false;
+
for ( sal_Int32 nPara = nStartPara; nPara <= nEndPara; nPara++ )
{
ParaPortion* pTmpPortion = pEditEngine->GetParaPortions().SafeGetObject( nPara );
@@ -345,6 +349,11 @@ void ImpEditView::DrawSelectionXOR( EditSelection aTmpSel, vcl::Region* pRegion,
if ( aBottomRight.Y() < GetVisDocTop() )
continue;
+ if ( ( nPara == nStartPara ) && ( nLine == nStartLine ) )
+ bStartHandleVisible = true;
+ if ( ( nPara == nEndPara ) && ( nLine == nEndLine ) )
+ bEndHandleVisible = true;
+
// Now that we have Bidi, the first/last index doesn't have to be the 'most outside' position
if ( !bPartOfLine )
{
@@ -409,6 +418,8 @@ void ImpEditView::DrawSelectionXOR( EditSelection aTmpSel, vcl::Region* pRegion,
const OUString rAction("text_selection");
std::vector<vcl::LOKPayloadItem> aItems;
aItems.emplace_back("rectangles", sRectangle);
+ aItems.emplace_back("startHandleVisible", OString::boolean(bStartHandleVisible));
+ aItems.emplace_back("endHandleVisible", OString::boolean(bEndHandleVisible));
pNotifier->notifyWindow(pParent->GetLOKWindowId(), rAction, aItems);
pPolyPoly.reset();
return;
@@ -1387,6 +1398,11 @@ Pair ImpEditView::Scroll( long ndX, long ndY, ScrollRangeCheck nRangeCheck )
EENotify aNotify( EE_NOTIFY_TEXTVIEWSCROLLED );
pEditEngine->pImpEditEngine->GetNotifyHdl().Call( aNotify );
}
+
+ if (comphelper::LibreOfficeKit::isActive())
+ {
+ DrawSelectionXOR();
+ }
}
return Pair( nRealDiffX, nRealDiffY );
More information about the Libreoffice-commits
mailing list