diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2020-05-07 22:47:06 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-08 11:02:15 +0200 |
commit | 23efced60cb7e08bf17b10e3e1ea5802e68a0cc6 (patch) | |
tree | 6c00ce985023b29ffa40634523324e21dc40e31c /editeng/source | |
parent | 62f77e94702657aa25e247da71dab012e280679e (diff) |
tdf#102625: fix Formula editor breaks surrogate pairs
Change-Id: I616cda97367a8fdfb6ae10eb687ca7490a943692
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93684
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng/source')
-rw-r--r-- | editeng/source/editeng/impedit2.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index ffa93a144efd..124b310ca249 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -49,6 +49,8 @@ #include <com/sun/star/system/SystemShellExecuteFlags.hpp> #include <com/sun/star/system/XSystemShellExecute.hpp> +#include <rtl/character.hxx> + #include <sal/log.hxx> #include <o3tl/safeint.hxx> #include <osl/diagnose.h> @@ -3829,6 +3831,13 @@ sal_Int32 ImpEditEngine::GetChar( nChar = ( std::abs( nRight - nChar ) < std::abs( nLeft - nChar ) ) ? nRight : nLeft; } } + else + { + OUString aStr(pParaPortion->GetNode()->GetString()); + // tdf#102625: don't select middle of a pair of surrogates with mouse cursor + if (rtl::isSurrogate(aStr[nChar])) + --nChar; + } } } } |