[gnumeric] Change result type of workbook_sheets to GSList*



commit 13a74ad9fb0c6efb39e837b347d38d0ce3e5b020
Author: Morten Welinder <terra gnome org>
Date:   Wed Apr 22 10:31:33 2009 -0400

    Change result type of workbook_sheets to GSList*
---
 ChangeLog                            |    3 +++
 plugins/corba/corba-workbook.c       |    4 ++--
 plugins/html/html.c                  |    4 ++--
 plugins/html/roff.c                  |    4 ++--
 plugins/openoffice/openoffice-read.c |    2 +-
 plugins/python-loader/py-gnumeric.c  |    6 +++---
 src/dialogs/dialog-sheet-resize.c    |    4 ++--
 src/dialogs/dialog-zoom.c            |    4 ++--
 src/gui-clipboard.c                  |    4 ++--
 src/gui-file.c                       |    7 ++-----
 src/test.c                           |    4 ++--
 src/workbook-control.c               |    4 ++--
 src/workbook.c                       |   10 +++++-----
 src/workbook.h                       |    2 +-
 14 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 144b343..bd14c3c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2009-04-22  Morten Welinder  <terra gnome org>
 
+	* src/workbook.c (workbook_sheets): Change result type to GSList*.
+	All callers changed.
+
 	* src/sheet.c (gnm_sheet_resize_main): Change container size too.
 	Unlink, re-link, and recalculate all dependencies.
 	(gnm_sheet_resize_main): Handle errors from attempted splitting of
diff --git a/plugins/corba/corba-workbook.c b/plugins/corba/corba-workbook.c
index fa3ead8..2cc33c4 100644
--- a/plugins/corba/corba-workbook.c
+++ b/plugins/corba/corba-workbook.c
@@ -133,7 +133,7 @@ cworkbook_sheets (PortableServer_Servant servant,
 		  CORBA_Environment *ev)
 {
         WorkbookControlCORBA *wbcc = wbcc_from_servant (servant);
-	GList *sheets =
+	GSList *sheets =
 		workbook_sheets (wb_control_get_workbook (WORKBOOK_CONTROL (wbcc)));
 	int i, len = g_list_length (sheets);
 	GNOME_Gnumeric_Workbooks *res = GNOME_Gnumeric_Sheets__alloc ();
@@ -146,7 +146,7 @@ cworkbook_sheets (PortableServer_Servant servant,
 		res->_buffer [i] = CORBA_OBJECT_NIL;
 	}
 
-	g_list_free (sheets);
+	g_slist_free (sheets);
 
 	return res;
 }
diff --git a/plugins/html/html.c b/plugins/html/html.c
index d5874ec..f08f3ed 100644
--- a/plugins/html/html.c
+++ b/plugins/html/html.c
@@ -476,7 +476,7 @@ static void
 html_file_save (GOFileSaver const *fs, IOContext *io_context,
 		WorkbookView const *wb_view, GsfOutput *output, html_version_t version)
 {
-	GList *sheets, *ptr;
+	GSList *sheets, *ptr;
 	Workbook *wb = wb_view_get_workbook (wb_view);
 	FileSaveScope save_scope;
 
@@ -562,7 +562,7 @@ html_file_save (GOFileSaver const *fs, IOContext *io_context,
 	for (ptr = sheets ; ptr != NULL ; ptr = ptr->next) {
 		write_sheet (output, (Sheet *) ptr->data, version, save_scope);
 	}
-	g_list_free (sheets);
+	g_slist_free (sheets);
 	if (version == HTML32 || version == HTML40 || version == XHTML)
 		gsf_output_puts (output, "</body>\n</html>\n");
 }
diff --git a/plugins/html/roff.c b/plugins/html/roff.c
index 5b64aae..3580972 100644
--- a/plugins/html/roff.c
+++ b/plugins/html/roff.c
@@ -87,7 +87,7 @@ void
 roff_file_save (GOFileSaver const *fs, IOContext *io_context,
                 WorkbookView const *wb_view, GsfOutput *output)
 {
-	GList *sheets, *ptr;
+	GSList *sheets, *ptr;
 	GnmCell *cell;
 	int row, col, fontsize, v_size;
 	Workbook *wb = wb_view_get_workbook (wb_view);
@@ -190,5 +190,5 @@ roff_file_save (GOFileSaver const *fs, IOContext *io_context,
 		}
 		gsf_output_printf (output, ".TE\n\n");
 	}
-	g_list_free (sheets);
+	g_slist_free (sheets);
 }
