gnumeric r17286 - in trunk: . plugins/applix plugins/excel plugins/html plugins/lotus-123 plugins/oleo plugins/openoffice plugins/paradox plugins/plan-perfect plugins/psiconv plugins/python-loader plugins/qpro plugins/sc plugins/sylk plugins/xbase src src/tools src/widgets



Author: mortenw
Date: Thu Apr  2 15:43:48 2009
New Revision: 17286
URL: http://svn.gnome.org/viewvc/gnumeric?rev=17286&view=rev

Log:
2009-04-02  Morten Welinder  <terra gnome org>

	* src/sheet.c (sheet_new): Require a size.  All callers changed.
	Note: some callers need to be fixed to provide the right size.
	(sheet_new_with_size): Remove.  All callers mapped to sheet_new.



Modified:
   trunk/ChangeLog
   trunk/plugins/applix/applix-read.c
   trunk/plugins/excel/excel-xml-read.c
   trunk/plugins/excel/ms-excel-read.c
   trunk/plugins/excel/xlsx-read.c
   trunk/plugins/html/html_read.c
   trunk/plugins/lotus-123/lotus.c
   trunk/plugins/oleo/oleo.c
   trunk/plugins/openoffice/openoffice-read.c
   trunk/plugins/paradox/paradox.c
   trunk/plugins/plan-perfect/pln.c
   trunk/plugins/psiconv/psiconv-read.c
   trunk/plugins/python-loader/python-loader.c
   trunk/plugins/qpro/qpro-read.c
   trunk/plugins/sc/sc.c
   trunk/plugins/sylk/sylk.c
   trunk/plugins/xbase/boot.c
   trunk/src/main-application.c
   trunk/src/sheet.c
   trunk/src/sheet.h
   trunk/src/stf.c
   trunk/src/tools/dao.c
   trunk/src/tools/tabulate.c
   trunk/src/widgets/gnm-filter-combo-foo-view.c
   trunk/src/workbook.c
   trunk/src/xml-io.c
   trunk/src/xml-sax-read.c

Modified: trunk/plugins/applix/applix-read.c
==============================================================================
--- trunk/plugins/applix/applix-read.c	(original)
+++ trunk/plugins/applix/applix-read.c	Thu Apr  2 15:43:48 2009
@@ -910,7 +910,7 @@
 	Sheet *sheet = workbook_sheet_by_name (state->wb, name);
 
 	if (sheet == NULL) {
-		sheet = sheet_new (state->wb, name);
+	  sheet = sheet_new (state->wb, name, 256, 65536);
 		workbook_sheet_attach (state->wb, sheet);
 		g_object_set (sheet, "zoom-factor", state->zoom / 100.0, NULL);
 		sheet_flag_recompute_spans (sheet);

Modified: trunk/plugins/excel/excel-xml-read.c
==============================================================================
--- trunk/plugins/excel/excel-xml-read.c	(original)
+++ trunk/plugins/excel/excel-xml-read.c	Thu Apr  2 15:43:48 2009
@@ -795,7 +795,8 @@
 		g_return_if_fail (state->sheet == NULL);
 		state->sheet =  workbook_sheet_by_name (state->wb, name);
 		if (state->sheet == NULL) {
-			state->sheet = sheet_new (state->wb, name);
+		  state->sheet = sheet_new (state->wb, name,
+					    256, 65536);  /* FIXME */
 			workbook_sheet_attach (state->wb, state->sheet);
 		}
 

Modified: trunk/plugins/excel/ms-excel-read.c
==============================================================================
--- trunk/plugins/excel/ms-excel-read.c	(original)
+++ trunk/plugins/excel/ms-excel-read.c	Thu Apr  2 15:43:48 2009
@@ -797,8 +797,10 @@
 	sheet = workbook_sheet_by_name (importer->wb, sheet_name);
 	if (sheet == NULL) {
 		sheet = sheet_new_with_type (importer->wb, sheet_name, type,
-					     gnm_sheet_get_max_cols (NULL),
-					     gnm_sheet_get_max_rows (NULL));
+					     XLS_MaxCol,
+					     (importer->ver >= MS_BIFF_V8
+					      ? XLS_MaxRow_V8
+					      : XLS_MaxRow_V7));
 		workbook_sheet_attach (importer->wb, sheet);
 		d (1, fprintf (stderr,"Adding sheet '%s'\n", sheet_name););
 	}
