+
+
+string const InsetFloatMailer::name_("float");
+
+InsetFloatMailer::InsetFloatMailer(InsetFloat & inset)
+ : inset_(inset)
+{}
+
+
+string const InsetFloatMailer::inset2string(Buffer const &) const
+{
+ return params2string(inset_.params());
+}
+
+
+void InsetFloatMailer::string2params(string const & in,
+ InsetFloatParams & params)
+{
+ params = InsetFloatParams();
+ if (in.empty())
+ return;
+
+ istringstream data(in);
+ LyXLex lex(0,0);
+ lex.setStream(data);
+
+ string name;
+ lex >> name;
+ if (!lex || name != name_)
+ return print_mailer_error("InsetFloatMailer", in, 1, name_);
+
+ // This is part of the inset proper that is usually swallowed
+ // by LyXText::readInset
+ string id;
+ lex >> id;
+ if (!lex || id != "Float")
+ return print_mailer_error("InsetBoxMailer", in, 2, "Float");
+
+ // We have to read the type here!
+ lex >> params.type;
+ params.read(lex);
+}
+
+
+string const InsetFloatMailer::params2string(InsetFloatParams const & params)
+{
+ ostringstream data;
+ data << name_ << ' ';
+ params.write(data);
+ return data.str();
+}