STATE_CELL /* Found a cell */
};
+struct sheet_detail
+{
+ xmlChar *name;
+ char *range;
+};
+
struct gnumeric_reader
{
int node_type;
int sheet_index;
- xmlChar **sheet_names;
+ struct sheet_detail *sheets;
const xmlChar *target_sheet;
int target_sheet_index;
struct gnumeric_reader *gr = (struct gnumeric_reader *) s;
assert (n < s->sheets);
- return gr->sheet_names[n];
+ return gr->sheets[n].name;
}
const char *
for (i = 0; i < r->spreadsheet.sheets; ++i)
{
- xmlFree (r->sheet_names[i]);
+ xmlFree (r->sheets[i].name);
}
- free (r->sheet_names);
+ free (r->sheets);
free (r);
}
XML_READER_TYPE_ELEMENT == r->node_type)
{
r->spreadsheet.sheets++;
- r->sheet_names = xrealloc (r->sheet_names, r->spreadsheet.sheets * sizeof *r->sheet_names);
+ r->sheets = xrealloc (r->sheets, r->spreadsheet.sheets * sizeof *r->sheets);
}
else if (0 == xmlStrcasecmp (name, _xml("gnm:SheetNameIndex")) &&
XML_READER_TYPE_END_ELEMENT == r->node_type)
}
else if (XML_READER_TYPE_TEXT == r->node_type)
{
- r->sheet_names [r->spreadsheet.sheets - 1] = xmlTextReaderValue (r->xtr);
+ r->sheets [r->spreadsheet.sheets - 1].name = xmlTextReaderValue (r->xtr);
}
break;
void
gnumeric_destroy (struct spreadsheet *s)
{
- struct gnumeric_reader *r = s;
- gnm_file_casereader_destroy (NULL, s);
+ struct gnumeric_reader *r = (struct gnumeric *) s;
+ gnm_file_casereader_destroy (NULL, s);
}
struct spreadsheet *
const GValue * value,
GParamSpec * pspec)
{
- PsppireSpreadsheetModel *spreadsheetModel =
+ PsppireSpreadsheetModel *spreadsheetModel =
PSPPIRE_SPREADSHEET_MODEL (object);
switch (prop_id)
}
static gboolean
-tree_model_iter_next (GtkTreeModel * model, GtkTreeIter * iter)
+tree_model_iter_next (GtkTreeModel *model, GtkTreeIter *iter)
{
PsppireSpreadsheetModel *spreadsheetModel =
PSPPIRE_SPREADSHEET_MODEL (model);
}
static gboolean
-tree_model_iter_has_child (GtkTreeModel * tree_model, GtkTreeIter * iter)
+tree_model_iter_has_child (GtkTreeModel *tree_model, GtkTreeIter *iter)
{
return FALSE;
}
}
+static gboolean
+tree_model_children (GtkTreeModel *model, GtkTreeIter *iter, GtkTreeIter *parent)
+{
+ PsppireSpreadsheetModel *spreadsheetModel = PSPPIRE_SPREADSHEET_MODEL (model);
+
+ if (parent != NULL)
+ return FALSE;
+
+ iter->stamp = spreadsheetModel->stamp;
+ iter->user_data = 0;
+
+ return TRUE;
+}
+
+
static void
spreadsheet_tree_model_init (GtkTreeModelIface * iface)
iface->iter_next = tree_model_iter_next;
iface->get_value = tree_model_get_value;
- iface->iter_children = NULL;
+ iface->iter_children = tree_model_children;
iface->iter_parent = NULL;
iface->get_path = tree_model_get_path;