From 1d5204315e8c4cfed564854c1ff4de1d46ec4917 Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Sat, 17 Mar 2012 19:00:25 +0100 Subject: [PATCH] Clear the error list from previous errors We only copied the error list to the cloned buffer when makeLatexfile failed. This means that a second try will never clear the error list and the user will be presented the same list again. Therefore, we unconditionally copy the error list such that we also clear the list on success. --- src/Buffer.cpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 3fdd32b813..010843e9ec 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -3737,13 +3737,11 @@ Buffer::ExportStatus Buffer::doExport(string const & target, bool put_in_tempdir // LaTeX backend else if (backend_format == format) { runparams.nice = true; - if (!makeLaTeXFile(FileName(filename), string(), runparams)) { - if (d->cloned_buffer_) { - d->cloned_buffer_->d->errorLists["Export"] = - d->errorLists["Export"]; - } + bool const success = makeLaTeXFile(FileName(filename), string(), runparams); + if (d->cloned_buffer_) + d->cloned_buffer_->d->errorLists["Export"] = d->errorLists["Export"]; + if (!success) return ExportError; - } } else if (!lyxrc.tex_allows_spaces && contains(filePath(), ' ')) { Alert::error(_("File name error"), @@ -3751,13 +3749,11 @@ Buffer::ExportStatus Buffer::doExport(string const & target, bool put_in_tempdir return ExportTexPathHasSpaces; } else { runparams.nice = false; - if (!makeLaTeXFile(FileName(filename), filePath(), runparams)) { - if (d->cloned_buffer_) { - d->cloned_buffer_->d->errorLists["Export"] = - d->errorLists["Export"]; - } + bool const success = makeLaTeXFile(FileName(filename), string(), runparams); + if (d->cloned_buffer_) + d->cloned_buffer_->d->errorLists["Export"] = d->errorLists["Export"]; + if (!success) return ExportError; - } } string const error_type = (format == "program")