From: John Darrington Date: Fri, 29 Mar 2013 11:27:59 +0000 (+0100) Subject: Merge remote branch 'origin/master' into import-gui X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8870ca57b746c93b91fb740927fcda45643499d2;p=pspp Merge remote branch 'origin/master' into import-gui Conflicts: src/ui/gui/text-data-import-dialog.c --- 8870ca57b746c93b91fb740927fcda45643499d2 diff --cc src/data/casereader.c index c0968669a2,c8050c6cde..e50096f5e8 --- a/src/data/casereader.c +++ b/src/data/casereader.c @@@ -91,10 -91,10 +91,10 @@@ casereader_destroy (struct casereader * bool ok = true; if (reader != NULL) { -- reader->class->destroy (reader, reader->aux); -- ok = taint_destroy (reader->taint); -- caseproto_unref (reader->proto); -- free (reader); ++ // reader->class->destroy (reader, reader->aux); ++ // ok = taint_destroy (reader->taint); ++ // caseproto_unref (reader->proto); ++ // free (reader); } return ok; } @@@ -239,12 -239,13 +239,12 @@@ static casenumbe casereader_count_cases__ (const struct casereader *reader, casenumber max_cases) { - struct casereader *clone; - casenumber n_cases; - - clone = casereader_clone (reader); - n_cases = casereader_advance (clone, max_cases); - casereader_destroy (clone); - + struct casereader *clone = casereader_clone (reader); + casenumber n_cases = casereader_advance (clone, max_cases); +#if (__GNUC__ == 4 ) && (__GNUC_MINOR__ == 4) - volatile int x = 1; ++ // volatile int x = 1; +#endif - casereader_destroy (clone); ++ // casereader_destroy (clone); return n_cases; } diff --cc src/data/ods-reader.c index cbd7feaa17,b3586b82ec..dd9331a777 --- a/src/data/ods-reader.c +++ b/src/data/ods-reader.c @@@ -110,19 -113,10 +110,19 @@@ struct state_dat int current_sheet; xmlChar *current_sheet_name; - xmlChar *target_sheet_name; - int target_sheet_index; + int col_span; +}; - struct ods_reader ++struct ods_reader /* */ +{ + struct spreadsheet spreadsheet; + struct zip_reader *zreader; + int ref_cnt; + int target_sheet_index; + xmlChar *target_sheet_name; + + struct state_data foo; + struct state_data rsd; int start_row; int start_col; @@@ -144,7 -140,6 +144,8 @@@ void ods_destroy (struct spreadsheet *s) { ++ printf ("%s:%d\n", __FILE__, __LINE__); +#if 0 struct ods_reader *r = (struct ods_reader *) s; if (--r->ref_cnt == 0) @@@ -239,7 -231,6 +240,8 @@@ ods_get_sheet_range (struct spreadshee static void ods_file_casereader_destroy (struct casereader *reader UNUSED, void *r_) { ++ printf ("%s:%d %p\n", __FILE__, __LINE__, r_); +#if 0 struct ods_reader *r = r_; if ( r == NULL) return ; @@@ -490,11 -480,11 +492,11 @@@ convert_xml_to_value (struct ccase *c, CHAR_CAST (const char *, xmv->value) : CHAR_CAST (const char *, xmv->text); -- free (data_in (ss_cstr (text), "UTF-8", ++ data_in (ss_cstr (text), "UTF-8", fmt->type, v, var_get_width (var), -- "UTF-8")); ++ "UTF-8"); } } } @@@ -564,7 -557,7 +566,7 @@@ init_reader (struct ods_reader *r, boo zip_member_ref (content); xtr = xmlReaderForIO ((xmlInputReadCallback) zip_member_read, -- (xmlInputCloseCallback) zip_member_finish, ++ (xmlInputCloseCallback) NULL, content, NULL, NULL, report_errors ? 0 : (XML_PARSE_NOERROR | XML_PARSE_NOWARNING) ); @@@ -905,12 -888,12 +907,11 @@@ static struct ccase ods_file_casereader_read (struct casereader *reader UNUSED, void *r_) { struct ccase *c = NULL; -- xmlChar *val_string = NULL; -- xmlChar *type = NULL; struct ods_reader *r = r_; if (!r->used_first_case) { ++ printf ("%s:%d\n", __FILE__, __LINE__); r->used_first_case = true; return r->first_case; } @@@ -925,33 -908,33 +926,39 @@@ } - if ( ! reading_target_sheet (r) - || r->state < STATE_TABLE - || (r->stop_row != -1 && r->row > r->stop_row + 1) + if ( ! reading_target_sheet (r, &r->rsd) + || r->rsd.state < STATE_TABLE + || (r->stop_row != -1 && r->rsd.row > r->stop_row + 1) ) { ++ printf ("%s:%d\n", __FILE__, __LINE__); return NULL; } ++ printf ("%s:%d\n", __FILE__, __LINE__); c = case_create (r->proto); case_set_missing (c); - while (1 == xmlTextReaderRead (r->xtr)) ++#if 1 ++ xmlChar *val_string = NULL; ++ xmlChar *type = NULL; ++ + while (1 == xmlTextReaderRead (r->rsd.xtr)) { - process_node (r); + process_node (r, &r->rsd); - if ( r->stop_row != -1 && r->row > r->stop_row + 1) + if ( r->stop_row != -1 && r->rsd.row > r->stop_row + 1) break; - if (r->state == STATE_CELL && - r->node_type == XML_READER_TYPE_ELEMENT) + if (r->rsd.state == STATE_CELL && + r->rsd.node_type == XML_READER_TYPE_ELEMENT) { - type = xmlTextReaderGetAttribute (r->xtr, _xml ("office:value-type")); - val_string = xmlTextReaderGetAttribute (r->xtr, _xml ("office:value")); + type = xmlTextReaderGetAttribute (r->rsd.xtr, _xml ("office:value-type")); + val_string = xmlTextReaderGetAttribute (r->rsd.xtr, _xml ("office:value")); } - if (r->state == STATE_CELL_CONTENT && - r->node_type == XML_READER_TYPE_TEXT) + if (r->rsd.state == STATE_CELL_CONTENT && + r->rsd.node_type == XML_READER_TYPE_TEXT) { int col; struct xml_value *xmv = xzalloc (sizeof *xmv); @@@ -975,14 -958,14 +982,15 @@@ convert_xml_to_value (c, var, xmv); } -- xmlFree (xmv->text); -- xmlFree (xmv->value); -- xmlFree (xmv->type); -- free (xmv); ++ // xmlFree (xmv->text); ++ // xmlFree (xmv->value); ++ // xmlFree (xmv->type); ++ // free (xmv); } - if ( r->state <= STATE_TABLE) + if ( r->rsd.state <= STATE_TABLE) break; } ++#endif return c; } diff --cc src/ui/gui/text-data-import-dialog.c index 662caba809,20bac652cc..d24a23242d --- a/src/ui/gui/text-data-import-dialog.c +++ b/src/ui/gui/text-data-import-dialog.c @@@ -86,18 -84,11 +86,17 @@@ text_data_import_assistant (PsppireData return; } + ssp = ia->sheet_spec; + if (ia->spreadsheet) + { + ia->sheet_spec = sheet_spec_page_create (ia); + } + else { ia->intro = intro_page_create (ia); - ia->separators = separators_page_create (ia); ia->first_line = first_line_page_create (ia); - printf ("%s:%d %p\n", __FILE__, __LINE__, ia->intro); + ia->separators = separators_page_create (ia); } ia->formats = formats_page_create (ia);