From d9ced2a578649f0adb569cf113885852c2e463a2 Mon Sep 17 00:00:00 2001 From: albert-github Date: Sat, 9 May 2020 09:18:51 +0200 Subject: [PATCH] Running Inkscape 1.0 On subsequent calls we should know which inkscape version we have when this is not the case we already tried to determine it, but it failed so we should bail out here without error as an error has already been given. --- src/formula.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/formula.cpp b/src/formula.cpp index 5a638d629a6..204304fb12e 100644 --- a/src/formula.cpp +++ b/src/formula.cpp @@ -383,10 +383,18 @@ void FormulaManager::generateImages(const char *path,Format format,HighDPI hd) c { sprintf(args,"-l form_%d.svg -z %s_tmp.pdf 2>%s",pageNum,formBase.data(),Portable::devNull()); } - else + else if (inkscapeVersion == 1) { sprintf(args,"--export-type=svg --export-filename=form_%d.svg %s_tmp.pdf 2>%s",pageNum,formBase.data(),Portable::devNull()); } + else + { + // on subsequent calls we should know which inkscape version we have + // when this is not the case we already tried to determine it, but it failed + // so we should bail out here without error as an error has already been given. + QDir::setCurrent(oldDir); + return; + } Portable::sysTimerStart(); if (Portable::system("inkscape",args)!=0) {