diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-03-14 16:24:24 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-03-14 16:24:24 -0700 |
commit | 9b2c1df8e62f88118ca236ed19fbed5552d1e48b (patch) | |
tree | c9bf929fbde22ade6fa2cf5c2bef346333a30a28 /file.c | |
parent | e9e9996766a47044249cbcb7ff7185fb04ac9882 (diff) | |
download | subsurface-9b2c1df8e62f88118ca236ed19fbed5552d1e48b.tar.gz |
Temporary fix to allow importing of CSV files
In commit 0ed4356fc28b ("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>
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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; } |