From bea0925f8ccd617293d9171eef8453d938e3a44f Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Fri, 18 Dec 2009 22:59:59 +0000 Subject: [PATCH] Converter: add a safe guard to Alerts because those cannot be called from another thread. The whole Alert system must be rethought I am afraid. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32585 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/Buffer.cpp | 6 ++++++ src/Buffer.h | 2 ++ src/Converter.cpp | 4 ++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Buffer.cpp b/src/Buffer.cpp index b4671076ad..e3319af92c 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -375,6 +375,12 @@ Buffer * Buffer::clone() const } +bool Buffer::isClone() const +{ + return d->cloned_buffer_; +} + + void Buffer::changed() const { if (d->wa_) diff --git a/src/Buffer.h b/src/Buffer.h index 50bdf77bc9..926a20de6c 100644 --- a/src/Buffer.h +++ b/src/Buffer.h @@ -133,6 +133,8 @@ public: /// Buffer * clone() const; + /// + bool isClone() const; /** High-level interface to buffer functionality. This function parses a command string and executes it. diff --git a/src/Converter.cpp b/src/Converter.cpp index c8d0b11915..d8d1dd1ca8 100644 --- a/src/Converter.cpp +++ b/src/Converter.cpp @@ -608,13 +608,13 @@ bool Converters::runLaTeX(Buffer const & buffer, string const & command, buffer.bufferErrors(terr, errorList); // check return value from latex.run(). - if ((result & LaTeX::NO_LOGFILE)) { + if ((result & LaTeX::NO_LOGFILE) && !buffer.isClone()) { docstring const str = bformat(_("LaTeX did not run successfully. " "Additionally, LyX could not locate " "the LaTeX log %1$s."), from_utf8(name)); Alert::error(_("LaTeX failed"), str); - } else if (result & LaTeX::NO_OUTPUT) { + } else if ((result & LaTeX::NO_OUTPUT) && !buffer.isClone()) { Alert::warning(_("Output is empty"), _("An empty output file was generated.")); } -- 2.39.2