[gnumeric] Cleanup: remove unused functions and make various functions static.



commit 9d5c35904ef726d7facf66b64088d11fe90cb7e8
Author: Morten Welinder <terra gnome org>
Date:   Sun May 22 18:09:51 2011 -0400

    Cleanup: remove unused functions and make various functions static.

 ChangeLog                         |   22 ++++++++++++++
 src/colrow.c                      |   36 -----------------------
 src/func-builtin.c                |    4 +-
 src/func-builtin.h                |    2 -
 src/gnm-marshalers.list           |    5 ---
 src/gnm-pane.c                    |   16 +++++-----
 src/sheet-style.c                 |   40 -------------------------
 src/sheet-view.c                  |   31 -------------------
 src/sheet.c                       |   58 ++++++++++++++++++------------------
 src/sheet.h                       |    2 -
 src/sort.c                        |    2 +-
 src/sort.h                        |    1 -
 src/wbc-gtk.c                     |   36 +++++++++++-----------
 src/wbc-gtk.h                     |    3 --
 src/widgets/ChangeLog             |    5 +++
 src/widgets/gnumeric-expr-entry.c |   18 -----------
 src/widgets/gnumeric-expr-entry.h |    1 -
 17 files changed, 85 insertions(+), 197 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 9d86c51..5a6b78c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,27 @@
 2011-05-22  Morten Welinder  <terra gnome org>
 
+	* src/sheet-view.c (sv_is_region_empty_or_selected): Unused.  Remove.
+
+	* src/gnm-marshalers.list: Remove unused marshallers.
+
+	* src/gnm-pane.c (control_circle_get_type, item_acetate_get_type):
+	Make static.
+
+	* src/colrow.c (colrow_find_adjacent_visible): Unused.  Remove.
+
+	* src/sort.c (gnm_sort_data_length): Make static.
+
+	* src/sheet.c (sheet_redraw_cell): Make static.
+
+	* src/sheet-style.c (sheet_style_set_col, sheet_style_set_row):
+	Unused.  Remove.
+
+	* src/func-builtin.c (gnumeric_sum, gnumeric_product): Make
+	static.
+
+	* src/wbc-gtk.c (wbcg_ui_update_begin, wbcg_ui_update_end): Make
+	static.
+
 	* src/expr-name.c (expr_name_set_is_placeholder): New function.
 	(expr_name_downgrade_to_placeholder): Simplify using
 	expr_name_set_is_placeholder.
diff --git a/src/colrow.c b/src/colrow.c
index 5f5e073..b9bff8c 100644
--- a/src/colrow.c
+++ b/src/colrow.c
@@ -1037,42 +1037,6 @@ colrow_find_outline_bound (Sheet const *sheet, gboolean is_cols,
 }
 
 /**
- * colrow_find_adjacent_visible:
- * @sheet:   Sheet to search on.
- * @is_cols: If true find next column else find next row.
- * @index:   The col/row index to start at.
- * @forward: If set seek forward otherwise seek backwards.
- *
- * Return value: The index of the next visible col/row or -1 if
- *               there are no more visible cols/rows left.
- **/
-int
-colrow_find_adjacent_visible (Sheet *sheet, gboolean is_cols,
-			      int index, gboolean forward)
-{
-	int const max = colrow_max (is_cols, sheet);
-	int i         = index; /* To avoid trouble at edges */
-
-	do {
-		ColRowInfo * const cri = sheet_colrow_fetch (sheet, i, is_cols);
-
-		if (cri->visible)
-			return i;
-
-		if (forward) {
-			if (++i >= max) {
-				i       = index;
-				forward = FALSE;
-			}
-		} else
-			i--;
-
-	} while (i > 0);
-
-	return -1;
-}
-
-/**
  * colrow_set_visibility:
  * @sheet	: the sheet
  * @is_cols	: Are we dealing with rows or columns.
diff --git a/src/func-builtin.c b/src/func-builtin.c
index 325ff3a..f24fa2b 100644
--- a/src/func-builtin.c
+++ b/src/func-builtin.c
@@ -52,7 +52,7 @@ static GnmFuncHelp const help_sum[] = {
 	{ GNM_FUNC_HELP_END }
 };
 
-GnmValue *
+static GnmValue *
 gnumeric_sum (GnmFuncEvalInfo *ei, int argc, GnmExprConstPtr const *argv)
 {
 	return float_range_function (argc, argv, ei,
@@ -89,7 +89,7 @@ range_bogusproduct (gnm_float const *xs, int n, gnm_float *res)
 		return gnm_range_product (xs, n, res);
 }
 
-GnmValue *
+static GnmValue *
 gnumeric_product (GnmFuncEvalInfo *ei, int argc, GnmExprConstPtr const *argv)
 {
 	return float_range_function (argc, argv, ei,
diff --git a/src/func-builtin.h b/src/func-builtin.h
index 30253e6..e469909 100644
--- a/src/func-builtin.h
+++ b/src/func-builtin.h
@@ -6,8 +6,6 @@
 
 G_BEGIN_DECLS
 
-GnmValue *gnumeric_sum     (GnmFuncEvalInfo *ei, int argc, GnmExprConstPtr const *argv);
-GnmValue *gnumeric_product (GnmFuncEvalInfo *ei, int argc, GnmExprConstPtr const *argv);
 GnmValue *gnumeric_if      (GnmFuncEvalInfo *ei, GnmValue const * const *args);
 GnmValue *gnumeric_if2     (GnmFuncEvalInfo *ei, int argc, GnmExprConstPtr const *argv, GnmExprEvalFlags flags);
 
diff --git a/src/gnm-marshalers.list b/src/gnm-marshalers.list
index bbe5bbd..52c2879 100644
--- a/src/gnm-marshalers.list
+++ b/src/gnm-marshalers.list
@@ -20,11 +20,6 @@
 #   OBJECT      for GObject or derived types (GObject*)
 #   NONE        deprecated alias for VOID
 #   BOOL        deprecated alias for BOOLEAN
-BOOLEAN:OBJECT
 BOOLEAN:POINTER
 BOOLEAN:OBJECT,POINTER
-INT:INT
-POINTER:INT,INT
-POINTER:VOID
-VOID:INT,INT
 VOID:BOOLEAN,INT
diff --git a/src/gnm-pane.c b/src/gnm-pane.c
index 44e97b4..01e402a 100644
--- a/src/gnm-pane.c
+++ b/src/gnm-pane.c
@@ -2655,7 +2655,7 @@ typedef GocCircleClass ControlCircleClass;
 #define CONTROL_CIRCLE(o)	(G_TYPE_CHECK_INSTANCE_CAST ((o), CONTROL_TYPE_CIRCLE, ControlCircle))
 #define CONTROL_IS_CIRCLE(o)	(G_TYPE_CHECK_INSTANCE_TYPE ((o), CONTROL_TYPE_CIRCLE))
 
-GType control_circle_get_type (void);
+static GType control_circle_get_type (void);
 
 static gboolean
 control_point_button_pressed (GocItem *item, int button, double x, double y)
@@ -2821,16 +2821,16 @@ static void control_circle_class_init (GocItemClass *item_klass) {
 	item_klass->leave_notify = control_point_leave_notify;
 }
 
-GSF_CLASS (ControlCircle, control_circle,
-	   control_circle_class_init, NULL,
-	   GOC_TYPE_CIRCLE)
+static GSF_CLASS (ControlCircle, control_circle,
+		  control_circle_class_init, NULL,
+		  GOC_TYPE_CIRCLE)
 
 #define ITEM_ACETATE(obj)          (G_TYPE_CHECK_INSTANCE_CAST((obj), item_acetate_get_type (), ItemAcetate))
 #define IS_ITEM_ACETATE(o)         (G_TYPE_CHECK_INSTANCE_TYPE((o), item_acetate_get_type ()))
 
 #define MARGIN	10
 
-GType item_acetate_get_type (void);
+static GType item_acetate_get_type (void);
 
 typedef GocRectangle		ItemAcetate;
 typedef GocRectangleClass	ItemAcetateClass;
@@ -2860,9 +2860,9 @@ item_acetate_class_init (GocItemClass *item_class)
 	item_class->leave_notify = control_point_leave_notify;
 }
 
-GSF_CLASS (ItemAcetate, item_acetate,
-	   item_acetate_class_init, NULL,
-	   GOC_TYPE_RECTANGLE)
+static GSF_CLASS (ItemAcetate, item_acetate,
+		  item_acetate_class_init, NULL,
+		  GOC_TYPE_RECTANGLE)
 
 /**
  * new_control_point
diff --git a/src/sheet-style.c b/src/sheet-style.c
index 40e47e5..8f3d1dd 100644
--- a/src/sheet-style.c
+++ b/src/sheet-style.c
@@ -1158,26 +1158,6 @@ sheet_style_set_range (Sheet *sheet, GnmRange const *range,
 }
 
 /**
- * sheet_style_set_col
- * @sheet :
- * @col :
- * @style : #GnmStyle
- *
- * NOTE : This is a simple wrapper for now.  When we support col/row styles it
- *	will make life easier.
- *
- * Change the complete style for a full col.
- * This function absorbs a reference to the new @style.
- **/
-void
-sheet_style_set_col (Sheet *sheet, int col, GnmStyle *style)
-{
-	GnmRange r;
-	range_init_cols (&r, sheet, col, col);
-	sheet_style_set_range (sheet, &r, style);
-}
-
-/**
  * sheet_style_apply_col
  * @sheet :
  * @col :
@@ -1198,26 +1178,6 @@ sheet_style_apply_col (Sheet *sheet, int col, GnmStyle *pstyle)
 }
 
 /**
- * sheet_style_set_row
- * @sheet :
- * @row :
- * @style : #GnmStyle
- *
- * NOTE : This is a simple wrapper for now.  When we support col/row styles it
- *	will make life easier.
- *
- * Change the complete style for a full row.
- * This function absorbs a reference to the new @style.
- **/
-void
-sheet_style_set_row (Sheet  *sheet, int row, GnmStyle *style)
-{
-	GnmRange r;
-	range_init_rows (&r, sheet, row, row);
-	sheet_style_set_range (sheet, &r, style);
-}
-
-/**
  * sheet_style_apply_row
  * @sheet :
  * @row :
diff --git a/src/sheet-view.c b/src/sheet-view.c
index 5b3ffee..4ef7d91 100644
--- a/src/sheet-view.c
+++ b/src/sheet-view.c
@@ -667,15 +667,6 @@ sv_update (SheetView *sv)
 
 }
 
-static GnmValue *
-cb_fail_if_not_selected (GnmCellIter const *iter, gpointer sv)
-{
-	if (!sv_is_pos_selected (sv, iter->pp.eval.col, iter->pp.eval.row))
-		return VALUE_TERMINATE;
-	else
-		return NULL;
-}
-
 /**
  * sv_editpos_in_filter :
  * @sv : #SheetView
@@ -742,28 +733,6 @@ sv_editpos_in_slicer (SheetView const *sv)
 }
 
 /**
- * sheet_is_region_empty_or_selected:
- * @sheet: sheet to check
- * @r : the region
- *
- * Returns TRUE if the specified region of the @sheet does not
- * contain any cells that are not selected.
- *
- * FIXME: Perhaps this routine should be extended to allow testing for specific
- * features of a cell rather than just the existance of the cell.
- */
-gboolean
-sv_is_region_empty_or_selected (SheetView const *sv, GnmRange const *r)
-{
-	g_return_val_if_fail (IS_SHEET_VIEW (sv), TRUE);
-
-	return sheet_foreach_cell_in_range (
-		sv->sheet, CELL_ITER_IGNORE_NONEXISTENT,
-		r->start.col, r->start.row, r->end.col, r->end.row,
-		cb_fail_if_not_selected, (gpointer)sv) == NULL;
-}
-
-/**
  * sv_freeze_panes :
  * @sheet    : the sheet
  * @frozen   : top left corner of the frozen region
diff --git a/src/sheet.c b/src/sheet.c
index 7dce5b3..0c1ab57 100644
--- a/src/sheet.c
+++ b/src/sheet.c
@@ -1424,7 +1424,35 @@ sheet_redraw_partial_row (Sheet const *sheet, int const row,
 		sc_redraw_range (control, &r););
 }
 
-void
+static void
+sheet_redraw_cell (GnmCell const *cell)
+{
+	CellSpanInfo const * span;
+	int start_col, end_col;
+	GnmRange const *merged;
+
+	g_return_if_fail (cell != NULL);
+
+	merged = gnm_sheet_merge_is_corner (cell->base.sheet, &cell->pos);
+	if (merged != NULL) {
+		SHEET_FOREACH_CONTROL (cell->base.sheet, view, control,
+			sc_redraw_range (control, merged););
+		return;
+	}
+
+	start_col = end_col = cell->pos.col;
+	span = row_span_get (cell->row_info, start_col);
+
+	if (span) {
+		start_col = span->left;
+		end_col = span->right;
+	}
+
+	sheet_redraw_partial_row (cell->base.sheet, cell->pos.row,
+				  start_col, end_col);
+}
+
+static void
 sheet_cell_calc_span (GnmCell *cell, GnmSpanCalcFlags flags)
 {
 	CellSpanInfo const * span;
@@ -2931,34 +2959,6 @@ sheet_redraw_range (Sheet const *sheet, GnmRange const *range)
 			     range->end.col, range->end.row);
 }
 
-void
-sheet_redraw_cell (GnmCell const *cell)
-{
-	CellSpanInfo const * span;
-	int start_col, end_col;
-	GnmRange const *merged;
-
-	g_return_if_fail (cell != NULL);
-
-	merged = gnm_sheet_merge_is_corner (cell->base.sheet, &cell->pos);
-	if (merged != NULL) {
-		SHEET_FOREACH_CONTROL (cell->base.sheet, view, control,
-			sc_redraw_range (control, merged););
-		return;
-	}
-
-	start_col = end_col = cell->pos.col;
-	span = row_span_get (cell->row_info, start_col);
-
-	if (span) {
-		start_col = span->left;
-		end_col = span->right;
-	}
-
-	sheet_redraw_partial_row (cell->base.sheet, cell->pos.row,
-				  start_col, end_col);
-}
-
 /****************************************************************************/
 
 gboolean