diff --git a/plugins/openoffice/openoffice-read.c b/plugins/openoffice/openoffice-read.c
index d05f255..e6fd077 100644
--- a/plugins/openoffice/openoffice-read.c
+++ b/plugins/openoffice/openoffice-read.c
@@ -3057,7 +3057,7 @@ openoffice_file_open (GOFileOpener const *fo, IOContext *io_context,
 			}
 		}
 		{
-			GList *l;
+			GSList *l;
 			g_printerr ("Order we have:\n");
 			for (l = workbook_sheets (state.pos.wb); l; l = l->next) {
 				Sheet *sheet = l->data;
diff --git a/plugins/python-loader/py-gnumeric.c b/plugins/python-loader/py-gnumeric.c
index 2ee8c4e..5b13e0e 100644
--- a/plugins/python-loader/py-gnumeric.c
+++ b/plugins/python-loader/py-gnumeric.c
@@ -1681,7 +1681,7 @@ py_Workbook_as_Workbook (py_Workbook_object *self)
 static PyObject *
 py_Workbook_sheets (py_Workbook_object *self, PyObject *args)
 {
-	GList *sheets, *l;
+	GSList *sheets, *l;
 	gint i;
 	PyObject *py_sheets;
 
@@ -1690,7 +1690,7 @@ py_Workbook_sheets (py_Workbook_object *self, PyObject *args)
 	}
 
 	sheets = workbook_sheets (self->wb);
-	py_sheets = PyTuple_New (g_list_length (sheets));
+	py_sheets = PyTuple_New (g_slist_length (sheets));
 	if (py_sheets == NULL) {
 		return NULL;
 	}
@@ -1701,7 +1701,7 @@ py_Workbook_sheets (py_Workbook_object *self, PyObject *args)
 		g_assert (py_sheet);
 		(void) PyTuple_SetItem (py_sheets, i, py_sheet);
 	}
-	g_list_free (sheets);
+	g_slist_free (sheets);
 
 	return py_sheets;
 }
diff --git a/src/dialogs/dialog-sheet-resize.c b/src/dialogs/dialog-sheet-resize.c
index 1cc6bbb..e8d5c49 100644
--- a/src/dialogs/dialog-sheet-resize.c
+++ b/src/dialogs/dialog-sheet-resize.c
@@ -107,7 +107,7 @@ cb_destroy (ResizeState *state)
 static void
 cb_ok_clicked (ResizeState *state)
 {
-	GList *sheets, *l;
+	GSList *sheets, *l;
 	GSList *changed_sheets = NULL;
 	WorkbookControl *wbc;
 	Workbook *wb;
@@ -133,7 +133,7 @@ cb_ok_clicked (ResizeState *state)
 
 		changed_sheets = g_slist_prepend (changed_sheets, this_sheet);
 	}
