sw/source/core/edit/edlingu.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
New commits: commit 4c6c60d44b0056cbe08b6e75baacbc0df0cd1742 Author: Gökay Şatır <gokaysa...@collabora.com> AuthorDate: Thu Nov 2 13:37:46 2023 +0300 Commit: Gökay ŞATIR <gokaysa...@collabora.com> CommitDate: Thu Nov 23 07:29:38 2023 +0100 Proof reading suggestions: * When user right clicks an underlined part of the sentence, we are checking if there is a suggestion list. * Then we show the suggestions. Sometimes spell checker algorithms send 2 lists for the same part of the sentence. And we saw that one of these lists can be empty (no suggestions). But since we check if there is a list, the empty list is shown to the user. I updated the checks here and added a new condition: Now we take the list if the list is not empty. This way, we can find the not-empty list which may come after an empty list (for the same part of the sentence). Signed-off-by: Gökay Şatır <gokaysa...@collabora.com> Change-Id: Ib3b498b98a8d44f8a7ead99593a71adcefa87a82 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158832 Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx index ab89fc5b7241..923a70c3cb72 100644 --- a/sw/source/core/edit/edlingu.cxx +++ b/sw/source/core/edit/edlingu.cxx @@ -1031,7 +1031,8 @@ bool SwEditShell::GetGrammarCorrection( auto pError = std::find_if(std::cbegin(rResult.aErrors), std::cend(rResult.aErrors), [rErrorPosInText, nLen](const linguistic2::SingleProofreadingError &rError) { return rError.nErrorStart <= rErrorPosInText - && rErrorPosInText + nLen <= rError.nErrorStart + rError.nErrorLength; }); + && rErrorPosInText + nLen <= rError.nErrorStart + rError.nErrorLength + && rError.aSuggestions.size() > 0; }); if (pError != std::cend(rResult.aErrors)) { rSuggestions = pError->aSuggestions;