@@ -5751,7 +5753,10 @@
 				}
 
 				if (sheet == NULL) {
-					sheet = sheet_new (container->importer->wb, name);
+					sheet = sheet_new (container->importer->wb,
+							   name,
+							   XLS_MaxCol,
+							   XLS_MaxRow_V7);
 					workbook_sheet_attach (container->importer->wb, sheet);
 				}
 			}

Modified: trunk/plugins/excel/xlsx-read.c
==============================================================================
--- trunk/plugins/excel/xlsx-read.c	(original)
+++ trunk/plugins/excel/xlsx-read.c	Thu Apr  2 15:43:48 2009
@@ -3974,7 +3974,7 @@
 
 	sheet =  workbook_sheet_by_name (state->wb, name);
 	if (NULL == sheet) {
-		sheet = sheet_new (state->wb, name);
+		sheet = sheet_new (state->wb, name, 256, 65536);  /* FIXME! */
 		workbook_sheet_attach (state->wb, sheet);
 	}
 

Modified: trunk/plugins/html/html_read.c
==============================================================================
--- trunk/plugins/html/html_read.c	(original)
+++ trunk/plugins/html/html_read.c	Thu Apr  2 15:43:48 2009
@@ -70,7 +70,7 @@
 	if (name) {
 		sheet = workbook_sheet_by_name (wb, name);
 		if (sheet == NULL) {
-			sheet = sheet_new (wb, name);
+		  sheet = sheet_new (wb, name, 256, 65536);
 			workbook_sheet_attach (wb, sheet);
 		}
 	} else

Modified: trunk/plugins/lotus-123/lotus.c
==============================================================================
--- trunk/plugins/lotus-123/lotus.c	(original)
+++ trunk/plugins/lotus-123/lotus.c	Thu Apr  2 15:43:48 2009
@@ -1509,7 +1509,7 @@
 	 * Yes, I do mean col_name.  Use that as an easy proxy for
 	 * naming the sheets similarly to lotus.
 	 */
