if (name == NULL)
name = xmlStrdup (_xml ("--"));
-
r->node_type = xmlTextReaderNodeType (r->xtr);
- switch ( r->state)
+ switch (r->state)
{
case STATE_PRE_INIT:
r->current_sheet = -1;
struct casereader *
gnumeric_make_reader (struct spreadsheet *spreadsheet,
const struct spreadsheet_read_info *gri,
- struct spreadsheet_read_options *opts)
+ const struct spreadsheet_read_options *opts)
{
struct gnumeric_reader *r = NULL;
unsigned long int vstart = 0;
free (var_spec);
-
+
+#if 0
if (opts->cell_range == NULL)
{
opts->cell_range = c_xasprintf ("%c%d:%c%ld",
r->stop_col + 'A' + caseproto_get_n_widths (r->proto),
r->start_row + n_cases);
}
+#endif
return casereader_create_sequential
(NULL,
struct casereader * gnumeric_make_reader (struct spreadsheet *spreadsheet,
const struct spreadsheet_read_info *gri,
- struct spreadsheet_read_options *opts);
+ const struct spreadsheet_read_options *opts);
#endif
struct casereader *
ods_make_reader (struct spreadsheet *spreadsheet,
- const struct spreadsheet_read_info *gri, struct spreadsheet_read_options *opts)
+ const struct spreadsheet_read_info *gri,
+ const struct spreadsheet_read_options *opts)
{
intf ret = 0;
xmlChar *type = NULL;
struct casereader * ods_make_reader (struct spreadsheet *spreadsheet,
const struct spreadsheet_read_info *gri,
- struct spreadsheet_read_options *opts);
+ const struct spreadsheet_read_options *opts);
#endif
*/
struct spreadsheet_read_options
{
- char *sheet_name ; /* The name of the sheet to open (in UTF-8) */
+ const char *sheet_name ; /* The name of the sheet to open (in UTF-8) */
int sheet_index ; /* The index of the sheet to open (only used if sheet_name is NULL) */
- char *cell_range ; /* The cell range (in UTF-8) */
+ const char *cell_range ; /* The cell range (in UTF-8) */
};
-
struct spreadsheet_read_info
{
bool read_names ; /* True if the first row is to be used as the names of the variables */
static void
destroy_spreadsheet_read_info (UNUSED struct spreadsheet_read_info *sri,
- struct spreadsheet_read_options *opts)
+ UNUSED struct spreadsheet_read_options *opts)
{
- free (opts->sheet_name);
- free (opts->cell_range);
}
sheet_spec_gen_syntax (const struct import_assistant *ia)
{
const struct sheet_spec_page *ssp = ia->sheet_spec;
+ GtkBuilder *builder = ia->asst.builder;
+ GtkWidget *range_entry = get_widget_assert (builder, "cell-range-entry");
+ const gchar *range = gtk_entry_get_text (GTK_ENTRY (range_entry));
struct string s = DS_EMPTY_INITIALIZER;
ssp->sri.read_names ? "ON" : "OFF");
- if ( ssp->opts.cell_range)
+ if (range && 0 != strcmp ("", range))
{
syntax_gen_pspp (&s,
- "\n /CELLRANGE=RANGE %sq",
- ssp->opts.cell_range);
+ "\n /CELLRANGE=RANGE %sq", range);
}
else
{
struct casereader *creader = NULL;
struct dictionary *dict = NULL;
- GtkWidget *range_entry = get_widget_assert (builder, "cell-range-entry");
GtkWidget *readnames_checkbox = get_widget_assert (builder, "readnames-checkbox");
-
+ GtkWidget *range_entry = get_widget_assert (builder, "cell-range-entry");
const gchar *range = gtk_entry_get_text (GTK_ENTRY (range_entry));
GtkWidget *combo_box = get_widget_assert (builder, "sheet-entry");