summaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-03-14 16:24:24 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-03-14 16:24:24 -0700
commit9b2c1df8e62f88118ca236ed19fbed5552d1e48b (patch)
treec9bf929fbde22ade6fa2cf5c2bef346333a30a28 /file.c
parente9e9996766a47044249cbcb7ff7185fb04ac9882 (diff)
downloadsubsurface-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.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/file.c b/file.c
index e738e61be..0a5fd7bf8 100644
--- a/file.c
+++ b/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;
}