-	Sheet *sheet = sheet_new (wb, col_name (idx));
+	Sheet *sheet = sheet_new (wb, col_name (idx), 256, 65536);
 
 	/*
 	 * In case nothing forces a spanning, do it here so that any new

Modified: trunk/plugins/oleo/oleo.c
==============================================================================
--- trunk/plugins/oleo/oleo.c	(original)
+++ trunk/plugins/oleo/oleo.c	Thu Apr  2 15:43:48 2009
@@ -228,7 +228,7 @@
 oleo_new_sheet (Workbook *wb, int idx)
 {
 	char  *sheet_name = g_strdup_printf (_("Sheet%d"), idx);
-	Sheet *sheet = sheet_new (wb, sheet_name);
+	Sheet *sheet = sheet_new (wb, sheet_name, 256, 65536);
 	g_free (sheet_name);
 	workbook_sheet_attach (wb, sheet);
 

Modified: trunk/plugins/openoffice/openoffice-read.c
==============================================================================
--- trunk/plugins/openoffice/openoffice-read.c	(original)
+++ trunk/plugins/openoffice/openoffice-read.c	Thu Apr  2 15:43:48 2009
@@ -515,7 +515,7 @@
 			char const *name = CXML2C (attrs[1]);
 			state->pos.sheet = workbook_sheet_by_name (state->pos.wb, name);
 			if (NULL == state->pos.sheet) {
-				state->pos.sheet = sheet_new (state->pos.wb, name);
+				state->pos.sheet = sheet_new (state->pos.wb, name, 256, 65536);
 				workbook_sheet_attach (state->pos.wb, state->pos.sheet);
 			}
 
@@ -840,7 +840,10 @@
 				g_warning ("Ignoring reference to sheet %s", name);
 				ref->sheet = NULL;
 			} else {
-				ref->sheet = sheet_new (pp->wb, name);
+				Sheet *old_sheet = workbook_sheet_by_index (pp->wb, 0);
+				ref->sheet = sheet_new (pp->wb, name,
+							gnm_sheet_get_max_cols (old_sheet),
+							gnm_sheet_get_max_rows (old_sheet));
 				workbook_sheet_attach (pp->wb, ref->sheet);
 			}
 		}

Modified: trunk/plugins/paradox/paradox.c
==============================================================================
--- trunk/plugins/paradox/paradox.c	(original)
+++ trunk/plugins/paradox/paradox.c	Thu Apr  2 15:43:48 2009
@@ -78,7 +78,7 @@
 
 	wb = wb_view_get_workbook (wb_view);
 	name = workbook_sheet_get_free_name (wb, pxh->px_tablename, FALSE, TRUE);
-	sheet = sheet_new (wb, name);
+	sheet = sheet_new (wb, name, 256, 65536);
 	g_free (name);
 	workbook_sheet_attach (wb, sheet);
 

Modified: trunk/plugins/plan-perfect/pln.c
==============================================================================
--- trunk/plugins/plan-perfect/pln.c	(original)
+++ trunk/plugins/plan-perfect/pln.c	Thu Apr  2 15:43:48 2009
@@ -667,7 +667,7 @@
 
 	wb    = wb_view_get_workbook (wb_view);
 	name  = workbook_sheet_get_free_name (wb, "PlanPerfect", FALSE, TRUE);
-	sheet = sheet_new (wb, name);
+	sheet = sheet_new (wb, name, 256, 65536);
 	g_free (name);
 	workbook_sheet_attach (wb, sheet);
 	sheet_flag_recompute_spans (sheet);

Modified: trunk/plugins/psiconv/psiconv-read.c
==============================================================================
--- trunk/plugins/psiconv/psiconv-read.c	(original)
+++ trunk/plugins/psiconv/psiconv-read.c	Thu Apr  2 15:43:48 2009
@@ -543,7 +543,7 @@
 	psiconv_sheet_grid_section grid;
 
 	sheet_name = g_strdup_printf (_("Sheet%d"),nr);
-	sheet = sheet_new (wb, sheet_name);
+	sheet = sheet_new (wb, sheet_name, 256, 65536);
 	g_free (sheet_name);
 	if (!sheet)
 		return;

Modified: trunk/plugins/python-loader/python-loader.c
==============================================================================
--- trunk/plugins/python-loader/python-loader.c	(original)
+++ trunk/plugins/python-loader/python-loader.c	Thu Apr  2 15:43:48 2009
@@ -260,7 +260,7 @@
 		     GsfInput *input)
 {
 	ServiceLoaderDataFileOpener *loader_data;
-	Sheet *sheet;
+	Sheet *sheet, *old_sheet;
 	PyObject *open_result = NULL;
 	PyObject *input_wrapper;
 
@@ -268,9 +268,13 @@
 	g_return_if_fail (input != NULL);
 	g_return_if_fail (_PyGObject_API != NULL);
 
+	old_sheet = wb_view_cur_sheet (wb_view);
+
 	loader_data = g_object_get_data (G_OBJECT (service), "loader_data");
 	SWITCH_TO_PLUGIN (plugin_service_get_plugin (service));
-	sheet = sheet_new (wb_view_get_workbook (wb_view), _("Some name"));
+	sheet = sheet_new (wb_view_get_workbook (wb_view), _("Some name"),
+			   gnm_sheet_get_max_cols (old_sheet),
+			   gnm_sheet_get_max_rows (old_sheet));
 	input_wrapper = pygobject_new (G_OBJECT (input));
 	if (input_wrapper != NULL) {
 		 /* wrapping adds a reference */

Modified: trunk/plugins/qpro/qpro-read.c
==============================================================================
--- trunk/plugins/qpro/qpro-read.c	(original)
+++ trunk/plugins/qpro/qpro-read.c	Thu Apr  2 15:43:48 2009
@@ -711,7 +711,7 @@
 
 	/* We can use col_name as a quick proxy for the defaul q-pro sheet names */
 	char const *def_name = col_name (workbook_sheet_count (state->wb));
