Skip to content

Commit 5b9a140

Browse files
committed
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.
1 parent f64705e commit 5b9a140

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/formula.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ void FormulaManager::generateImages(const char *path,Format format,HighDPI hd) c
148148
// store the original directory
149149
if (!d.exists())
150150
{
151-
term("Output dir %s does not exist!\n",path);
151+
term("Output directory '%s' does not exist!\n",path);
152152
}
153153
QCString oldDir = QDir::currentDirPath().utf8();
154154
QCString macroFile = Config_getString(FORMULA_MACROFILE);
@@ -167,7 +167,6 @@ void FormulaManager::generateImages(const char *path,Format format,HighDPI hd) c
167167
QCString texName="_formulas.tex";
168168
IntVector formulasToGenerate;
169169
QFile f(texName);
170-
bool formulaError=FALSE;
171170
if (f.open(IO_WriteOnly))
172171
{
173172
FTextStream t(&f);
@@ -214,8 +213,9 @@ void FormulaManager::generateImages(const char *path,Format format,HighDPI hd) c
214213
{
215214
err("Problems running latex. Check your installation or look "
216215
"for typos in _formulas.tex and check _formulas.log!\n");
217-
formulaError=TRUE;
218-
//return;
216+
Portable::sysTimerStop();
217+
QDir::setCurrent(oldDir);
218+
return;
219219
}
220220
Portable::sysTimerStop();
221221
//printf("Running dvips...\n");
@@ -439,12 +439,12 @@ void FormulaManager::generateImages(const char *path,Format format,HighDPI hd) c
439439
if (RM_TMP_FILES)
440440
{
441441
thisDir.remove("_formulas.dvi");
442-
if (!formulaError) thisDir.remove("_formulas.log"); // keep file in case of errors
442+
thisDir.remove("_formulas.log"); // keep file in case of errors
443443
thisDir.remove("_formulas.aux");
444444
}
445445
}
446446
// remove the latex file itself
447-
if (RM_TMP_FILES && !formulaError) thisDir.remove("_formulas.tex");
447+
if (RM_TMP_FILES) thisDir.remove("_formulas.tex");
448448

449449
// write/update the formula repository so we know what text the
450450
// generated images represent (we use this next time to avoid regeneration

0 commit comments

Comments
 (0)