From bfe9a8d8fa8999f5119b05755495d1fb77543017 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Tue, 17 Mar 2009 07:01:15 +0900 Subject: [PATCH] Make psppire_sheet_get_attributes a private function --- lib/gtk-contrib/psppire-sheet.c | 11 ++++++++--- lib/gtk-contrib/psppire-sheet.h | 7 ------- src/ui/gui/psppire-var-sheet.c | 7 ++----- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/lib/gtk-contrib/psppire-sheet.c b/lib/gtk-contrib/psppire-sheet.c index 8a537536..ad1cf78a 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 82de87be..8e83765c 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 bffcfd1d..517a61e0 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; -- 2.30.2