summaryrefslogtreecommitdiff
path: root/include/unotools
diff options
context:
space:
mode:
authorBaole Fang <baole.fang@gmail.com>2023-06-23 11:47:54 -0400
committerخالد حسني <khaled@libreoffice.org>2023-06-23 22:20:58 +0200
commitcaab94a3e0387bde05538cff91ff13446f330785 (patch)
tree350f091ac061e14916bc86b845e4d5dbc4473e77 /include/unotools
parent9bb6f3083b8b2a763417ca1cdce21865a41ddd08 (diff)
tdf#142437: Fix word boundary detection in autocorrect
Marks (combining and spacing) were incorrectly considered word separators, because isLetterNumeric() matches only for letters and numbers. The new isBase() matches any character with BASE_FORM character class, which covers letters, numbers, and marks. Change-Id: I27ec2f7fb8d360791a280d10aba9b6d16e7cfb71 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153509 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
Diffstat (limited to 'include/unotools')
-rw-r--r--include/unotools/charclass.hxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/unotools/charclass.hxx b/include/unotools/charclass.hxx
index 7cb35ba2a594..bc91aca63631 100644
--- a/include/unotools/charclass.hxx
+++ b/include/unotools/charclass.hxx
@@ -58,6 +58,9 @@ inline constexpr sal_Int32 nCharClassNumericTypeMask =
css::i18n::KCharacterType::PRINTABLE |
css::i18n::KCharacterType::BASE_FORM;
+inline constexpr sal_Int32 nCharClassBaseType =
+ css::i18n::KCharacterType::BASE_FORM;
+
class UNOTOOLS_DLLPUBLIC CharClass
{
LanguageTag maLanguageTag;
@@ -167,6 +170,7 @@ public:
bool isDigit( const OUString& rStr, sal_Int32 nPos ) const;
bool isAlphaNumeric( const OUString& rStr, sal_Int32 nPos ) const;
bool isLetterNumeric( const OUString& rStr, sal_Int32 nPos ) const;
+ bool isBase( const OUString& rStr, sal_Int32 nPos ) const;
bool isUpper( const OUString& rStr, sal_Int32 nPos ) const;
bool isLetter( const OUString& rStr ) const;
bool isNumeric( const OUString& rStr ) const;