const xmlChar *target_sheet;
int target_sheet_index;
-#if 1
+
+ int wanted_row_start;
+ int wanted_col_start;
+
+#if 0
int start_row;
int start_col;
int stop_row;
if ( !init_reader (r, true))
goto error;
-#if 1
+#if 0
if ( opts->cell_range )
{
if ( ! convert_cell_ref (opts->cell_range,
r->target_sheet_index = opts->sheet_index;
r->row = r->col = 0;
+#if 0
/* If CELLRANGE was given, then we know how many variables should be read */
if ( r->stop_col != -1 )
{
var_spec = xrealloc (var_spec, sizeof (*var_spec) * n_var_specs);
memset (var_spec, '\0', sizeof (*var_spec) * n_var_specs);
}
+#endif
/* Advance to the start of the cells for the target sheet */
while ( r->current_sheet < r->target_sheet_index - 1 ||
process_node (r);
/* If the row is finished then stop for now */
- if (r->state == STATE_TABLE && r->row > r->start_row)
+ if (r->state == STATE_TABLE && r->row > r->wanted_row_start)
break;
- idx = r->col - r->start_col - 1;
+ idx = r->col - r->wanted_col_start - 1;
if (r->state == STATE_CELL_CONTENT
&&
process_node (r);
/* If the row is finished then stop for now */
- if (r->state == STATE_TABLE && r->row > r->start_row + (opts->read_names ? 1 : 0))
+ if (r->state == STATE_TABLE && r->row > r->wanted_row_start + (opts->read_names ? 1 : 0))
break;
- idx = r->col - r->start_col - 1;
+ idx = r->col - r->wanted_col_start - 1;
if ( r->state == STATE_CELL &&
XML_READER_TYPE_ELEMENT == r->node_type)
for (col = 0; col < r->col_span; ++col)
{
- const int idx = r->col + col - r->start_col - 1;
+ const int idx = r->col + col - r->wanted_col_start - 1;
const struct variable *var = dict_get_var (r->dict, idx);
convert_xml_to_value (c, var, xmv);
}