From: John Darrington <john@darrington.wattle.id.au>
Date: Mon, 16 Mar 2009 22:01:15 +0000 (+0900)
Subject: Make psppire_sheet_get_attributes a private function
X-Git-Tag: sav-api~726
X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bfe9a8d8fa8999f5119b05755495d1fb77543017;p=pspp

Make psppire_sheet_get_attributes a private function
---

diff --git a/lib/gtk-contrib/psppire-sheet.c b/lib/gtk-contrib/psppire-sheet.c
index 8a5375368c..ad1cf78a7f 100644
--- a/lib/gtk-contrib/psppire-sheet.c
+++ b/lib/gtk-contrib/psppire-sheet.c
@@ -2098,6 +2098,13 @@ psppire_sheet_unmap (GtkWidget *widget)
     gtk_widget_unmap (sheet->button);
 }
 
+/* get cell attributes of the given cell */
+/* TRUE means that the cell is currently allocated */
+static gboolean psppire_sheet_get_attributes (const PsppireSheet *sheet,
+					      gint row, gint col,
+					      PsppireSheetCellAttr *attributes);
+
+
 
 static void
 psppire_sheet_cell_draw (PsppireSheet *sheet, gint row, gint col)
@@ -5248,7 +5255,7 @@ set_row_height (PsppireSheet *sheet,
     }
 }
 
-gboolean
+static gboolean
 psppire_sheet_get_attributes (const PsppireSheet *sheet, gint row, gint col,
 			  PsppireSheetCellAttr *attr)
 {
@@ -5271,8 +5278,6 @@ psppire_sheet_get_attributes (const PsppireSheet *sheet, gint row, gint col,
   attr->border.mask = 0;
   attr->border.color = GTK_WIDGET (sheet)->style->black;
 
-  attr->is_editable = psppire_sheet_model_is_editable (sheet->model, row, col);
-
   colormap = gtk_widget_get_colormap (GTK_WIDGET (sheet));
   fg = psppire_sheet_model_get_foreground (sheet->model, row, col);
   if ( fg )
diff --git a/lib/gtk-contrib/psppire-sheet.h b/lib/gtk-contrib/psppire-sheet.h
index 82de87bed5..8e83765cbc 100644
--- a/lib/gtk-contrib/psppire-sheet.h
+++ b/lib/gtk-contrib/psppire-sheet.h
@@ -84,7 +84,6 @@ struct _PsppireSheetCellAttr
   GdkColor foreground;
   GdkColor background;
   PsppireSheetCellBorder border;
-  gboolean is_editable;
 };
 
 struct _PsppireSheetHoverTitle
@@ -300,12 +299,6 @@ void psppire_sheet_get_active_cell (PsppireSheet *sheet,
 gchar *psppire_sheet_cell_get_text (const PsppireSheet *sheet, gint row, gint col);
 
 
-/* get cell attributes of the given cell */
-/* TRUE means that the cell is currently allocated */
-gboolean psppire_sheet_get_attributes       (const PsppireSheet *sheet,
-					gint row, gint col,
-					PsppireSheetCellAttr *attributes);
-
 void psppire_sheet_set_model (PsppireSheet *sheet,
 				   PsppireSheetModel *model);
 
diff --git a/src/ui/gui/psppire-var-sheet.c b/src/ui/gui/psppire-var-sheet.c
index bffcfd1dd9..517a61e04b 100644
--- a/src/ui/gui/psppire-var-sheet.c
+++ b/src/ui/gui/psppire-var-sheet.c
@@ -286,7 +286,6 @@ traverse_cell_callback (PsppireSheet *sheet,
 
 
 
-
 /*
    Callback whenever the active cell changes on the var sheet.
 */
@@ -296,7 +295,6 @@ var_sheet_change_active_cell (PsppireVarSheet *vs,
 			      gint oldrow, gint oldcolumn,
 			      gpointer data)
 {
-  PsppireSheetCellAttr attributes;
   PsppireVarStore *var_store;
   PsppireVarSheetClass *vs_class =
     PSPPIRE_VAR_SHEET_CLASS(G_OBJECT_GET_CLASS (vs));
@@ -313,8 +311,6 @@ var_sheet_change_active_cell (PsppireVarSheet *vs,
   g_return_if_fail (oldcolumn == PSPPIRE_VAR_STORE_COL_NAME ||
 		    row < psppire_var_store_get_var_cnt (var_store));
 
-  psppire_sheet_get_attributes (sheet, row, column, &attributes);
-
   var = psppire_var_store_get_var (var_store, row);
 
   switch (column)
@@ -430,7 +426,8 @@ var_sheet_change_active_cell (PsppireVarSheet *vs,
     case PSPPIRE_VAR_STORE_COL_DECIMALS:
     case PSPPIRE_VAR_STORE_COL_COLUMNS:
       {
-	if ( attributes.is_editable)
+	if ( psppire_sheet_model_is_editable (PSPPIRE_SHEET_MODEL(var_store),
+					      row, column))
 	  {
 	    gint r_min, r_max;