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(BufferParams const & bp)
28 : InsetCollapsable(bp)
32 InsetFootlike::InsetFootlike(InsetFootlike const & in)
33 : InsetCollapsable(in)
37 void InsetFootlike::metrics(MetricsInfo & mi, Dimension & dim) const
39 FontInfo tmpfont = mi.base.font;
40 mi.base.font = mi.base.bv->buffer().params().getFont().fontInfo();
41 InsetCollapsable::metrics(mi, dim);
42 mi.base.font = tmpfont;
46 void InsetFootlike::draw(PainterInfo & pi, int x, int y) const
48 FontInfo tmpfont = pi.base.font;
49 pi.base.font = pi.base.bv->buffer().params().getFont().fontInfo();
50 InsetCollapsable::draw(pi, x, y);
51 pi.base.font = tmpfont;
55 void InsetFootlike::write(Buffer const & buf, ostream & os) const
57 os << to_utf8(name()) << "\n";
58 InsetCollapsable::write(buf, os);
62 bool InsetFootlike::insetAllowed(InsetCode code) const
64 if (code == FOOT_CODE || code == MARGIN_CODE || code == FLOAT_CODE)
66 return InsetCollapsable::insetAllowed(code);