]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetListings.cpp
Fix for bug 4135
[lyx.git] / src / insets / InsetListings.cpp
index e3f10b3f763ed1c1d6276dab18c397f4bbe62a11..e756d4fb7b5c462890aad16e0fa9709ca1a6d929 100644 (file)
@@ -14,6 +14,9 @@
 #include "InsetListings.h"
 #include "InsetCaption.h"
 
+#include "Buffer.h"
+#include "BufferParams.h"
+#include "Counters.h"
 #include "Language.h"
 #include "gettext.h"
 #include "DispatchResult.h"
@@ -84,6 +87,21 @@ Inset::DisplayType InsetListings::display() const
 }
 
 
+void InsetListings::updateLabels(Buffer const & buf, ParIterator const & it)
+{
+       Counters & cnts = buf.params().getTextClass().counters();
+       string const saveflt = cnts.current_float();
+
+       // Tell to captions what the current float is
+       cnts.current_float("listing");
+
+       InsetCollapsable::updateLabels(buf, it);
+
+       //reset afterwards
+       cnts.current_float(saveflt);
+}
+
+
 void InsetListings::write(Buffer const & buf, ostream & os) const
 {
        os << "listings" << "\n";