[Libreoffice-commits] core.git: editeng/source
Julien Nabet (via logerrit)
logerrit at kemper.freedesktop.org
Fri May 8 09:02:51 UTC 2020
editeng/source/editeng/impedit2.cxx | 9 +++++++++
1 file changed, 9 insertions(+)
New commits:
commit 23efced60cb7e08bf17b10e3e1ea5802e68a0cc6
Author: Julien Nabet <serval2412 at yahoo.fr>
AuthorDate: Thu May 7 22:47:06 2020 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri May 8 11:02:15 2020 +0200
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 at collabora.co.uk>
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;
+ }
}
}
}
More information about the Libreoffice-commits
mailing list