diff options
author | Kevin Suo <suokunlong@126.com> | 2022-11-21 23:32:53 +0800 |
---|---|---|
committer | Kevin Suo <suokunlong@126.com> | 2022-11-30 13:40:24 +0100 |
commit | e788317bb58f4e4ad3bf57ee7b0e995cb4407ede (patch) | |
tree | a8847397cd472c1bfb81e78298455aff337aa9a4 /include/i18nutil | |
parent | 11e72e61b64bcabf5c599bc24e0b2f6b62c91b5c (diff) |
tdf#104597 related: restore the mirroring of Bidi_Mirrored characters
The method PDFIProcessor::mirrorString() was removed, and
::comphelper::string::reverseString was used, by Kevin Suo in commit
69e9925ded584113e52f84ef0ed7c224079fa061.
The old PDFIProcessor::mirrorString() did two things:
1) Reverse the code points in the string. However, due to its use of iterateCodePoints(&i)
rather than iterateCodePoints(&i, -1) (i.e. iterating in forward rather than reversed order),
the reverse was not functioning at all.
2) Use GetMirroredChar (i.e. the icu unicode u_charMirror() which was dropped in
commit 720a093461aadff044ac0b1b7b45cf3d416b3785) to get the mirrored-image of
characters with the Bidi_Mirrored properties.
Stephan Bergmann restored the #1 in commit 50d73574b6c3d71f9a539c895a15d6fcda22390b
(by introducing comphelper::string::reverseCodePoints). However, the #2 was not restored.
I do not see a clear reason to drop #2 (at least this is an area I don't quite familiar
with), so it's better to restore it as well, in *this* commit, named as SubstituteBidiMirrored.
Change-Id: Ic263097938310e6e04f3b95bb12e4f4e834198f2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143041
Tested-by: Jenkins
Reviewed-by: Kevin Suo <suokunlong@126.com>
Diffstat (limited to 'include/i18nutil')
-rw-r--r-- | include/i18nutil/unicode.hxx | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/i18nutil/unicode.hxx b/include/i18nutil/unicode.hxx index ebe50ce90384..4d8a84b19c40 100644 --- a/include/i18nutil/unicode.hxx +++ b/include/i18nutil/unicode.hxx @@ -43,6 +43,7 @@ public: static sal_Unicode getUnicodeScriptStart(css::i18n::UnicodeScript type); static sal_Unicode getUnicodeScriptEnd(css::i18n::UnicodeScript type); static sal_uInt8 getUnicodeDirection(const sal_Unicode ch); + static sal_uInt32 GetMirroredChar(sal_uInt32); static bool isControl(const sal_Unicode ch); static bool isAlpha(const sal_Unicode ch); static bool isSpace(const sal_Unicode ch); |