diff options
author | Khaled Hosny <khaled@libreoffice.org> | 2023-05-29 11:27:40 +0300 |
---|---|---|
committer | خالد حسني <khaled@libreoffice.org> | 2023-05-29 16:23:07 +0200 |
commit | d7ddac208516ce2350c84c434aad933b345c9509 (patch) | |
tree | 6ca3b8af2fff138501c48b6e4235e38513292f3b /i18nutil | |
parent | ab1985d0b39e8bcc976543b9700e04610f434423 (diff) |
Remove recently unused CTLScriptType code
This is now unused after:
commit 98f7ec383db74a6491e925e30125d3fbf270afc2
Author: Khaled Hosny <khaled@libreoffice.org>
Date: Sun May 28 16:28:52 2023 +0300
tdf#139863, tdf#155514: Don’t split COMPLEX text portions
The code is also broken as it doesn’t handle surrogate pairs.
The UNO API now throws an exception.
Change-Id: I454ed741e3834e762a2731d671c21a3e73515da3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152359
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: خالد حسني <khaled@libreoffice.org>
Diffstat (limited to 'i18nutil')
-rw-r--r-- | i18nutil/source/utility/scripttypedetector.cxx | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/i18nutil/source/utility/scripttypedetector.cxx b/i18nutil/source/utility/scripttypedetector.cxx index f096ecbde831..5bc3f9bb2aa1 100644 --- a/i18nutil/source/utility/scripttypedetector.cxx +++ b/i18nutil/source/utility/scripttypedetector.cxx @@ -17,7 +17,6 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <com/sun/star/i18n/CTLScriptType.hpp> #include <com/sun/star/i18n/ScriptDirection.hpp> #include <com/sun/star/i18n/UnicodeScript.hpp> #include <i18nutil/scripttypedetector.hxx> @@ -82,52 +81,4 @@ sal_Int32 ScriptTypeDetector::endOfScriptDirection( std::u16string_view Text, sa return cPos == nPos ? -1 : cPos; } -sal_Int16 ScriptTypeDetector::getCTLScriptType( std::u16string_view Text, sal_Int32 nPos ) -{ - static const ScriptTypeList typeList[] = { - { UnicodeScript_kHebrew, UnicodeScript_kHebrew, CTLScriptType::CTL_HEBREW }, // 10 - { UnicodeScript_kArabic, UnicodeScript_kArabic, CTLScriptType::CTL_ARABIC }, // 11 - { UnicodeScript_kDevanagari, UnicodeScript_kDevanagari, CTLScriptType::CTL_INDIC }, // 14 - { UnicodeScript_kThai, UnicodeScript_kThai, CTLScriptType::CTL_THAI }, // 24 - { UnicodeScript_kScriptCount, UnicodeScript_kScriptCount, CTLScriptType::CTL_UNKNOWN } // 88 - }; - - return unicode::getUnicodeScriptType(Text[nPos], typeList); -} - -// Begin of Script Type is inclusive. -sal_Int32 ScriptTypeDetector::beginOfCTLScriptType( std::u16string_view Text, sal_Int32 nPos ) -{ - if (nPos < 0) - return 0; - else if (o3tl::make_unsigned(nPos) >= Text.size()) - return Text.size(); - else { - sal_Int16 cType = getCTLScriptType(Text, nPos); - for (nPos--; nPos >= 0; nPos--) { - if (cType != getCTLScriptType(Text, nPos)) - break; - } - return nPos + 1; - } -} - -// End of the Script Type is exclusive, the return value pointing to the begin of next script type -sal_Int32 ScriptTypeDetector::endOfCTLScriptType( std::u16string_view Text, sal_Int32 nPos ) -{ - if (nPos < 0) - return 0; - else if (o3tl::make_unsigned(nPos) >= Text.size()) - return Text.size(); - else { - sal_Int16 cType = getCTLScriptType(Text, nPos); - sal_Int32 len = Text.size(); - for (nPos++; nPos < len; nPos++) { - if (cType != getCTLScriptType(Text, nPos)) - break; - } - return nPos; - } -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |