mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-27 14:10:30 +00:00
editable: Less draconian preconditions
Getting or deleting an empty string should be ok, and we do it ourselves, e.g. in the file chooser. Fixes: #6463
This commit is contained in:
parent
33f210bc85
commit
239d47791d
@ -517,7 +517,7 @@ gtk_editable_delete_text (GtkEditable *editable,
|
||||
{
|
||||
g_return_if_fail (GTK_IS_EDITABLE (editable));
|
||||
g_return_if_fail (start_pos >= 0);
|
||||
g_return_if_fail (end_pos == -1 || end_pos > start_pos);
|
||||
g_return_if_fail (end_pos == -1 || end_pos >= start_pos);
|
||||
|
||||
GTK_EDITABLE_GET_IFACE (editable)->do_delete_text (editable, start_pos, end_pos);
|
||||
}
|
||||
@ -552,7 +552,7 @@ gtk_editable_get_chars (GtkEditable *editable,
|
||||
|
||||
g_return_val_if_fail (GTK_IS_EDITABLE (editable), NULL);
|
||||
g_return_val_if_fail (start_pos >= 0, NULL);
|
||||
g_return_val_if_fail (end_pos == -1 || end_pos > start_pos, NULL);
|
||||
g_return_val_if_fail (end_pos == -1 || end_pos >= start_pos, NULL);
|
||||
|
||||
text = GTK_EDITABLE_GET_IFACE (editable)->get_text (editable);
|
||||
length = g_utf8_strlen (text, -1);
|
||||
|
Loading…
Reference in New Issue
Block a user