summaryrefslogtreecommitdiff
path: root/vcl/unx/gtk3/gtk3gtkframe.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/unx/gtk3/gtk3gtkframe.cxx')
-rw-r--r--vcl/unx/gtk3/gtk3gtkframe.cxx10
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;