summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorMarco Cecchetti <marco.cecchetti@collabora.com>2019-10-20 13:18:51 +0200
committerAndras Timar <andras.timar@collabora.com>2020-05-17 10:37:02 +0200
commitc8fc88ff9fe27110b462c861e504fab15dfc1243 (patch)
tree66c547b947e4c071347a16a9461e981e3f6e66a6 /editeng
parentf33e367c0005b3cbb37ff59aabd2e9ea295bba0a (diff)
lok: get spelling context menu on long press
This patch handles a new flag attached to the invalidate view cursor message for informing the client when the text cursor is inside a mispelled word. This information is used for popping up the spelling context menu on a long press event instead of the standard context menu for a selected word. Change-Id: I13fcbe53c83ca6eb56300a601734cdc3211e88a0 Reviewed-on: https://gerrit.libreoffice.org/85244 Tested-by: Jenkins Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/editeng/impedit.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx
index 5006cd620d18..575fc087e47d 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -1102,7 +1102,11 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool bForceVisCursor )
}
else
{
- SfxLokHelper::notifyVisCursorInvalidation(mpViewShell, sRect);
+ // is cursor at a mispelled word ?
+ Reference< linguistic2::XSpellChecker1 > xSpeller( pEditEngine->pImpEditEngine->GetSpeller() );
+ bool bIsWrong = xSpeller.is() && IsWrongSpelledWord(aPaM, /*bMarkIfWrong*/ false);
+
+ SfxLokHelper::notifyVisCursorInvalidation(mpViewShell, sRect, bIsWrong);
mpViewShell->NotifyOtherViews(LOK_CALLBACK_INVALIDATE_VIEW_CURSOR, "rectangle", sRect);
}
}