[Libreoffice-commits] core.git: vcl/unx

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Tue Sep 17 11:09:09 UTC 2019


 vcl/unx/gtk3/gtk3gtkframe.cxx |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 087995401447a4d452e3daf147c02fb66c7b05c1
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Tue Sep 17 11:49:24 2019 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Tue Sep 17 13:08:13 2019 +0200

    Better fix
    
    ...for 32efe70bbfc6c64df7cf73b6a6c0976ae1e038c8 "Fix linux x86 build"
    
    Change-Id: Ic935300777fc43dfb315e1117ca7f96916cc43c6
    Reviewed-on: https://gerrit.libreoffice.org/79050
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index 16897ef51798..f3edf71d9c41 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -3999,7 +3999,8 @@ void GtkSalFrame::IMHandler::signalIMPreeditChanged( GtkIMContext*, gpointer im_
     for (sal_Int32 nUtf16Offset = 0; nUtf16Offset < rText.getLength(); rText.iterateCodePoints(&nUtf16Offset))
         aUtf16Offsets.push_back(nUtf16Offset);
 
-    int nUtf32Len = aUtf16Offsets.size();
+    sal_Int32 nUtf32Len = aUtf16Offsets.size();
+        // from the above loop filling aUtf16Offsets, we know that its size() fits into sal_Int32
     aUtf16Offsets.push_back(rText.getLength());
 
     // sanitize the CurPos which is in utf-32
@@ -4040,8 +4041,8 @@ void GtkSalFrame::IMHandler::signalIMPreeditChanged( GtkIMContext*, gpointer im_
         sal_Int32 nUtf32End = g_utf8_pointer_to_offset(pText, pText + nUtf8End);
 
         // sanitize the utf32 range
-        nUtf32Start = std::min(nUtf32Start, sal_Int32(nUtf32Len));
-        nUtf32End = std::min(nUtf32End, sal_Int32(nUtf32Len));
+        nUtf32Start = std::min(nUtf32Start, nUtf32Len);
+        nUtf32End = std::min(nUtf32End, nUtf32Len);
         if (nUtf32Start >= nUtf32End)
             continue;
 


More information about the Libreoffice-commits mailing list