]> git.lyx.org Git - lyx.git/blobdiff - src/Buffer.cpp
InsetTabular.cpp: multirows inherit the width and the alignment from the column;...
[lyx.git] / src / Buffer.cpp
index f03df4df217e8ded5a46fed2f47fa6e199febbd4..5bd73da715315da24f5f00effdb0757f195ba092 100644 (file)
@@ -414,9 +414,8 @@ Buffer::~Buffer()
                        from_utf8(d->temppath.absFileName())));
        }
 
-       // Remove any previewed LaTeX snippets associated with this buffer.
        if (!isClone())
-               thePreviews().removeLoader(*this);
+               removePreviews();
 
        delete d;
 }
@@ -906,6 +905,19 @@ void Buffer::setFullyLoaded(bool value)
 }
 
 
+void Buffer::updatePreviews() const
+{
+       if (graphics::Previews::status() != LyXRC::PREVIEW_OFF)
+               thePreviews().generateBufferPreviews(*this);
+}
+
+
+void Buffer::removePreviews() const
+{
+       thePreviews().removeLoader(*this);
+}
+
+
 Buffer::ReadStatus Buffer::parseLyXFormat(Lexer & lex,
        FileName const & fn, int & file_format) const
 {
@@ -4096,7 +4108,7 @@ int Buffer::spellCheck(DocIterator & from, DocIterator & to,
 }
 
 
-bool Buffer::reload()
+Buffer::ReadStatus Buffer::reload()
 {
        setBusy(true);
        // c.f. bug 6587
@@ -4105,23 +4117,21 @@ bool Buffer::reload()
        d->filename.refresh();
        docstring const disp_fn = makeDisplayPath(d->filename.absFileName());
 
-       bool const success = (loadLyXFile(d->filename) == ReadSuccess);
-       if (success) {
+       ReadStatus const status = loadLyXFile(d->filename);
+       if (status == ReadSuccess) {
                updateBuffer();
                changed(true);
                updateTitles();
                markClean();
-               saveCheckSum();
                message(bformat(_("Document %1$s reloaded."), disp_fn));
        } else {
                message(bformat(_("Could not reload document %1$s."), disp_fn));
        }       
        setBusy(false);
-       thePreviews().removeLoader(*this);
-       if (graphics::Previews::status() != LyXRC::PREVIEW_OFF)
-               thePreviews().generateBufferPreviews(*this);
+       removePreviews();
+       updatePreviews();
        errors("Parse");
-       return success;
+       return status;
 }