summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorMarco Cecchetti <marco.cecchetti@collabora.com>2020-04-09 18:51:46 +0200
committerAndras Timar <andras.timar@collabora.com>2020-04-29 09:55:04 +0200
commitca30a4814e4c55833a6f002bd6761e02e1b88969 (patch)
tree91fa65bd25d1e55b87f1a1e842d94c2ec3db6b88 /editeng
parent2ea5e9d6db6aaea4e30e4511b1668a17ec970a0b (diff)
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@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/editeng/impedit.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx
index ee9b40b0e97a..b67a847c615d 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -275,6 +275,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 );
@@ -338,6 +342,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 )
{
@@ -402,6 +411,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);
delete pPolyPoly;
return;
@@ -1393,6 +1404,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 );