-	g_list_free (sheets);
+	g_slist_free (sheets);
 
 	if (changed_sheets)
 		cmd_resize_sheets (wbc, g_slist_reverse (changed_sheets),
diff --git a/src/dialogs/dialog-zoom.c b/src/dialogs/dialog-zoom.c
index 78fcfe1..3795019 100644
--- a/src/dialogs/dialog-zoom.c
+++ b/src/dialogs/dialog-zoom.c
@@ -156,7 +156,7 @@ void
 dialog_zoom (WBCGtk *wbcg, Sheet *sheet)
 {
 	ZoomState *state;
-	GList *l, *sheets;
+	GSList *l, *sheets;
 	int i, row, cur_row;
 	gboolean is_custom = TRUE;
 	GtkRadioButton *radio;
@@ -212,7 +212,7 @@ dialog_zoom (WBCGtk *wbcg, Sheet *sheet)
 			cur_row = row;
 		row++;
 	}
-	g_list_free (sheets);
+	g_slist_free (sheets);
 
 	{
 		GtkTreePath *path = gtk_tree_path_new_from_indices (cur_row, -1);
diff --git a/src/gui-clipboard.c b/src/gui-clipboard.c
index 4d641d6..de14faa 100644
--- a/src/gui-clipboard.c
+++ b/src/gui-clipboard.c
@@ -268,7 +268,7 @@ table_cellregion_read (WorkbookControl *wbc, char const *reader_id,
 {
 	WorkbookView *wb_view = NULL;
 	Workbook *wb = NULL;
-	GList *l = NULL;
+	GSList *l = NULL;
 	GnmCellRegion *ret = NULL;
 	const GOFileOpener *reader = go_file_opener_for_id (reader_id);
 	IOContext *ioc;
@@ -300,7 +300,7 @@ table_cellregion_read (WorkbookControl *wbc, char const *reader_id,
 		ret = clipboard_copy_range (tmpsheet, &r);
 	}
 out:
-	g_list_free (l);
+	g_slist_free (l);
 	if (wb_view)
 		g_object_unref (wb_view);
 	if (wb)
diff --git a/src/gui-file.c b/src/gui-file.c
index 82e8971..fb954b5 100644
--- a/src/gui-file.c
+++ b/src/gui-file.c
@@ -357,18 +357,15 @@ check_multiple_sheet_support_if_needed (GOFileSaver *fs,
 
 	if (go_file_saver_get_save_scope (fs) != FILE_SAVE_WORKBOOK &&
 	    gnm_app_prefs->file_ask_single_sheet_save) {
-		GList *sheets;
+		Workbook *wb = wb_view_get_workbook (wb_view);
 		gchar *msg = _("Selected file format doesn't support "
 			       "saving multiple sheets in one file.\n"
 			       "If you want to save all sheets, save them "
 			       "in separate files or select different file format.\n"
 			       "Do you want to save only current sheet?");
-
-		sheets = workbook_sheets (wb_view_get_workbook (wb_view));
-		if (g_list_length (sheets) > 1) {
+		if (workbook_sheet_count (wb) > 1) {
 			ret_val = go_gtk_query_yes_no (parent, TRUE, msg);
 		}
-		g_list_free (sheets);
 	}
 	return (ret_val);
 }
diff --git a/src/test.c b/src/test.c
index 4ad2d19..3f549d6 100644
--- a/src/test.c
+++ b/src/test.c
@@ -112,7 +112,7 @@ thrash_insert (Sheet *sheet)
 void
 workbook_style_test (Workbook *wb)
 {
-	GList *sheets;
+	GSList *sheets;
 
 	g_return_if_fail (wb != NULL);
 
@@ -134,7 +134,7 @@ workbook_style_test (Workbook *wb)
 		thrash_insert (sheet);
 		dump_stats ("Insert");
 
-		sheets = g_list_remove (sheets, sheet);
+		sheets = g_slist_remove (sheets, sheet);
 		sheet_flag_recompute_spans (sheet);
 	}
 	workbook_recalc (wb);
diff --git a/src/workbook-control.c b/src/workbook-control.c
index 4c70b84..55b9ea9 100644
--- a/src/workbook-control.c
+++ b/src/workbook-control.c
@@ -418,7 +418,7 @@ wb_control_set_view (WorkbookControl *wbc,
 void
 wb_control_init_state (WorkbookControl *wbc)
 {
-	GList *sheets, *ptr;
+	GSList *sheets, *ptr;
 	Sheet *sheet;
 	WorkbookView *wbv;
 	WorkbookControlClass *wbc_class;
@@ -438,7 +438,7 @@ wb_control_init_state (WorkbookControl *wbc)
 				wb_control_sheet_add (wbc, view);
 		});
 	}
-	g_list_free (sheets);
+	g_slist_free (sheets);
 
 	wbc_class = WBC_CLASS (wbc);
 	if (wbc_class != NULL && wbc_class->init_state != NULL)
diff --git a/src/workbook.c b/src/workbook.c
index d33e5fb..dc1fc31 100644
--- a/src/workbook.c
+++ b/src/workbook.c
@@ -85,7 +85,7 @@ static void
 workbook_dispose (GObject *wb_object)
 {
 	Workbook *wb = WORKBOOK (wb_object);
-	GList *sheets, *ptr;
+	GSList *sheets, *ptr;
 
 	wb->during_destruction = TRUE;
 
@@ -118,7 +118,7 @@ workbook_dispose (GObject *wb_object)
 		Sheet *sheet = ptr->data;
 		workbook_sheet_delete (sheet);
 	}
-	g_list_free (sheets);
+	g_slist_free (sheets);
 
 	/* TODO : This should be earlier when we figure out how to deal with
 	 * the issue raised by 'pristine'.
@@ -637,17 +637,17 @@ workbook_detach_view (WorkbookView *wbv)
  * workbook_sheets : Get an ordered list of the sheets in the workbook
  *                   The caller is required to free the list.
  */
-GList *
+GSList *
 workbook_sheets (Workbook const *wb)
 {
-	GList *list = NULL;
+	GSList *list = NULL;
 
 	g_return_val_if_fail (IS_WORKBOOK (wb), NULL);
 
 	if (wb->sheets) {
 		int i = wb->sheets->len;
 		while (i-- > 0)
-			list = g_list_prepend (list,
+			list = g_slist_prepend (list,
 				g_ptr_array_index (wb->sheets, i));
 	}
 
diff --git a/src/workbook.h b/src/workbook.h
index 3e3840c..ae30cd0 100644
--- a/src/workbook.h
+++ b/src/workbook.h
@@ -17,7 +17,7 @@ Workbook   *workbook_new                 (void);
 Workbook   *workbook_new_with_sheets     (int sheet_count);
 
 /* Sheet support routines */
-GList      *workbook_sheets              (Workbook const *wb);
+GSList     *workbook_sheets              (Workbook const *wb);
 int         workbook_sheet_count         (Workbook const *wb);
 Sheet      *workbook_sheet_by_index	 (Workbook const *wb, int i);
 Sheet      *workbook_sheet_by_name       (Workbook const *wb, char const *sheet_name);



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