diff options
Diffstat (limited to 'editeng')
-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; + } } } } |