summaryrefslogtreecommitdiffstats
path: root/editeng/source
diff options
context:
space:
mode:
authorMark Hung <marklh9@gmail.com>2019-05-26 14:32:09 +0800
committerMark Hung <marklh9@gmail.com>2019-05-30 10:58:33 +0200
commit6a7db071c75609093fc3a9cbc297b8069726a33e (patch)
tree58a7f32e63bcfbb9c1351b1c7bfa9c400f458cde /editeng/source
parenttdf#125372 writer, file with lots of hints very slow to open, part5 (diff)
downloadcore-6a7db071c75609093fc3a9cbc297b8069726a33e.tar.gz
core-6a7db071c75609093fc3a9cbc297b8069726a33e.zip
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 'editeng/source')
-rw-r--r--editeng/source/editeng/impedit2.cxx16
1 files changed, 15 insertions, 1 deletions
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index 8764b097e698..58629d811b1b 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -60,6 +60,7 @@
#include <sot/exchange.hxx>
#include <sot/formats.hxx>
#include <svl/asiancfg.hxx>
+#include <rtl/character.hxx>
#include <comphelper/lok.hxx>
#include <unotools/configmgr.hxx>
@@ -2300,7 +2301,20 @@ EditPaM ImpEditEngine::DeleteLeftOrRight( const EditSelection& rSel, sal_uInt8 n
{
if ( nDelMode == DeleteMode::Simple )
{
- aDelStart = CursorLeft( aCurPos, i18n::CharacterIteratorMode::SKIPCHARACTER );
+ sal_uInt16 nCharMode = i18n::CharacterIteratorMode::SKIPCHARACTER;
+ // Check if we are deleting a CJK ideograph variance sequence (IVS).
+ sal_Int32 nIndex = aCurPos.GetIndex();
+ if (nIndex > 0)
+ {
+ 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)))
+ {
+ nCharMode = i18n::CharacterIteratorMode::SKIPCELL;
+ }
+ }
+ aDelStart = CursorLeft(aCurPos, nCharMode);
}
else if ( nDelMode == DeleteMode::RestOfWord )
{