summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorMarco Cecchetti <marco.cecchetti@collabora.com>2019-10-20 13:18:51 +0200
committerTamás Zolnai <tamas.zolnai@collabora.com>2019-12-17 11:32:33 +0100
commitdfcfdf47b5da6a11b2c3118a0f63cc48c10c2cd7 (patch)
tree831f85befc8c830f5d00a4b0cef01e343e2746e0 /editeng
parent1fd65c35f9cc44d94ac10e929b9c9c4bfb8d1afc (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 348d74bf41ff..3291e345d455 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);
}
}