- params_.write(os);
- InsetCollapsable::write(buf, os);
-}
-
-
-void InsetFlex::read(Buffer const & buf, Lexer & lex)
-{
- params_.read(lex);
- InsetCollapsable::read(buf, lex);
-}
-
-
-void InsetFlex::metrics(MetricsInfo & mi, Dimension & dim) const
-{
- Font tmpfont = mi.base.font;
- getDrawFont(mi.base.font);
- mi.base.font.reduce(Font(Font::ALL_SANE));
- mi.base.font.realize(tmpfont);
- InsetCollapsable::metrics(mi, dim);
- mi.base.font = tmpfont;
-}
-
-
-void InsetFlex::draw(PainterInfo & pi, int x, int y) const
-{
- Font tmpfont = pi.base.font;
- getDrawFont(pi.base.font);
- // I don't understand why the above .reduce and .realize aren't
- //needed, or even wanted, here. It just works. -- MV 10.04.2005
- InsetCollapsable::draw(pi, x, y);
- pi.base.font = tmpfont;
-}
-
-
-void InsetFlex::getDrawFont(Font & font) const
-{
- font = layout_.font;
-}
-
-
-void InsetFlex::doDispatch(Cursor & cur, FuncRequest & cmd)
-{
- InsetCollapsable::doDispatch(cur, cmd);
+ os << "Flex ";
+ string name;
+ if (name_.empty())
+ name = "undefined";
+ else {
+ InsetLayout const & il = getLayout();
+ // use il.name(), since this resolves obsoleted InsetLayout names
+ if (il.name() == "undefined")
+ // This is the name of the plain_insetlayout_. We assume that the
+ // name resolution has failed.
+ name = name_;
+ else {
+ name = to_utf8(il.name());
+ // Remove the "Flex:" prefix, if it is present
+ if (support::prefixIs(name, "Flex:"))
+ name = support::split(name, ':');
+ }
+ }
+ os << name << "\n";
+ InsetCollapsible::write(os);