}
break;
case STATE_ROW:
- // printf ("%s:%d Name is %s\n", __FILE__, __LINE__, name);
if ( (0 == xmlStrcasecmp (name, _xml ("table:table-cell")))
&&
(XML_READER_TYPE_ELEMENT == r->node_type))
if (r->stop_col != -1 && idx > r->stop_col - r->start_col)
continue;
- // printf ("%s:%d IDX %d COL %d\n", __FILE__, __LINE__, idx, r->col);
-
if (r->state == STATE_CELL_CONTENT
&&
XML_READER_TYPE_TEXT == r->node_type)
var_spec [idx].name = strdup (CHAR_CAST (const char *, value));
- // printf ("%s:%d Name %s\n", __FILE__, __LINE__, var_spec [idx].name);
-
xmlFree (value);
}
}
var_spec [idx].name = NULL;
n_var_specs = idx + 1;
}
-#if 0
- printf ("%s:%d Idx %d n_var_specs %d\n", __FILE__, __LINE__,
- idx, n_var_specs);
-#endif
-
+
var_spec [idx].firstval.type = type;
var_spec [idx].firstval.text = xmlTextReaderValue (r->xtr);
var_spec [idx].firstval.value = val_string;
- // printf ("%s:%d Text %s\n", __FILE__, __LINE__, var_spec [idx].firstval.text);
-
val_string = NULL;
type = NULL;
}
break;
}
- // zip_reader_destroy (zreader);
+ // zip_reader_destroy (zreader);
-#if 0
for ( i = 0 ; i < n_var_specs ; ++i )
{
free (var_spec[i].firstval.type);
}
free (var_spec);
-#endif
+
return casereader_create_sequential
(NULL,
error:
- // zip_reader_destroy (zreader);
+ //zip_reader_destroy (zreader);
for ( i = 0 ; i < n_var_specs ; ++i )
{
convert_xml_to_value (c, var, xmv);
}
- free (xmv->text);
- free (xmv->value);
+ xmlFree (xmv->text);
+ xmlFree (xmv->value);
+ xmlFree (xmv->type);
free (xmv);
}
if ( r->state <= STATE_TABLE)
static bool parse_spreadsheet (struct lexer *lexer, char **filename,
struct spreadsheet_read_options *opts);
-static void destroy_spreadsheet_read_info (struct spreadsheet_read_info *, struct spreadsheet_read_options *);
+static void destroy_spreadsheet_read_info (struct spreadsheet_read_options *);
static int parse_get_txt (struct lexer *lexer, struct dataset *);
static int parse_get_psql (struct lexer *lexer, struct dataset *);
dataset_set_dict (ds, dict);
dataset_set_source (ds, reader);
free (tok);
+ destroy_spreadsheet_read_info (&opts);
return CMD_SUCCESS;
}
+ destroy_spreadsheet_read_info (&opts);
}
else
msg (SE, _("Unsupported TYPE %s."), tok);
+
+
+
error:
free (tok);
return CMD_FAILURE;
static void
-destroy_spreadsheet_read_info (UNUSED struct spreadsheet_read_info *sri,
- UNUSED struct spreadsheet_read_options *opts)
+destroy_spreadsheet_read_info (struct spreadsheet_read_options *opts)
{
+ free (opts->cell_range);
}