}
if (r == NULL)
- r = xzalloc (sizeof *r);
-
- r->xtr = xtr;
- r->spreadsheet.sheets = -1;
- r->state = STATE_PRE_INIT;
+ {
+ r = xzalloc (sizeof *r);
+ r->spreadsheet.sheets = -1;
+ r->spreadsheet.file_name = filename;
+ }
r->target_sheet = NULL;
r->target_sheet_index = -1;
+ r->row = r->col = -1;
+ r->state = STATE_PRE_INIT;
+ r->xtr = xtr;
/* Advance to the start of the workbook.
This gives us some confidence that we are actually dealing with a gnumeric
r->spreadsheet.type = SPREADSHEET_GNUMERIC;
- if (filename)
- r->spreadsheet.file_name = filename;
-
return r;
}
struct spreadsheet *
gnumeric_probe (const char *filename)
{
- struct gnumeric_reader *r = NULL;
-
- r = gnumeric_reopen (r, filename);
-
+ struct gnumeric_reader *r = gnumeric_reopen (NULL, filename);
+
return &r->spreadsheet;
}
r = (struct gnumeric_reader *) (spreadsheet);
+ if (r->row != -1)
+ r = gnumeric_reopen (r, NULL);
+
if ( opts->cell_range )
{
if ( ! convert_cell_ref (opts->cell_range,