int min_col;
};
+
+static void
+state_data_destroy (struct state_data *sd)
+{
+ xmlFreeTextReader (sd->xtr);
+}
+
+
struct gnumeric_reader
{
struct spreadsheet spreadsheet;
{
struct gnumeric_reader *r = (struct gnumeric_reader *) s;
-#if 0
if (0 == --r->ref_cnt)
{
int i;
}
free (r->sheets);
+ state_data_destroy (&r->msd);
free (r);
}
-#endif
}
if ( r == NULL)
return ;
+ state_data_destroy (&r->rsd);
+
#if 0
if ( r->rsd.xtr)
xmlFreeTextReader (r->rsd.xtr);
caseproto_unref (r->proto);
- gnumeric_destroy (&r->spreadsheet);
#endif
+ gnumeric_destroy (&r->spreadsheet);
}
r->sheets = xrealloc (r->sheets, (sd->current_sheet + 1) * sizeof *r->sheets);
detail = &r->sheets[sd->current_sheet];
detail->start_col = detail->stop_col = detail->start_row = detail->stop_row = -1;
+ detail->name = NULL;
r->spreadsheet.n_sheets = sd->current_sheet + 1;
}
}
}
else if (XML_READER_TYPE_TEXT == sd->node_type)
{
- r->sheets [r->spreadsheet.n_sheets - 1].name = CHAR_CAST (char *, xmlTextReaderValue (sd->xtr));
+ if ( r->sheets [r->spreadsheet.n_sheets - 1].name == NULL)
+ r->sheets [r->spreadsheet.n_sheets - 1].name = CHAR_CAST (char *, xmlTextReaderValue (sd->xtr));
}
break;
gnumeric_reopen (struct gnumeric_reader *r, const char *filename, bool show_errors)
{
int ret;
- struct state_data *sd;// = filename ? &r->msd : &r->rsd;
+ struct state_data *sd;
xmlTextReaderPtr xtr;
gzFile gz;
if (r->rsd.row != -1)
r = gnumeric_reopen (r, NULL, true);
-
-
if ( opts->cell_range )
{
if ( ! convert_cell_ref (opts->cell_range,
free (value);
}
-
}
if (ret == 1)