-	Sheet *sheet = sheet_new (state->wb, def_name);
+	Sheet *sheet = sheet_new (state->wb, def_name, 256, 65536);
 
 	state->cur_sheet = sheet;
 	workbook_sheet_attach (state->wb, sheet);

Modified: trunk/plugins/sc/sc.c
==============================================================================
--- trunk/plugins/sc/sc.c	(original)
+++ trunk/plugins/sc/sc.c	Thu Apr  2 15:43:48 2009
@@ -604,9 +604,9 @@
 	ErrorInfo *error;
 	ScParseState state;
 
-	wb    = wb_view_get_workbook (wb_view);
-	name  = workbook_sheet_get_free_name (wb, "SC", FALSE, TRUE);
-	state.sheet = sheet_new (wb, name);
+	wb = wb_view_get_workbook (wb_view);
+	name = workbook_sheet_get_free_name (wb, "SC", FALSE, TRUE);
+	state.sheet = sheet_new (wb, name, 256, 65536);
 	g_free (name);
 	workbook_sheet_attach (wb, state.sheet);
 

Modified: trunk/plugins/sylk/sylk.c
==============================================================================
--- trunk/plugins/sylk/sylk.c	(original)
+++ trunk/plugins/sylk/sylk.c	Thu Apr  2 15:43:48 2009
@@ -820,7 +820,7 @@
 		name = g_strdup ("Sheet");
 	}
 
-	state.pp.sheet = sheet_new (state.pp.wb, name);
+	state.pp.sheet = sheet_new (state.pp.wb, name, 256, 65536);
 	workbook_sheet_attach (state.pp.wb, state.pp.sheet);
 	g_free (name);
 

Modified: trunk/plugins/xbase/boot.c
==============================================================================
--- trunk/plugins/xbase/boot.c	(original)
+++ trunk/plugins/xbase/boot.c	Thu Apr  2 15:43:48 2009
@@ -153,7 +153,7 @@
 
 	wb = wb_view_get_workbook (wb_view);
 	name = workbook_sheet_get_free_name (wb, _("Sheet"), FALSE, TRUE);
-	sheet = sheet_new (wb, name);
+	sheet = sheet_new (wb, name, 256, 65536);
 	g_free (name);
 	workbook_sheet_attach (wb, sheet);
 

Modified: trunk/src/main-application.c
==============================================================================
--- trunk/src/main-application.c	(original)
+++ trunk/src/main-application.c	Thu Apr  2 15:43:48 2009
@@ -84,7 +84,6 @@
 		N_("Don't display warning dialogs when importing"),
 		NULL
 	},
-#ifdef GNUMERIC_VARIABLE_SHEET_SIZE
 	{ "rows", 'r', 0, G_OPTION_ARG_INT, &rows,
 		N_("Minimum number of rows"),
 		NULL
@@ -93,7 +92,6 @@
 		N_("Minimum number of columns"),
 		NULL
 	},
-#endif
 
 	/*********************************
 	 * Hidden Actions */

Modified: trunk/src/sheet.c
==============================================================================
--- trunk/src/sheet.c	(original)
+++ trunk/src/sheet.c	Thu Apr  2 15:43:48 2009
@@ -1075,23 +1075,7 @@
 /**
  * sheet_new :
  * @wb    : #Workbook
- * @name  : An unquoted name in utf8
- *
- * Create a new Sheet of type SHEET_DATA, and associate it with @wb.
- * The type can not be changed later
- **/
-Sheet *
-sheet_new (Workbook *wb, char const *name)
-{
-	return sheet_new_with_type (wb, name, GNM_SHEET_DATA,
-				    gnm_sheet_get_max_cols (NULL),
-				    gnm_sheet_get_max_rows (NULL));
-}
-
-/**
- * sheet_new_with_size :
- * @wb      : #Workbook
- * @name    : An unquoted name in utf8
+ * @name  : The name for the sheet (unquoted).
  * @columns : The requested columns number.
  * @rows    : The requested rows number.
  *
@@ -1099,7 +1083,7 @@
  * The type can not be changed later
  **/
 Sheet *
