diff options
author | Justin Luth <jluth@mail.com> | 2023-12-16 11:10:28 -0500 |
---|---|---|
committer | Justin Luth <jluth@mail.com> | 2023-12-18 15:11:30 +0100 |
commit | 5bc7d0186d1a70990377a2f4c630fe11e2dfd166 (patch) | |
tree | 7a13a247c8e787cf6252fc4518d351384c1054ac /sw | |
parent | bff76421e234df7246a7f49c71a11432f86e09d1 (diff) |
tdf#111969 sw: acknowledge that last half-character in Get*Correction
This fixes right-clicking on the last half-character
of a mis-spelled word,
which previously did not pull up a spelling suggestion list.
This is a suggested follow-up to right-clicking on a selection,
which had the same problem.
Probably everywhere that calls GetModelPositionForViewPoint
without eTmpState.m_bPosMatchesBounds should be suspected
of being wrong.
Patchset 2 contains a unit test that ONLY passes on machines
that have spell checking dictionaries on them.
The concept in general is already tested is another patch,
so I'll just drop this unit test that checks the spell-checking
code path. It would easily break other people's
development setups if they don't have en-US dictionaries.
Change-Id: I3faa87d16eb3452f863052ea851a43a871125060
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160872
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/edit/edlingu.cxx | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx index 5731d2b2be49..e1bcd3f23520 100644 --- a/sw/source/core/edit/edlingu.cxx +++ b/sw/source/core/edit/edlingu.cxx @@ -915,6 +915,7 @@ uno::Reference< XSpellAlternatives > SwPaM* pCursor = GetCursor(); SwPosition aPos( *pCursor->GetPoint() ); SwCursorMoveState eTmpState( CursorMoveState::SetOnlyText ); + eTmpState.m_bPosMatchesBounds = true; // treat last half of character same as first half SwTextNode *pNode = nullptr; SwWrongList *pWrong = nullptr; if (pPt && GetLayout()->GetModelPositionForViewPoint( &aPos, *const_cast<Point*>(pPt), &eTmpState )) @@ -986,6 +987,7 @@ bool SwEditShell::GetGrammarCorrection( SwPaM* pCursor = GetCursor(); SwPosition aPos( *pCursor->GetPoint() ); SwCursorMoveState eTmpState( CursorMoveState::SetOnlyText ); + eTmpState.m_bPosMatchesBounds = true; // treat last half of character same as first half SwTextNode *pNode = nullptr; SwGrammarMarkUp *pWrong = nullptr; if (pPt && GetLayout()->GetModelPositionForViewPoint( &aPos, *const_cast<Point*>(pPt), &eTmpState )) |