From ca14465d46693e9f0b77051d7f57f7e88950a4c3 Mon Sep 17 00:00:00 2001
From: Li Yuan <li.yuan@sun.com>
Date: Wed, 24 Nov 2004 10:34:55 +0000
Subject: check whether header_canvas and table_canvas is NULL.

2004-11-24  Li Yuan  <li.yuan@sun.com>

        * e-table.c: (e_table_get_cell_geometry):
        check whether header_canvas and table_canvas is NULL.

svn path=/trunk/; revision=27980
---
 widgets/table/e-table.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

(limited to 'widgets')

diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c
index ab836fb372..00aa37e88b 100644
--- a/widgets/table/e-table.c
+++ b/widgets/table/e-table.c
@@ -2392,11 +2392,13 @@ e_table_get_cell_geometry (ETable *table,
 
 	e_table_group_get_cell_geometry(table->group, &row, &col, x_return, y_return, width_return, height_return);
 
-	if (x_return)
+	if (x_return && table->table_canvas)
 		(*x_return) -= GTK_LAYOUT(table->table_canvas)->hadjustment->value;
 	if (y_return) {
-		(*y_return) -= GTK_LAYOUT(table->table_canvas)->vadjustment->value;
-		(*y_return) += GTK_WIDGET(table->header_canvas)->allocation.height;
+		if (table->table_canvas)
+			(*y_return) -= GTK_LAYOUT(table->table_canvas)->vadjustment->value;
+		if (table->header_canvas)
+			(*y_return) += GTK_WIDGET(table->header_canvas)->allocation.height;
 	}
 }
 
-- 
cgit v1.2.3