diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-04-24 11:39:20 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-04-24 20:04:50 +0200 |
commit | 697ebd15d646e41bb69726f7b438ebbfaff141b0 (patch) | |
tree | f856e53d26a25d2e38d8b74952e51a55f0765910 | |
parent | 4e287319d581ba2d74c451b2084ed01a8fcae6d7 (diff) |
Resolves: tdf#116951 rhbz#1569331 start is G_MAXINT
and text is nullptr, seeing as an end G_MAXINT translates to str len,
assume the same for start
Change-Id: I76b8bb0e66694129d36bbe08a6d55fc434f3434f
Reviewed-on: https://gerrit.libreoffice.org/53376
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Jenkins <ci@libreoffice.org>
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkframe.cxx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx index 113fcb425963..8a18974d2635 100644 --- a/vcl/unx/gtk3/gtk3gtkframe.cxx +++ b/vcl/unx/gtk3/gtk3gtkframe.cxx @@ -3977,8 +3977,14 @@ void GtkSalFrame::IMHandler::signalIMPreeditChanged( GtkIMContext*, gpointer im_ ExtTextInputAttr sal_attr = ExtTextInputAttr::NONE; pango_attr_iterator_range (iter, &start, &end); - if (end == G_MAXINT) - end = pText ? g_utf8_strlen(pText, -1) : 0; + if (start == G_MAXINT || end == G_MAXINT) + { + auto len = pText ? g_utf8_strlen(pText, -1) : 0; + if (end == G_MAXINT) + end = len; + if (start == G_MAXINT) + start = len; + } if (end == start) continue; |