2 * \file InsetFootlike.cpp
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Lars Gullik Bjønnes
8 * Full author contact details are available in file CREDITS.
13 #include "InsetFootlike.h"
16 #include "BufferView.h"
17 #include "BufferParams.h"
18 #include "MetricsInfo.h"
22 InsetFootlike::InsetFootlike(BufferParams const & bp)
23 : InsetCollapsable(bp)
27 InsetFootlike::InsetFootlike(InsetFootlike const & in)
28 : InsetCollapsable(in)
32 bool InsetFootlike::metrics(MetricsInfo & mi, Dimension & dim) const
34 Font tmpfont = mi.base.font;
35 mi.base.font = mi.base.bv->buffer().params().getFont();
36 InsetCollapsable::metrics(mi, dim);
37 mi.base.font = tmpfont;
38 bool const changed = dim_ != dim;
44 void InsetFootlike::draw(PainterInfo & pi, int x, int y) const
46 Font tmpfont = pi.base.font;
47 pi.base.font = pi.base.bv->buffer().params().getFont();
48 InsetCollapsable::draw(pi, x, y);
49 pi.base.font = tmpfont;
53 void InsetFootlike::write(Buffer const & buf, std::ostream & os) const
55 os << to_utf8(name()) << "\n";
56 InsetCollapsable::write(buf, os);
60 bool InsetFootlike::insetAllowed(Inset::Code code) const
62 if (code == Inset::FOOT_CODE || code == Inset::MARGIN_CODE
63 || code == Inset::FLOAT_CODE)
65 return InsetCollapsable::insetAllowed(code);