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"
19 #include "MetricsInfo.h"
28 InsetFootlike::InsetFootlike(Buffer * buf)
29 : InsetCollapsable(buf)
33 void InsetFootlike::metrics(MetricsInfo & mi, Dimension & dim) const
35 FontInfo tmpfont = mi.base.font;
36 mi.base.font = mi.base.bv->buffer().params().getFont().fontInfo();
37 InsetCollapsable::metrics(mi, dim);
38 mi.base.font = tmpfont;
42 void InsetFootlike::draw(PainterInfo & pi, int x, int y) const
44 FontInfo tmpfont = pi.base.font;
45 pi.base.font = pi.base.bv->buffer().params().getFont().fontInfo();
46 InsetCollapsable::draw(pi, x, y);
47 pi.base.font = tmpfont;
51 void InsetFootlike::write(ostream & os) const
53 os << to_utf8(name()) << "\n";
54 InsetCollapsable::write(os);
58 bool InsetFootlike::insetAllowed(InsetCode code) const
60 if (code == FOOT_CODE || code == MARGIN_CODE || code == FLOAT_CODE)
62 return InsetCollapsable::insetAllowed(code);