editable: Fix a thinko

When dealing with subclasses of GtkEntry, we were not
getting the property offset that is stored on the GtkEntry
type.

This was showing up as criticals when trying to set
::width-chars on a GtkFileChooserEntry.
This commit is contained in:
Matthias Clasen 2019-03-17 18:44:36 -04:00
parent 688f0997f4
commit 26f99bf20c

View File

@ -935,7 +935,10 @@ gtk_editable_delegate_set_property (GObject *object,
GType type = G_TYPE_FROM_INSTANCE (object); GType type = G_TYPE_FROM_INSTANCE (object);
guint first_prop; guint first_prop;
do {
first_prop = GPOINTER_TO_UINT (g_type_get_qdata (type, quark_editable_data)); first_prop = GPOINTER_TO_UINT (g_type_get_qdata (type, quark_editable_data));
type = g_type_parent (type);
} while (first_prop == 0 && type != 0);
if (prop_id < first_prop) if (prop_id < first_prop)
return FALSE; return FALSE;
@ -994,7 +997,10 @@ gtk_editable_delegate_get_property (GObject *object,
GType type = G_TYPE_FROM_INSTANCE (object); GType type = G_TYPE_FROM_INSTANCE (object);
guint first_prop; guint first_prop;
do {
first_prop = GPOINTER_TO_UINT (g_type_get_qdata (type, quark_editable_data)); first_prop = GPOINTER_TO_UINT (g_type_get_qdata (type, quark_editable_data));
type = g_type_parent (type);
} while (first_prop == 0 && type != 0);
if (prop_id < first_prop) if (prop_id < first_prop)
return FALSE; return FALSE;