-sheet_new_with_size (Workbook *wb, char const *name, int columns, int rows)
+sheet_new (Workbook *wb, char const *name, int columns, int rows)
 {
 	return sheet_new_with_type (wb, name, GNM_SHEET_DATA, columns, rows);
 }

Modified: trunk/src/sheet.h
==============================================================================
--- trunk/src/sheet.h	(original)
+++ trunk/src/sheet.h	Thu Apr  2 15:43:48 2009
@@ -119,8 +119,7 @@
 #define GNM_SHEET_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GNM_SHEET_TYPE, GnmSheetClass))
 GType     gnm_sheet_get_type	 (void);
 
-Sheet    *sheet_new		 (Workbook *wb, char const *name);
-Sheet    *sheet_new_with_size	 (Workbook *wb, char const *name, int columns, int rows);
+Sheet    *sheet_new		 (Workbook *wb, char const *name, int columns, int rows);
 Sheet    *sheet_new_with_type	 (Workbook *wb, char const *name,
 				  GnmSheetType type, int columns, int rows);
 Sheet    *sheet_dup		 (Sheet const *source_sheet);

Modified: trunk/src/stf.c
==============================================================================
--- trunk/src/stf.c	(original)
+++ trunk/src/stf.c	Thu Apr  2 15:43:48 2009
@@ -181,7 +181,7 @@
 	char *name, *nameutf8;
 	char *data;
 	size_t data_len;
-	Sheet *sheet;
+	Sheet *sheet, *old_sheet;
 	Workbook *book;
 
 	/* FIXME : how to do this cleanly ? */
@@ -204,7 +204,10 @@
 
 	/* Add Sheet */
 	book = wb_view_get_workbook (wbv);
-	sheet = sheet_new (book, nameutf8);
+	old_sheet = wb_view_cur_sheet (wbv);
+	sheet = sheet_new (book, nameutf8,
+			   gnm_sheet_get_max_cols (old_sheet),
+			   gnm_sheet_get_max_rows (old_sheet));
 	workbook_sheet_attach (book, sheet);
 
 	dialogresult = stf_dialog (WBC_GTK (context->impl),
@@ -342,7 +345,7 @@
 			       IOContext *context,
 			       gpointer wbv, GsfInput *input)
 {
-	Sheet *sheet;
+	Sheet *sheet, *old_sheet;
 	Workbook *book;
 	char *name;
 	char *data, *utf8data;
@@ -354,6 +357,8 @@
 	g_return_if_fail (wbv != NULL);
 
 	book = wb_view_get_workbook (wbv);
+	old_sheet = wb_view_cur_sheet (wbv);
+
 	data = stf_preparse (GO_CMD_CONTEXT (context), input, &data_len);
 	if (!data)
 		return;
@@ -383,7 +388,9 @@
 	}
 
 	name = g_path_get_basename (gsfname);
-	sheet = sheet_new (book, name);
+	sheet = sheet_new (book, name,
+			   gnm_sheet_get_max_cols (old_sheet),
+			   gnm_sheet_get_max_rows (old_sheet));
 	g_free (name);
 	workbook_sheet_attach (book, sheet);
 

