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"
27 InsetFootlike::InsetFootlike(Buffer * buf)
28 : InsetCollapsable(buf)
32 void InsetFootlike::metrics(MetricsInfo & mi, Dimension & dim) const
34 FontInfo tmpfont = mi.base.font;
35 mi.base.font = mi.base.bv->buffer().params().getFont().fontInfo();
36 InsetCollapsable::metrics(mi, dim);
37 mi.base.font = tmpfont;
41 void InsetFootlike::draw(PainterInfo & pi, int x, int y) const
43 FontInfo tmpfont = pi.base.font;
44 pi.base.font = pi.base.bv->buffer().params().getFont().fontInfo();
45 InsetCollapsable::draw(pi, x, y);
46 pi.base.font = tmpfont;
50 void InsetFootlike::write(ostream & os) const
52 os << to_utf8(name()) << "\n";
53 InsetCollapsable::write(os);
57 bool InsetFootlike::insetAllowed(InsetCode code) const
59 if (code == FOOT_CODE || code == MARGIN_CODE || code == FLOAT_CODE)
61 return InsetCollapsable::insetAllowed(code);