cui/source/dialogs/SpellDialog.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
New commits: commit 0eea3f11f887e7722b16816eaa082ca33f340911 Author: Sarper Akdemir <sarper.akde...@allotropia.de> AuthorDate: Wed Apr 23 12:23:47 2025 +0200 Commit: Sarper Akdemir <sarper.akde...@allotropia.de> CommitDate: Wed Jun 11 12:28:25 2025 +0200 fix spellcheck dialog preventing replacement of "." There appears to be special logic for replacing words that end with a dot in the spellcheck dialog. Where the dot at the end is ignored during replacement. This special handling is only there for the spelldialog, i.e. it is not there if you try to do the replacement via the context menu or via IDocumentRedlineAccess. e.g. If the text with the error text is only "." and the replacement is "REPLACEMENT", clicking Correct button on the dialog ends up with "REPLACEMENT." Make it so that if the error text is just a dot, do not enforce having a dot at the end of the replacement. Since it is obvious the suggested replacement is for the dot. It feels to me like the whole special handling for dot was originally dictionary/suggestion error and was worked around in the wrong place. Change-Id: I65675ad18e5386f65ee978c0e92952bba29ae3cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184495 Tested-by: Jenkins Reviewed-by: Sarper Akdemir <sarper.akde...@allotropia.de> diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx index bbc2bbe7527a..f6f485835ff6 100644 --- a/cui/source/dialogs/SpellDialog.cxx +++ b/cui/source/dialogs/SpellDialog.cxx @@ -483,11 +483,11 @@ namespace OUString aString = rErrorText; //dots are sometimes part of the spelled word but they are not necessarily part of the replacement - bool bDot = aString.endsWith("."); + bool bEndsWithDot = aString != "." && aString.endsWith("."); aString = rSuggestedReplacement; - if(bDot && (aString.isEmpty() || !aString.endsWith("."))) + if(bEndsWithDot && (aString.isEmpty() || !aString.endsWith("."))) aString += "."; return aString;