forked from AuroraMiddleware/gtk
gtkentry: Call get_*_size() vfuncs unconditionally
These vfuncs cannot be NULL: implementations are provided by GtkEntry, and subclasses should not set them to NULL. Instead of conditionalising the calls to the vfuncs, assert that they’re set and call them unconditionally. This prevents the possibility of a subclass setting the vfunc to NULL and then a gtk_entry_get_*_size() call returning undefined values in its out variables. https://bugzilla.gnome.org/show_bug.cgi?id=712760
This commit is contained in:
parent
0282714d86
commit
7479133753
@ -3626,7 +3626,7 @@ get_text_area_size (GtkEntry *entry,
|
|||||||
|
|
||||||
class = GTK_ENTRY_GET_CLASS (entry);
|
class = GTK_ENTRY_GET_CLASS (entry);
|
||||||
|
|
||||||
if (class->get_text_area_size)
|
g_assert (class->get_text_area_size != NULL);
|
||||||
class->get_text_area_size (entry, x, y, width, height);
|
class->get_text_area_size (entry, x, y, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3704,7 +3704,7 @@ get_frame_size (GtkEntry *entry,
|
|||||||
|
|
||||||
class = GTK_ENTRY_GET_CLASS (entry);
|
class = GTK_ENTRY_GET_CLASS (entry);
|
||||||
|
|
||||||
if (class->get_frame_size)
|
g_assert (class->get_frame_size != NULL);
|
||||||
class->get_frame_size (entry, x, y, width, height);
|
class->get_frame_size (entry, x, y, width, height);
|
||||||
|
|
||||||
if (!relative_to_window)
|
if (!relative_to_window)
|
||||||
|
Loading…
Reference in New Issue
Block a user