From 9b2c1df8e62f88118ca236ed19fbed5552d1e48b Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 14 Mar 2015 16:24:24 -0700 Subject: [PATCH] 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 --- file.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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; }