[gtk+] combobox: If typechecking, don’t reference before
- From: Daniel Boles <dboles src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] combobox: If typechecking, don’t reference before
- Date: Fri, 20 Jan 2017 21:09:56 +0000 (UTC)
commit 802f838aa080f803e337bac122cea1163cfdbf0b
Author: Daniel Boles <dboles src gnome org>
Date: Fri Jan 20 20:43:19 2017 +0000
combobox: If typechecking, don’t reference before
gtk/gtkcombobox.c | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c
index 5031a7c..7581fea 100644
--- a/gtk/gtkcombobox.c
+++ b/gtk/gtkcombobox.c
@@ -1717,7 +1717,7 @@ gtk_combo_box_popup_for_device (GtkComboBox *combo_box,
/* As above, this currently does not do anything useful, and nothing with the
* passed-in device. But the bits that are not blatantly obsolete are kept. */
- GtkComboBoxPrivate *priv = combo_box->priv;
+ GtkComboBoxPrivate *priv;
g_return_if_fail (GTK_IS_COMBO_BOX (combo_box));
g_return_if_fail (GDK_IS_DEVICE (device));
@@ -1725,6 +1725,8 @@ gtk_combo_box_popup_for_device (GtkComboBox *combo_box,
if (!gtk_widget_get_realized (GTK_WIDGET (combo_box)))
return;
+ priv = combo_box->priv;
+
if (gtk_widget_get_mapped (priv->popup_widget))
return;
@@ -1767,10 +1769,12 @@ gtk_combo_box_real_popdown (GtkComboBox *combo_box)
void
gtk_combo_box_popdown (GtkComboBox *combo_box)
{
- GtkComboBoxPrivate *priv = combo_box->priv;
+ GtkComboBoxPrivate *priv;
g_return_if_fail (GTK_IS_COMBO_BOX (combo_box));
+ priv = combo_box->priv;
+
if (priv->popup_widget)
gtk_menu_popdown (GTK_MENU (priv->popup_widget));
}
@@ -2790,7 +2794,7 @@ gtk_combo_box_set_model (GtkComboBox *combo_box,
priv = combo_box->priv;
- if (model == combo_box->priv->model)
+ if (model == priv->model)
return;
gtk_combo_box_unset_model (combo_box);
@@ -3465,11 +3469,12 @@ void
gtk_combo_box_set_entry_text_column (GtkComboBox *combo_box,
gint text_column)
{
- GtkComboBoxPrivate *priv = combo_box->priv;
+ GtkComboBoxPrivate *priv;
GtkTreeModel *model;
g_return_if_fail (GTK_IS_COMBO_BOX (combo_box));
+ priv = combo_box->priv;
model = gtk_combo_box_get_model (combo_box);
g_return_if_fail (text_column >= 0);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]