]> git.lyx.org Git - features.git/commitdiff
Converter: add a safe guard to Alerts because those cannot be called from another...
authorAbdelrazak Younes <younes@lyx.org>
Fri, 18 Dec 2009 22:59:59 +0000 (22:59 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Fri, 18 Dec 2009 22:59:59 +0000 (22:59 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32585 a592a061-630c-0410-9148-cb99ea01b6c8

src/Buffer.cpp
src/Buffer.h
src/Converter.cpp

index b4671076ad053c5e85f60cc07f9401af711b5a0f..e3319af92c38f1ea079f505fc3cc114030552713 100644 (file)
@@ -375,6 +375,12 @@ Buffer * Buffer::clone() const
 }
 
 
+bool Buffer::isClone() const
+{
+       return d->cloned_buffer_;
+}
+
+
 void Buffer::changed() const
 {
        if (d->wa_)
index 50bdf77bc9df2877eacea889a48b5564cd29f6a7..926a20de6ce5f625b8bad3e6654d606b38b99c74 100644 (file)
@@ -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.
index c8d0b119159f7d21cf1f69a0e52c3b3360540270..d8d1dd1ca87a512388f024ad87506127ace1d9ab 100644 (file)
@@ -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."));
        }