[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - editeng/source

Julien Nabet (via logerrit) logerrit at kemper.freedesktop.org
Sat May 9 09:52:20 UTC 2020


 editeng/source/editeng/impedit2.cxx |    9 +++++++++
 1 file changed, 9 insertions(+)

New commits:
commit f7661f9da338daedc0a215bab76f4b0b42538913
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: Sat May 9 11:51:40 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>
    (cherry picked from commit 23efced60cb7e08bf17b10e3e1ea5802e68a0cc6)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93544

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;
+                    }
                 }
             }
         }


More information about the Libreoffice-commits mailing list