From 5b9a140ded861438b6b630b08f846dd73a60c585 Mon Sep 17 00:00:00 2001 From: albert-github Date: Tue, 13 Oct 2020 14:15:24 +0200 Subject: Don't start dvips when latex fails for formulas In case the latex process fails for formulas there is no reason to try to start a dvips process. --- src/formula.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/formula.cpp b/src/formula.cpp index ca50c9c..8ba9729 100644 --- a/src/formula.cpp +++ b/src/formula.cpp @@ -148,7 +148,7 @@ void FormulaManager::generateImages(const char *path,Format format,HighDPI hd) c // store the original directory if (!d.exists()) { - term("Output dir %s does not exist!\n",path); + term("Output directory '%s' does not exist!\n",path); } QCString oldDir = QDir::currentDirPath().utf8(); QCString macroFile = Config_getString(FORMULA_MACROFILE); @@ -167,7 +167,6 @@ void FormulaManager::generateImages(const char *path,Format format,HighDPI hd) c QCString texName="_formulas.tex"; IntVector formulasToGenerate; QFile f(texName); - bool formulaError=FALSE; if (f.open(IO_WriteOnly)) { FTextStream t(&f); @@ -214,8 +213,9 @@ void FormulaManager::generateImages(const char *path,Format format,HighDPI hd) c { err("Problems running latex. Check your installation or look " "for typos in _formulas.tex and check _formulas.log!\n"); - formulaError=TRUE; - //return; + Portable::sysTimerStop(); + QDir::setCurrent(oldDir); + return; } Portable::sysTimerStop(); //printf("Running dvips...\n"); @@ -439,12 +439,12 @@ void FormulaManager::generateImages(const char *path,Format format,HighDPI hd) c if (RM_TMP_FILES) { thisDir.remove("_formulas.dvi"); - if (!formulaError) thisDir.remove("_formulas.log"); // keep file in case of errors + thisDir.remove("_formulas.log"); // keep file in case of errors thisDir.remove("_formulas.aux"); } } // remove the latex file itself - if (RM_TMP_FILES && !formulaError) thisDir.remove("_formulas.tex"); + if (RM_TMP_FILES) thisDir.remove("_formulas.tex"); // write/update the formula repository so we know what text the // generated images represent (we use this next time to avoid regeneration -- cgit v0.12