]> git.lyx.org Git - lyx.git/blobdiff - src/Buffer.cpp
Fix bug 4441. GuiRef: Ok button must be default.
[lyx.git] / src / Buffer.cpp
index 4d6f175e65b5368029f6ed01c835947fb816f514..8105d5261ba8b57006528033b55105e4116f2080 100644 (file)
@@ -779,7 +779,7 @@ Buffer::ReadStatus Buffer::readFile(Lexer & lex, FileName const & filename,
                                     bformat(_("%1$s is from a different"
                                              " version of LyX, but a temporary"
                                              " file for converting it could"
-                                                           " not be created."),
+                                             " not be created."),
                                              from_utf8(filename.absFilename())));
                        return failure;
                }
@@ -789,7 +789,7 @@ Buffer::ReadStatus Buffer::readFile(Lexer & lex, FileName const & filename,
                                     bformat(_("%1$s is from a different"
                                               " version of LyX, but the"
                                               " conversion script lyx2lyx"
-                                                           " could not be found."),
+                                              " could not be found."),
                                               from_utf8(filename.absFilename())));
                        return failure;
                }
@@ -808,7 +808,7 @@ Buffer::ReadStatus Buffer::readFile(Lexer & lex, FileName const & filename,
                        Alert::error(_("Conversion script failed"),
                                     bformat(_("%1$s is from a different version"
                                              " of LyX, but the lyx2lyx script"
-                                                           " failed to convert it."),
+                                             " failed to convert it."),
                                              from_utf8(filename.absFilename())));
                        return failure;
                } else {
@@ -1368,10 +1368,10 @@ void Buffer::getLabelList(vector<docstring> & list) const
 }
 
 
-void Buffer::updateBibfilesCache() const
+void Buffer::updateBibfilesCache(UpdateScope scope) const
 {
        // If this is a child document, use the parent's cache instead.
-       if (d->parent_buffer) {
+       if (d->parent_buffer && scope != UpdateChildOnly) {
                d->parent_buffer->updateBibfilesCache();
                return;
        }
@@ -1390,7 +1390,7 @@ void Buffer::updateBibfilesCache() const
                                static_cast<InsetInclude &>(*it);
                        inset.updateBibfilesCache();
                        support::FileNameList const & bibfiles =
-                                       inset.getBibfilesCache(*this);
+                                       inset.getBibfilesCache();
                        d->bibfilesCache_.insert(d->bibfilesCache_.end(),
                                bibfiles.begin(),
                                bibfiles.end());
@@ -1407,15 +1407,15 @@ void Buffer::invalidateBibinfoCache()
 }
 
 
-support::FileNameList const & Buffer::getBibfilesCache() const
+support::FileNameList const & Buffer::getBibfilesCache(UpdateScope scope) const
 {
        // If this is a child document, use the parent's cache instead.
-       if (d->parent_buffer)
+       if (d->parent_buffer && scope != UpdateChildOnly)
                return d->parent_buffer->getBibfilesCache();
 
        // We update the cache when first used instead of at loading time.
        if (d->bibfilesCache_.empty())
-               const_cast<Buffer *>(this)->updateBibfilesCache();
+               const_cast<Buffer *>(this)->updateBibfilesCache(scope);
 
        return d->bibfilesCache_;
 }
@@ -1968,7 +1968,7 @@ void Buffer::updateMacros(DocIterator & it, DocIterator & scope) const
                                InsetInclude const & inset =
                                        static_cast<InsetInclude const &>(*iit->inset);
                                d->macro_lock = true;
-                               Buffer * child = inset.loadIfNeeded(*this);
+                               Buffer * child = inset.getChildBuffer();
                                d->macro_lock = false;
                                if (!child)
                                        continue;