]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetWrap.cpp
Fix text frame drawing.
[lyx.git] / src / insets / InsetWrap.cpp
index dd655c3603a18b4323381dfdb7a00efb53065b4c..8c72fc8571dee743455cec2c6e336601457d8f33 100644 (file)
@@ -15,6 +15,7 @@
 #include "Buffer.h"
 #include "BufferParams.h"
 #include "BufferView.h"
+#include "Counters.h"
 #include "Cursor.h"
 #include "debug.h"
 #include "DispatchResult.h"
@@ -36,7 +37,6 @@ namespace lyx {
 
 using std::string;
 using std::endl;
-using std::auto_ptr;
 using std::istringstream;
 using std::ostream;
 using std::ostringstream;
@@ -108,6 +108,21 @@ bool InsetWrap::getStatus(Cursor & cur, FuncRequest const & cmd,
 }
 
 
+void InsetWrap::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(params().type);
+
+       InsetCollapsable::updateLabels(buf, it);
+
+       //reset afterwards
+       cnts.current_float(saveflt);
+}
+
+
 void InsetWrapParams::write(ostream & os) const
 {
        os << "Wrap " << type << '\n';
@@ -165,9 +180,9 @@ void InsetWrap::validate(LaTeXFeatures & features) const
 }
 
 
-auto_ptr<Inset> InsetWrap::doClone() const
+Inset * InsetWrap::clone() const
 {
-       return auto_ptr<Inset>(new InsetWrap(*this));
+       return new InsetWrap(*this);
 }