[gnome-control-center] shell: Fix possible crashers when there are no pages



commit 7d7fc2e12453f85f0a0f90a77b6f01d89fb4bf4c
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Jun 12 18:16:36 2012 +0100

    shell: Fix possible crashers when there are no pages
    
    Wouldn't happen in gnome-control-center. Spotted by Jasper St. Pierre

 shell/cc-notebook.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/shell/cc-notebook.c b/shell/cc-notebook.c
index bc75c64..05d1941 100644
--- a/shell/cc-notebook.c
+++ b/shell/cc-notebook.c
@@ -144,7 +144,7 @@ cc_notebook_get_preferred_height (GtkWidget       *widget,
 	notebook = CC_NOTEBOOK (widget);
 
 	if (notebook->priv->selected_page == NULL) {
-		gtk_widget_get_preferred_height (notebook->priv->selected_page, minimum_height, natural_height);
+		gtk_widget_get_preferred_height (notebook->priv->embed, minimum_height, natural_height);
 		return;
 	}
 
@@ -172,7 +172,7 @@ cc_notebook_get_preferred_width_for_height (GtkWidget       *widget,
 	notebook = CC_NOTEBOOK (widget);
 
 	if (notebook->priv->selected_page == NULL) {
-		gtk_widget_get_preferred_width_for_height (notebook->priv->selected_page, height, minimum_width, natural_width);
+		gtk_widget_get_preferred_width_for_height (notebook->priv->embed, height, minimum_width, natural_width);
 		return;
 	}
 
@@ -199,7 +199,7 @@ cc_notebook_get_preferred_width (GtkWidget       *widget,
 	notebook = CC_NOTEBOOK (widget);
 
 	if (notebook->priv->selected_page == NULL) {
-		gtk_widget_get_preferred_height (notebook->priv->selected_page, minimum_width, natural_width);
+		gtk_widget_get_preferred_height (notebook->priv->embed, minimum_width, natural_width);
 		return;
 	}
 
@@ -227,7 +227,7 @@ cc_notebook_get_preferred_height_for_width (GtkWidget       *widget,
 	notebook = CC_NOTEBOOK (widget);
 
 	if (notebook->priv->selected_page == NULL) {
-		gtk_widget_get_preferred_height_for_width (notebook->priv->selected_page, width, minimum_height, natural_height);
+		gtk_widget_get_preferred_height_for_width (notebook->priv->embed, width, minimum_height, natural_height);
 		return;
 	}
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]