summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--editeng/source/editeng/impedit2.cxx6
-rw-r--r--include/i18nutil/unicode.hxx25
-rw-r--r--include/rtl/character.hxx29
-rw-r--r--sw/source/uibase/wrtsh/delete.cxx5
4 files changed, 31 insertions, 34 deletions
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index 58629d811b1b..472a3d78de14 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -60,7 +60,7 @@
#include <sot/exchange.hxx>
#include <sot/formats.hxx>
#include <svl/asiancfg.hxx>
-#include <rtl/character.hxx>
+#include <i18nutil/unicode.hxx>
#include <comphelper/lok.hxx>
#include <unotools/configmgr.hxx>
@@ -2308,8 +2308,8 @@ EditPaM ImpEditEngine::DeleteLeftOrRight( const EditSelection& rSel, sal_uInt8 n
{
const OUString& rString = aCurPos.GetNode()->GetString();
sal_Int32 nCode = rString.iterateCodePoints(&nIndex, -1);
- if (rtl::isIVSSelector(nCode) && nIndex > 0 &&
- rtl::isCJKIVSCharacter(rString.iterateCodePoints(&nIndex, -1)))
+ if (unicode::isIVSSelector(nCode) && nIndex > 0 &&
+ unicode::isCJKIVSCharacter(rString.iterateCodePoints(&nIndex, -1)))
{
nCharMode = i18n::CharacterIteratorMode::SKIPCELL;
}
diff --git a/include/i18nutil/unicode.hxx b/include/i18nutil/unicode.hxx
index b3563e529a38..c0b20a33cba8 100644
--- a/include/i18nutil/unicode.hxx
+++ b/include/i18nutil/unicode.hxx
@@ -47,6 +47,31 @@ public:
static bool isSpace( const sal_Unicode ch);
static bool isWhiteSpace( const sal_Unicode ch);
+ /** Check for Unicode variation sequence selectors
+
+ @param nCode A Unicode code point.
+
+ @return True if code is an Unicode variation sequence selector.
+ */
+ static bool isIVSSelector(sal_uInt32 nCode)
+ {
+ return (nCode >= 0xFE00 && nCode <= 0xFE0F) // Variation Selectors block
+ || (nCode >= 0xE0100 && nCode <= 0xE01EF);// Variation Selectors Supplement block
+ }
+
+ /** Check for base characters of a CJK ideographic variation sequence (IVS)
+
+ @param nCode A Unicode code point.
+
+ @return True if code is an Unicode base character part of CJK IVS
+ */
+ static bool isCJKIVSCharacter(sal_uInt32 nCode)
+ {
+ return (nCode >= 0x4E00 && nCode <= 0x9FFF) // CJK Unified Ideographs
+ || (nCode >= 0x3400 && nCode <= 0x4DBF) // CJK Unified Ideographs Extension A
+ || (nCode >= 0x20000 && nCode <= 0x2A6DF); // CJK Unified Ideographs Extension B
+ }
+
//Map an ISO 15924 script code to Latin/Asian/Complex/Weak
static sal_Int16 getScriptClassFromUScriptCode(UScriptCode eScript);
diff --git a/include/rtl/character.hxx b/include/rtl/character.hxx
index 102c411cb79a..a18d05d6a5e8 100644
--- a/include/rtl/character.hxx
+++ b/include/rtl/character.hxx
@@ -57,35 +57,6 @@ inline bool isAscii(sal_uInt32 code)
return code <= 0x7F;
}
-/** Check for Unicode variation sequence selectors
-
- @param nCode A Unicode code point.
-
- @return True if code is an Unicode variation sequence selector.
-
- @since LibreOffice 6.3
- */
-inline bool isIVSSelector(sal_uInt32 nCode)
-{
- return (nCode >= 0xFE00 && nCode <= 0xFE0F) // Variation Selectors block
- || (nCode >= 0xE0100 && nCode <= 0xE01EF);// Variation Selectors Supplement block
-}
-
-/** Check for base characters of a CJK ideographic variation sequence (IVS)
-
- @param nCode A Unicode code point.
-
- @return True if code is an Unicode base character part of CJK IVS
-
- @since LibreOffice 6.3
- */
-inline bool isCJKIVSCharacter(sal_uInt32 nCode)
-{
- return (nCode >= 0x4E00 && nCode <= 0x9FFF) // CJK Unified Ideographs
- || (nCode >= 0x3400 && nCode <= 0x4DBF) // CJK Unified Ideographs Extension A
- || (nCode >= 0x20000 && nCode <= 0x2A6DF); // CJK Unified Ideographs Extension B
-}
-
#if defined LIBO_INTERNAL_ONLY
bool isAscii(char) = delete;
bool isAscii(signed char) = delete;
diff --git a/sw/source/uibase/wrtsh/delete.cxx b/sw/source/uibase/wrtsh/delete.cxx
index bddd1daaa9d2..4675bcad5149 100644
--- a/sw/source/uibase/wrtsh/delete.cxx
+++ b/sw/source/uibase/wrtsh/delete.cxx
@@ -23,6 +23,7 @@
#include <view.hxx>
#include <drawbase.hxx>
#include <unobaseclass.hxx>
+#include <i18nutil/unicode.hxx>
#include <rtl/character.hxx>
inline void SwWrtShell::OpenMark()
@@ -251,14 +252,14 @@ bool SwWrtShell::DelLeft()
nCode = sStr.iterateCodePoints( &nIndex );
}
- if ( rtl::isIVSSelector( nCode ) )
+ if ( unicode::isIVSSelector( nCode ) )
{
SwCursorShell::Push();
SwCursorShell::Left(1, CRSR_SKIP_CHARS);
OUString sStr = GetSelText();
sal_Int32 nIndex = 0;
nCode = sStr.iterateCodePoints( &nIndex );
- if ( rtl::isCJKIVSCharacter( nCode ) )
+ if ( unicode::isCJKIVSCharacter( nCode ) )
SwCursorShell::Pop( SwCursorShell::PopMode::DeleteStack );
else
SwCursorShell::Pop( SwCursorShell::PopMode::DeleteCurrent ); // For the weak script.