diff options
author | Mark Hung <marklh9@gmail.com> | 2019-05-26 14:32:09 +0800 |
---|---|---|
committer | Mark Hung <marklh9@gmail.com> | 2019-05-30 10:58:33 +0200 |
commit | 6a7db071c75609093fc3a9cbc297b8069726a33e (patch) | |
tree | 58a7f32e63bcfbb9c1351b1c7bfa9c400f458cde /sw | |
parent | 799dac2e621bf14f613b3ee4f6a711b49c0c5e81 (diff) |
tdf#125497 allow backspace to remove CJK IVS.
Japanese users prefer to remove a CJK IVS character
when pressing the backspace instead of removing
the selector part of IVS.
Change-Id: I4313d69ed52d82c5a7e4e4823b1da06f1d90bdad
Reviewed-on: https://gerrit.libreoffice.org/72971
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/uibase/wrtsh/delete.cxx | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/sw/source/uibase/wrtsh/delete.cxx b/sw/source/uibase/wrtsh/delete.cxx index d15a46db78b3..bddd1daaa9d2 100644 --- a/sw/source/uibase/wrtsh/delete.cxx +++ b/sw/source/uibase/wrtsh/delete.cxx @@ -44,23 +44,6 @@ inline void SwWrtShell::CloseMark( bool bOkFlag ) EndAllAction(); } -namespace { - -bool isUnicodeVariationSequenceSelector( sal_uInt32 nCode ) -{ - return ( nCode >= 0xFE00 && nCode <= 0xFE0F ) // Variation Selectors block - || ( nCode >= 0xE0100 && nCode <= 0xE01EF );// Variation Selectors Supplement block -} - -// Return if the character might be a base character of a CJK ideographic variation sequence -bool isCJKIVSCharacters( 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 -} - -} // #i23725# @@ -268,14 +251,14 @@ bool SwWrtShell::DelLeft() nCode = sStr.iterateCodePoints( &nIndex ); } - if ( isUnicodeVariationSequenceSelector( nCode ) ) + if ( rtl::isIVSSelector( nCode ) ) { SwCursorShell::Push(); SwCursorShell::Left(1, CRSR_SKIP_CHARS); OUString sStr = GetSelText(); sal_Int32 nIndex = 0; nCode = sStr.iterateCodePoints( &nIndex ); - if ( isCJKIVSCharacters( nCode ) ) + if ( rtl::isCJKIVSCharacter( nCode ) ) SwCursorShell::Pop( SwCursorShell::PopMode::DeleteStack ); else SwCursorShell::Pop( SwCursorShell::PopMode::DeleteCurrent ); // For the weak script. |