]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetFloat.cpp
Fix text frame drawing.
[lyx.git] / src / insets / InsetFloat.cpp
index c83fb96635906cebc028f5192fbd17cbab618eff..56d57a8de80b505a93282f6d93eb5c3ce2b2ba05 100644 (file)
@@ -16,6 +16,7 @@
 #include "Buffer.h"
 #include "BufferParams.h"
 #include "BufferView.h"
+#include "Counters.h"
 #include "Cursor.h"
 #include "debug.h"
 #include "DispatchResult.h"
 #include "FuncStatus.h"
 #include "gettext.h"
 #include "LaTeXFeatures.h"
-#include "Color.h"
 #include "Lexer.h"
 #include "OutputParams.h"
-#include "Paragraph.h"
-#include "TocBackend.h"
 
 #include "support/lstrings.h"
 #include "support/convert.h"
 
 namespace lyx {
 
-using support::contains;
-
 using std::endl;
 using std::string;
-using std::auto_ptr;
 using std::istringstream;
 using std::ostream;
 using std::ostringstream;
@@ -186,6 +181,21 @@ bool InsetFloat::getStatus(Cursor & cur, FuncRequest const & cmd,
 }
 
 
+void InsetFloat::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 InsetFloatParams::write(ostream & os) const
 {
        os << "Float " << type << '\n';
@@ -254,7 +264,7 @@ void InsetFloat::read(Buffer const & buf, Lexer & lex)
 
 void InsetFloat::validate(LaTeXFeatures & features) const
 {
-       if (contains(params_.placement, 'H')) {
+       if (support::contains(params_.placement, 'H')) {
                features.require("float");
        }
 
@@ -266,9 +276,9 @@ void InsetFloat::validate(LaTeXFeatures & features) const
 }
 
 
-auto_ptr<Inset> InsetFloat::doClone() const
+Inset * InsetFloat::clone() const
 {
-       return auto_ptr<Inset>(new InsetFloat(*this));
+       return new InsetFloat(*this);
 }