diff options
author | Marco Cecchetti <marco.cecchetti@collabora.com> | 2019-10-20 13:18:51 +0200 |
---|---|---|
committer | Marco Cecchetti <marco.cecchetti@collabora.com> | 2019-10-21 12:42:57 +0200 |
commit | 56bf1745c7636bb04965e63de8d12bb867850391 (patch) | |
tree | 2c7726c0bc2d084f8ac0464e62c18b66bc854e69 /editeng | |
parent | 98ca6029423eaa19cd4f163da49410310cdea8ae (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
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/impedit.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx index edf393485b87..8fd2c913c93e 100644 --- a/editeng/source/editeng/impedit.cxx +++ b/editeng/source/editeng/impedit.cxx @@ -1118,7 +1118,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); } } |