Modified: trunk/src/tools/dao.c
==============================================================================
--- trunk/src/tools/dao.c	(original)
+++ trunk/src/tools/dao.c	Thu Apr  2 15:43:48 2009
@@ -225,6 +225,7 @@
 		    const char *name)
 {
 	char *unique_name;
+	Sheet *old_sheet = wb_control_cur_sheet (wbc);
 
 	if (wbc)
 		dao->wbc = wbc;
@@ -235,18 +236,18 @@
 		unique_name = workbook_sheet_get_free_name
 			(wb, name_with_counter, FALSE, TRUE);
 		g_free (name_with_counter);
-	        dao->sheet = sheet_new (wb, unique_name);
+		dao->rows = gnm_sheet_get_max_rows (old_sheet);
+		dao->cols = gnm_sheet_get_max_cols (old_sheet);
+	        dao->sheet = sheet_new (wb, unique_name, dao->cols, dao->rows);
 		g_free (unique_name);
 		dao->start_col = dao->start_row = 0;
-		dao->rows = gnm_sheet_get_max_rows (dao->sheet);
-		dao->cols = gnm_sheet_get_max_cols (dao->sheet);
 		workbook_sheet_attach (wb, dao->sheet);
 	} else if (dao->type == NewWorkbookOutput) {
 		Workbook *wb = workbook_new ();
-		dao->sheet = sheet_new (wb, name);
+		dao->rows = gnm_sheet_get_max_rows (old_sheet);
+		dao->cols = gnm_sheet_get_max_cols (old_sheet);
+		dao->sheet = sheet_new (wb, name, dao->cols, dao->rows);
 		dao->start_col = dao->start_row = 0;
-		dao->rows = gnm_sheet_get_max_rows (dao->sheet);
-		dao->cols = gnm_sheet_get_max_cols (dao->sheet);
 		workbook_sheet_attach (wb, dao->sheet);
 		dao->wbc = wb_control_wrapper_new (dao->wbc, NULL, wb, NULL);
 	}

Modified: trunk/src/tools/tabulate.c
==============================================================================
--- trunk/src/tools/tabulate.c	(original)
+++ trunk/src/tools/tabulate.c	Thu Apr  2 15:43:48 2009
@@ -79,6 +79,7 @@
 	       GnmTabulateInfo *data)
 {
 	Workbook *wb = wb_control_get_workbook (wbc);
+	Sheet *old_sheet = wb_control_cur_sheet (wbc);
 	GSList *sheet_idx = NULL;
 	Sheet *sheet = NULL;
 	gboolean sheetdim = (!data->with_coordinates && data->dims >= 3);
@@ -100,10 +101,10 @@
 
 			counts[i] = 1 + gnm_fake_floor ((data->maxima[i] - data->minima[i]) / data->steps[i]);
 			/* Silently truncate at the edges.  */
-			if (!data->with_coordinates && i == 0 && counts[i] > gnm_sheet_get_max_cols (sheet) - 1) {
-				counts[i] = gnm_sheet_get_max_cols (sheet) - 1;
-			} else if (!data->with_coordinates && i == 1 && counts[i] > gnm_sheet_get_max_rows (sheet) - 1) {
-				counts[i] = gnm_sheet_get_max_rows (sheet) - 1;
+			if (!data->with_coordinates && i == 0 && counts[i] > gnm_sheet_get_max_cols (old_sheet) - 1) {
+				counts[i] = gnm_sheet_get_max_cols (old_sheet) - 1;
+			} else if (!data->with_coordinates && i == 1 && counts[i] > gnm_sheet_get_max_rows (old_sheet) - 1) {
+				counts[i] = gnm_sheet_get_max_rows (old_sheet) - 1;
 			}
 		}
 	}
@@ -126,7 +127,10 @@
 
 			g_free (base_name);
 			value_release (v);
