X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FBuffer.cpp;h=9b8730d4658f080f398f3b1917b26efbc843ca04;hb=2098f1d8c20d51e63e670bcdc9da8996068975bf;hp=63dee570eb036335eeeabaf30bd884e724a4de6a;hpb=d95aaa0e5b42913ba64062a4e51009555fb324d5;p=lyx.git diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 63dee570eb..9b8730d465 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -1457,8 +1457,8 @@ void Buffer::writeLyXHTMLSource(odocstream & os, LaTeXFeatures features(*this, params(), runparams); validate(features); updateLabels(UpdateMaster, true); - - d->texrow.reset(); + checkBibInfoCache(); + d->bibinfo_.collectCitedEntries(*this); if (!only_body) { os << "\n"; @@ -1640,18 +1640,23 @@ BiblioInfo const & Buffer::masterBibInfo() const BiblioInfo const & Buffer::localBibInfo() const { - if (d->bibinfoCacheValid_) { - support::FileNameList const & bibfilesCache = getBibfilesCache(); - // compare the cached timestamps with the actual ones. - support::FileNameList::const_iterator ei = bibfilesCache.begin(); - support::FileNameList::const_iterator en = bibfilesCache.end(); - for (; ei != en; ++ ei) { - time_t lastw = ei->lastModified(); - if (lastw != d->bibfileStatus_[*ei]) { - d->bibinfoCacheValid_ = false; - d->bibfileStatus_[*ei] = lastw; - break; - } + checkBibInfoCache(); + return d->bibinfo_; +} + + +void Buffer::checkBibInfoCache() const +{ + support::FileNameList const & bibfilesCache = getBibfilesCache(); + // compare the cached timestamps with the actual ones. + support::FileNameList::const_iterator ei = bibfilesCache.begin(); + support::FileNameList::const_iterator en = bibfilesCache.end(); + for (; ei != en; ++ ei) { + time_t lastw = ei->lastModified(); + time_t prevw = d->bibfileStatus_[*ei]; + if (lastw != prevw) { + d->bibinfoCacheValid_ = false; + d->bibfileStatus_[*ei] = lastw; } } @@ -1660,8 +1665,7 @@ BiblioInfo const & Buffer::localBibInfo() const for (InsetIterator it = inset_iterator_begin(inset()); it; ++it) it->fillWithBibKeys(d->bibinfo_, it); d->bibinfoCacheValid_ = true; - } - return d->bibinfo_; + } } @@ -3203,6 +3207,14 @@ bool Buffer::doExport(string const & format, bool put_in_tempdir, if (!success) return false; + if (d->cloned_buffer_) { + // Enable reverse dvi or pdf to work by copying back the texrow + // object to the cloned buffer. + // FIXME: There is a possibility of concurrent access to texrow + // here from the main GUI thread that should be securized. + d->cloned_buffer_->d->texrow = d->texrow; + } + if (put_in_tempdir) { result_file = tmp_result_file.absFilename(); return true;