#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;
}
+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';
void InsetFloat::validate(LaTeXFeatures & features) const
{
- if (contains(params_.placement, 'H')) {
+ if (support::contains(params_.placement, 'H')) {
features.require("float");
}
}
-auto_ptr<Inset> InsetFloat::doClone() const
+Inset * InsetFloat::clone() const
{
- return auto_ptr<Inset>(new InsetFloat(*this));
+ return new InsetFloat(*this);
}