]> git.lyx.org Git - lyx.git/blobdiff - src/Buffer.cpp
Fix footnote output in description item
[lyx.git] / src / Buffer.cpp
index a9cc619060193b58232cf8d64d25a0a632f7c9d3..9ec20e0fbbcb09b24277260cb8e453a4767dd89c 100644 (file)
@@ -55,6 +55,7 @@
 #include "ParagraphParameters.h"
 #include "ParIterator.h"
 #include "PDFOptions.h"
+#include "Session.h"
 #include "SpellChecker.h"
 #include "sgml.h"
 #include "texstream.h"
@@ -537,10 +538,10 @@ Buffer::~Buffer()
                for (; it != end; ++it) {
                        Buffer * child = const_cast<Buffer *>(it->first);
                        if (theBufferList().isLoaded(child)) {
-                        if (theBufferList().isOthersChild(this, child))
-                                child->setParent(0);
-                        else
-                               theBufferList().release(child);
+                               if (theBufferList().isOthersChild(this, child))
+                                       child->setParent(0);
+                               else
+                                       theBufferList().release(child);
                        }
                }
 
@@ -980,6 +981,8 @@ int Buffer::readHeader(Lexer & lex)
                errorList.push_back(ErrorItem(_("Document header error"), s));
        }
 
+       params().shell_escape = theSession().shellescapeFiles().find(absFileName());
+
        params().makeDocumentClass();
 
        return unknown_tokens;
@@ -2443,15 +2446,16 @@ void Buffer::reloadBibInfoCache() const
                return;
 
        d->bibinfo_.clear();
-       collectBibKeys();
+       FileNameList checkedFiles;
+       collectBibKeys(checkedFiles);
        d->bibinfo_cache_valid_ = true;
 }
 
 
-void Buffer::collectBibKeys() const
+void Buffer::collectBibKeys(FileNameList & checkedFiles) const
 {
        for (InsetIterator it = inset_iterator_begin(inset()); it; ++it)
-               it->collectBibKeys(it);
+               it->collectBibKeys(it, checkedFiles);
 }
 
 
@@ -3717,8 +3721,12 @@ void Buffer::listMacroNames(MacroNameSet & macros) const
        // loop over children
        Impl::BufferPositionMap::iterator it = d->children_positions.begin();
        Impl::BufferPositionMap::iterator end = d->children_positions.end();
-       for (; it != end; ++it)
-               it->first->listMacroNames(macros);
+       for (; it != end; ++it) {
+               Buffer * child = const_cast<Buffer *>(it->first);
+               // The buffer might have been closed (see #10766).
+               if (theBufferList().isLoaded(child))
+                       child->listMacroNames(macros);
+       }
 
        // call parent
        Buffer const * const pbuf = d->parent();
@@ -4909,8 +4917,10 @@ void Buffer::Impl::setLabel(ParIterator & it, UpdateType utype) const
                switch (par.itemdepth) {
                case 2:
                        enumcounter += 'i';
+                       // fall through
                case 1:
                        enumcounter += 'i';
+                       // fall through
                case 0:
                        enumcounter += 'i';
                        break;