diff --git a/src/sheet.h b/src/sheet.h
index 99e3b76..9aa5518 100644
--- a/src/sheet.h
+++ b/src/sheet.h
@@ -292,7 +292,6 @@ gconstpointer gnm_sheet_find_sort_setup (Sheet *sheet, char const *key);
 /* Redraw */
 #define sheet_is_visible(_sheet) ((_sheet)->visibility == GNM_SHEET_VISIBILITY_VISIBLE)
 void     sheet_redraw_all       (Sheet const *sheet, gboolean header);
-void     sheet_redraw_cell      (GnmCell const *cell);
 void     sheet_redraw_range     (Sheet const *sheet, GnmRange const *r);
 void     sheet_redraw_region    (Sheet const *sheet,
 				 int start_col, int start_row,
@@ -339,7 +338,6 @@ GOUndo *     sheet_apply_style_undo (GnmSheetRange *sr,
 void	     sheet_apply_border	    (Sheet  *sheet, GnmRange const *range, GnmBorder **borders);
 void	     sheet_queue_respan     (Sheet const *sheet, int start_row, int end_row);
 void	     sheet_range_calc_spans (Sheet *sheet, GnmRange const *r, GnmSpanCalcFlags flags);
-void	     sheet_cell_calc_span   (GnmCell *cell, GnmSpanCalcFlags flags);
 
 void	     sheet_set_outline_direction (Sheet *sheet, gboolean is_cols);
 gboolean     sheet_selection_is_allowed (Sheet const *sheet, GnmCellPos const *pos);
diff --git a/src/sort.c b/src/sort.c
index 0b093f8..32373ba 100644
--- a/src/sort.c
+++ b/src/sort.c
@@ -38,7 +38,7 @@ gnm_sort_data_destroy (GnmSortData *data)
 	g_free (data);
 }
 
-int
+static int
 gnm_sort_data_length (GnmSortData const *data)
 {
 	if (data->top)
diff --git a/src/sort.h b/src/sort.h
index 24054a4..4142bfd 100644
--- a/src/sort.h
+++ b/src/sort.h
@@ -27,7 +27,6 @@ void gnm_sort_data_destroy   (GnmSortData *data);
 GnmSortData *gnm_sort_data_copy   (GnmSortData *data);
 void gnm_sort_position	     (GnmSortData *data, int *perm, GOCmdContext *cc);
 int *gnm_sort_contents	     (GnmSortData *data, GOCmdContext *cc);
-int  gnm_sort_data_length    (GnmSortData const *data);
 int *gnm_sort_permute_invert (int const *perm, int length);
 
 G_END_DECLS
diff --git a/src/wbc-gtk.c b/src/wbc-gtk.c
index eccb118..5b9ff7b 100644
--- a/src/wbc-gtk.c
+++ b/src/wbc-gtk.c
@@ -104,6 +104,24 @@ static int extra_actions_nb;
 static guint wbc_gtk_signals[WBC_GTK_LAST_SIGNAL];
 static GObjectClass *parent_class = NULL;
 
+static gboolean
+wbcg_ui_update_begin (WBCGtk *wbcg)
+{
+	g_return_val_if_fail (IS_WBC_GTK (wbcg), FALSE);
+	g_return_val_if_fail (!wbcg->updating_ui, FALSE);
+
+	return (wbcg->updating_ui = TRUE);
+}
+
+static void
+wbcg_ui_update_end (WBCGtk *wbcg)
+{
+	g_return_if_fail (IS_WBC_GTK (wbcg));
+	g_return_if_fail (wbcg->updating_ui);
+
+	wbcg->updating_ui = FALSE;
+}
+
 /****************************************************************************/
 
 #ifndef HILDON
@@ -6014,24 +6032,6 @@ wbc_gtk_new (WorkbookView *optional_view,
 	return wbcg;
 }
 
-gboolean
-wbcg_ui_update_begin (WBCGtk *wbcg)
-{
-	g_return_val_if_fail (IS_WBC_GTK (wbcg), FALSE);
-	g_return_val_if_fail (!wbcg->updating_ui, FALSE);
-
-	return (wbcg->updating_ui = TRUE);
-}
-
-void
-wbcg_ui_update_end (WBCGtk *wbcg)
-{
-	g_return_if_fail (IS_WBC_GTK (wbcg));
-	g_return_if_fail (wbcg->updating_ui);
-
-	wbcg->updating_ui = FALSE;
-}
-
 GtkWindow *
 wbcg_toplevel (WBCGtk *wbcg)
 {
diff --git a/src/wbc-gtk.h b/src/wbc-gtk.h
index 646ada2..a6e8060 100644
--- a/src/wbc-gtk.h
+++ b/src/wbc-gtk.h
@@ -30,9 +30,6 @@ Sheet		*wbcg_cur_sheet	  (WBCGtk *wbcg);
 Sheet		*wbcg_focus_cur_scg (WBCGtk *wbcg);
 int              wbcg_get_n_scg   (WBCGtk const *wbcg);
 
-gboolean   wbcg_ui_update_begin	  (WBCGtk *wbcg);
-void	   wbcg_ui_update_end	  (WBCGtk *wbcg);
-
 gboolean   wbcg_rangesel_possible (WBCGtk const *wbcg);
 gboolean   wbcg_is_editing	  (WBCGtk const *wbcg);
 void	   wbcg_set_status_text	  (WBCGtk *wbcg,
diff --git a/src/widgets/ChangeLog b/src/widgets/ChangeLog
index 036596d..aa0348c 100644
--- a/src/widgets/ChangeLog
+++ b/src/widgets/ChangeLog
@@ -1,3 +1,8 @@
+2011-05-22  Morten Welinder  <terra gnome org>
+
+	* gnumeric-expr-entry.c (gnm_expr_entry_new_glade): Unused.
+	Remove.
+
 2011-05-21  Morten Welinder <terra gnome org>
 
 	* Release 1.10.15
diff --git a/src/widgets/gnumeric-expr-entry.c b/src/widgets/gnumeric-expr-entry.c
index 6864671..f948805 100644
--- a/src/widgets/gnumeric-expr-entry.c
+++ b/src/widgets/gnumeric-expr-entry.c
@@ -2121,24 +2121,6 @@ gnm_expr_entry_new (WBCGtk *wbcg, gboolean with_icon)
 			     NULL);
 }
 
-/**
- * gnm_expr_entry_new_glade:
- *
- * Creates a new #GnmExprEntry, which is an entry widget with support
- * for range selections.
- * The entry is created with default flag settings which are suitable for use
- * in many dialogs, but see #gnm_expr_entry_set_flags.
- *
- * Useful for use in .glade files.  The user must assign a scg before use.
- *
- * Return value: a new #GnmExprEntry.
- **/
-GtkWidget *
-gnm_expr_entry_new_glade (void)
-{
-	return g_object_new (GNM_EXPR_ENTRY_TYPE, NULL);
-}
-
 void
 gnm_expr_entry_freeze (GnmExprEntry *gee)
 {
diff --git a/src/widgets/gnumeric-expr-entry.h b/src/widgets/gnumeric-expr-entry.h
index 0539427..025e00b 100644
--- a/src/widgets/gnumeric-expr-entry.h
+++ b/src/widgets/gnumeric-expr-entry.h
@@ -27,7 +27,6 @@ typedef enum {
 GType gnm_expr_entry_get_type (void);
 GnmExprEntry *gnm_expr_entry_new       (WBCGtk *wbcg,
 					gboolean with_icon);
-GtkWidget    *gnm_expr_entry_new_glade (void);
 
 /* Widget specific methods */
 void	  gnm_expr_entry_freeze		(GnmExprEntry *gee);



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