mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Temporary fix to allow importing of CSV files
In commit 0ed4356fc2
("Display slowness warning before opening a V2
file") I changed the xml parser to abort if it detects an V2 XML file so
that the main application can show a warning message (and eventually, a
few choices for the user) before parsing and processing older XML files.
The input that gets pre-processed by XSLT files claims to be V2 XML and so
the parser aborts - yet the code to show a warning and restarting the
parse isn't present in this code path, so XSLT based imports always fail.
This hack works around this by temprarily setting the variable that claims
that the warning has been shown to the user.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
e9e9996766
commit
9b2c1df8e6
1 changed files with 10 additions and 0 deletions
10
file.c
10
file.c
|
@ -1133,7 +1133,17 @@ int parse_manual_file(const char *filename, int sepidx, int units, int dateforma
|
|||
if (try_to_xslt_open_csv(filename, &mem, "manualCSV"))
|
||||
return -1;
|
||||
|
||||
// right now input files created by XSLT processing report being v2 XML which makes
|
||||
// the parse function abort until the dialog about importing v2 files has been shown.
|
||||
// Until the XSLT has been updated we just override this check
|
||||
//
|
||||
// FIXME
|
||||
//
|
||||
bool remember = v2_question_shown;
|
||||
v2_question_shown = true;
|
||||
ret = parse_xml_buffer(filename, mem.buffer, mem.size, &dive_table, (const char **)params);
|
||||
v2_question_shown = remember;
|
||||
|
||||
free(mem.buffer);
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue