[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - vcl/unx

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu Sep 5 09:09:59 UTC 2019


 vcl/unx/gtk3/gtk3gtkframe.cxx |   23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

New commits:
commit add68a1a3f5466ecf567df79119a1cade4058401
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Sep 4 19:57:26 2019 +0100
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Thu Sep 5 11:09:20 2019 +0200

    ctrl+shift+e emoji ibus engine problems converting UCS-4 positions to UTF-16
    
    e.g. ctrl+shift+e type rabbit then space in writer and the len of underline
    is 2 which should encompass the displayed e + 2 UTF-16 units
    
    Change-Id: I424db7dd6cbcc5845922ac17208fed643e672dbd
    Reviewed-on: https://gerrit.libreoffice.org/78616
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>

diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index 994fb356eb53..742e0097def7 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -4026,6 +4026,29 @@ void GtkSalFrame::IMHandler::signalIMPreeditChanged( GtkIMContext*, gpointer im_
             sal_attr |= ExtTextInputAttr::Underline;
         g_slist_free (attr_list);
 
+        // rhbz#1648281 make underline work with the UCS-4 positions we're given
+        if (!pThis->m_aInputEvent.maText.isEmpty())
+        {
+            sal_Int32 i(0), nLen = pThis->m_aInputEvent.maText.getLength();
+
+            sal_Int32 nUTF16Start(0);
+            while (i < start && nUTF16Start < nLen)
+            {
+                pThis->m_aInputEvent.maText.iterateCodePoints(&nUTF16Start);
+                ++i;
+            }
+
+            sal_Int32 nUTF16End(nUTF16Start);
+            while (i < end && nUTF16End < nLen)
+            {
+                pThis->m_aInputEvent.maText.iterateCodePoints(&nUTF16End);
+                ++i;
+            }
+
+            start = nUTF16Start;
+            end = nUTF16End;
+        }
+
         // Set the sal attributes on our text
         for (int i = start; i < end; ++i)
         {


More information about the Libreoffice-commits mailing list