-			sheet = sheets[i] = sheet_new (wb, unique_name);
+			sheet = sheets[i] =
+			  sheet_new (wb, unique_name,
+				     gnm_sheet_get_max_cols (old_sheet),
+				     gnm_sheet_get_max_rows (old_sheet));
 			g_free (unique_name);
 			workbook_sheet_attach (wb, sheet);
 			sheet_idx = g_slist_prepend (sheet_idx, 
@@ -139,7 +143,9 @@
 			workbook_sheet_get_free_name (wb,
 						      _("Tabulation"),
 						      FALSE, FALSE);
-	        sheet = sheet_new (wb, unique_name);
+	        sheet = sheet_new (wb, unique_name,
+				   gnm_sheet_get_max_cols (old_sheet),
+				   gnm_sheet_get_max_rows (old_sheet));
 		g_free (unique_name);
 		workbook_sheet_attach (wb, sheet);
 		sheet_idx = g_slist_prepend (sheet_idx, 

Modified: trunk/src/widgets/gnm-filter-combo-foo-view.c
==============================================================================
--- trunk/src/widgets/gnm-filter-combo-foo-view.c	(original)
+++ trunk/src/widgets/gnm-filter-combo-foo-view.c	Thu Apr  2 15:43:48 2009
@@ -193,7 +193,9 @@
 	if (filter->fields->len > 1) {
 		Workbook *wb = uc.src_sheet->workbook;
 		char *name = workbook_sheet_get_free_name (wb, "DummyFilterPopulate", FALSE, FALSE);
-		filtered_sheet = sheet_new (wb, name);
+		filtered_sheet = sheet_new (wb, name,
+					    gnm_sheet_get_max_cols (uc.src_sheet),
+					    gnm_sheet_get_max_rows (uc.src_sheet));
 		g_free (name);
 		for (i = 0 ; i < filter->fields->len ; i++)
 			if (i != field_num)

Modified: trunk/src/workbook.c
==============================================================================
--- trunk/src/workbook.c	(original)
+++ trunk/src/workbook.c	Thu Apr  2 15:43:48 2009
@@ -876,7 +876,7 @@
 workbook_sheet_add_sized (Workbook *wb, int pos, int columns, int rows)
 {
 	char *name = workbook_sheet_get_free_name (wb, _("Sheet"), TRUE, FALSE);
-	Sheet *new_sheet = sheet_new_with_size (wb, name, columns, rows);
+	Sheet *new_sheet = sheet_new (wb, name, columns, rows);
 	g_free (name);
 
 	if (pos == -1)

Modified: trunk/src/xml-io.c
==============================================================================
--- trunk/src/xml-io.c	(original)
+++ trunk/src/xml-io.c	Thu Apr  2 15:43:48 2009
@@ -1930,7 +1930,7 @@
 
 	sheet = workbook_sheet_by_name (ctxt->wb, CXML2C (val));
 	if (sheet == NULL)
-		sheet = sheet_new (ctxt->wb, CXML2C (val));
+		sheet = sheet_new (ctxt->wb, CXML2C (val), 256, 65536);
 	xmlFree (val);
 	if (sheet == NULL)
 		return NULL;
@@ -2292,7 +2292,7 @@
 		g_return_if_fail (name != NULL);
 
 		workbook_sheet_attach (ctxt->wb,
-				       sheet_new (ctxt->wb, CXML2C (name)));
+				       sheet_new (ctxt->wb, CXML2C (name), 256, 65536));
 		xmlFree (name);
 	}
 }

Modified: trunk/src/xml-sax-read.c
==============================================================================
--- trunk/src/xml-sax-read.c	(original)
+++ trunk/src/xml-sax-read.c	Thu Apr  2 15:43:48 2009
@@ -496,9 +496,9 @@
 	g_return_if_fail (name != NULL);
 
 	if (NULL == workbook_sheet_by_name (wb, name)) {
-		Sheet *sheet = sheet_new_with_size (wb, name,
-						    state->sheet_cols,
-						    state->sheet_rows);
+		Sheet *sheet = sheet_new (wb, name,
+					  state->sheet_cols,
+					  state->sheet_rows);
 		workbook_sheet_attach (wb, sheet);
 	}
 }
@@ -674,6 +674,8 @@
 {
 	XMLSaxParseState *state = (XMLSaxParseState *)xin->user_state;
 	Sheet *sheet;
+	int columns = 256;
+	int rows = 65536;
 
 	char const * content = xin->content->str;
 	g_return_if_fail (state->sheet == NULL);
@@ -686,11 +688,12 @@
 		if (!sheet) {
 			gnumeric_io_error_string (state->context,
 				_("File has inconsistent SheetNameIndex element."));
-			sheet = sheet_new (state->wb, content);
+			sheet = sheet_new (state->wb, content,
+					   columns, rows);
 			workbook_sheet_attach (state->wb, sheet);
 		}
 	} else {
-		sheet = sheet_new (state->wb, content);
+		sheet = sheet_new (state->wb, content, columns, rows);
 		workbook_sheet_attach (state->wb, sheet);
 	}
 	state->sheet = sheet;



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