]> git.lyx.org Git - features.git/blobdiff - src/insets/InsetInclude.cpp
s/updateLabels/updateBuffer/g, per a suggestion of Abdel's.
[features.git] / src / insets / InsetInclude.cpp
index e65cdd637f644397c9988c183d6efa06ef50961e..ccd0dda6ac97c6b0251e92c265609d6011c319e9 100644 (file)
@@ -29,7 +29,6 @@
 #include "LayoutFile.h"
 #include "LayoutModuleList.h"
 #include "LyX.h"
-#include "LyXFunc.h"
 #include "LyXRC.h"
 #include "Lexer.h"
 #include "MetricsInfo.h"
@@ -405,7 +404,8 @@ Buffer * InsetInclude::loadIfNeeded() const
 {
        // This is for background export and preview. We don't want to load the
        // cloned child document again.
-       if (child_buffer_ && child_buffer_->isClone())
+       if (child_buffer_ && theBufferList().isLoaded(child_buffer_)
+                 && child_buffer_->isClone())
                return child_buffer_;
 
        // Don't try to load it again if we failed before.
@@ -1047,18 +1047,18 @@ void InsetInclude::updateCommand()
        setParams(p);   
 }
 
-void InsetInclude::updateLabels(ParIterator const & it, bool out)
+void InsetInclude::updateBuffer(ParIterator const & it, UpdateType utype)
 {
        Buffer const * const childbuffer = getChildBuffer();
        if (childbuffer) {
-               childbuffer->updateLabels(Buffer::UpdateChildOnly, out);
+               childbuffer->updateBuffer(Buffer::UpdateChildOnly, utype);
                return;
        }
        if (!isListings(params()))
                return;
 
        if (label_)
-               label_->updateLabels(it, out);
+               label_->updateBuffer(it, utype);
 
        InsetListingsParams const par(to_utf8(params()["lstparams"]));
        if (par.getParamValue("caption").empty()) {
@@ -1070,7 +1070,7 @@ void InsetInclude::updateLabels(ParIterator const & it, bool out)
        docstring const cnt = from_ascii("listing");
        listings_label_ = master.B_("Program Listing");
        if (counters.hasCounter(cnt)) {
-               counters.step(cnt);
+               counters.step(cnt, utype);
                listings_label_ += " " + convert<docstring>(counters.value(cnt));
        }
 }