]> git.lyx.org Git - features.git/commitdiff
Clear the error list from previous errors
authorVincent van Ravesteijn <vfr@lyx.org>
Sat, 17 Mar 2012 18:00:25 +0000 (19:00 +0100)
committerVincent van Ravesteijn <vfr@lyx.org>
Sat, 17 Mar 2012 18:00:25 +0000 (19:00 +0100)
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

index 3fdd32b813b71b1a5e9e0a7353e3617146c353c7..010843e9ec1ae55112c95a30d907f6a6f7450d61 100644 (file)
@@ -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")