r->row = r->col = 0;
-#if 0
- printf ("%s:%d %d,%d %d,%d\n", __FILE__, __LINE__,
- r->start_col,
- r->start_row,
- r->stop_col,
- r->stop_row);
-#endif
-
-
/* Advance to the start of the cells for the target sheet */
while ( ! reading_target_sheet (r)
|| r->state != STATE_ROW || r->row <= r->start_row )
if ( r->state == STATE_CELL_CONTENT &&
XML_READER_TYPE_TEXT == r->node_type)
{
-#if 0
- printf ("%s:%d Idx %d n_var_specs %d\n", __FILE__, __LINE__,
- idx, n_var_specs);
-
- printf ("%s:%d Idx %d r_col %d\n", __FILE__, __LINE__,
- idx, r->col);
-#endif
-
if (idx >= n_var_specs)
{
var_spec = xrealloc (var_spec, sizeof (*var_spec) * (idx + 1));
continue;
if (r->stop_col != -1 && idx > r->stop_col - r->start_col )
break;
+ if (idx >= dict_get_var_cnt (r->dict))
+ break;
var = dict_get_var (r->dict, idx);
convert_xml_to_value (c, var, xmv);
])
AT_CLEANUP
+dnl This syntax doesn't do anything particularly useful.
+dnl It has been seen to cause a few crashes, so we check here that it
+dnl doesn't do anthing bad.
+AT_SETUP([GET DATA /TYPE=$1 with no options])
+SPREADSHEET_TEST_PREP($1)
+AT_DATA([get-data.sps], [dnl
+* This sheet is empty
+GET DATA /TYPE=$1 /FILE='testsheet'.
+DISPLAY DICTIONARY.
+LIST.
+])
+AT_CHECK([pspp -o pspp.csv get-data.sps], [0], [ignore])
+AT_CLEANUP
+
+
+
AT_SETUP([GET DATA /TYPE=$1 with empty sheet])
SPREADSHEET_TEST_PREP($1)
AT_DATA([get-data.sps], [dnl