mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-26 13:41:07 +00:00
Merge branch 'michaelweghorn/a11y_dont_confuse_char_and_byte_count' into 'main'
a11y atspi: Don't use char count as byte count Closes #6151 See merge request GNOME/gtk!6477
This commit is contained in:
commit
71c7e61162
@ -715,7 +715,7 @@ emit_text_changed (GtkAtSpiContext *self,
|
||||
"TextChanged",
|
||||
g_variant_new ("(siiva{sv})",
|
||||
kind, start, end,
|
||||
g_variant_new_take_string (g_strndup (text, end)),
|
||||
g_variant_new_string (text),
|
||||
NULL),
|
||||
NULL);
|
||||
}
|
||||
|
@ -1614,7 +1614,10 @@ insert_text_cb (GtkEditable *editable,
|
||||
return;
|
||||
|
||||
length = g_utf8_strlen (new_text, new_text_length);
|
||||
changed->text_changed (changed->data, "insert", *position - length, length, new_text);
|
||||
|
||||
char *inserted_text = g_utf8_substring (new_text, 0, length);
|
||||
changed->text_changed (changed->data, "insert", *position - length, length, inserted_text);
|
||||
g_free (inserted_text);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -1711,7 +1714,9 @@ insert_range_cb (GtkTextBuffer *buffer,
|
||||
position = gtk_text_iter_get_offset (iter);
|
||||
length = g_utf8_strlen (text, len);
|
||||
|
||||
changed->text_changed (changed->data, "insert", position - length, length, text);
|
||||
char *inserted_text = g_utf8_substring (text, 0, length);
|
||||
changed->text_changed (changed->data, "insert", position - length, length, inserted_text);
|
||||
g_free (inserted_text);
|
||||
|
||||
update_cursor (buffer, changed);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user