summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2020-05-07 22:47:06 +0200
committerAndras Timar <andras.timar@collabora.com>2020-05-13 10:56:09 +0200
commit606e0e4e57276b9c07da7f6617b5e3951b8e95ed (patch)
treef23bb50c51b0b2bd289511e6d8b827e7d0f52e00 /editeng
parent35a3d706d0d7da928ab4dcaddc007594796c24b6 (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> (cherry picked from commit 23efced60cb7e08bf17b10e3e1ea5802e68a0cc6) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93544
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/editeng/impedit2.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index 7fe64b194097..607664c0f3d0 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -58,6 +58,8 @@
#include <com/sun/star/system/SystemShellExecuteFlags.hpp>
#include <com/sun/star/system/XSystemShellExecute.hpp>
+#include <rtl/character.hxx>
+
#include <sal/log.hxx>
#include <osl/diagnose.h>
#include <sot/exchange.hxx>
@@ -3847,6 +3849,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;
+ }
}
}
}