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"
25 InsetFootlike::InsetFootlike(BufferParams const & bp)
26 : InsetCollapsable(bp)
30 InsetFootlike::InsetFootlike(InsetFootlike const & in)
31 : InsetCollapsable(in)
35 void InsetFootlike::metrics(MetricsInfo & mi, Dimension & dim) const
37 FontInfo tmpfont = mi.base.font;
38 mi.base.font = mi.base.bv->buffer().params().getFont().fontInfo();
39 InsetCollapsable::metrics(mi, dim);
40 mi.base.font = tmpfont;
44 void InsetFootlike::draw(PainterInfo & pi, int x, int y) const
46 FontInfo tmpfont = pi.base.font;
47 pi.base.font = pi.base.bv->buffer().params().getFont().fontInfo();
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(InsetCode code) const
62 if (code == FOOT_CODE || code == MARGIN_CODE || code == FLOAT_CODE)
64 return InsetCollapsable::insetAllowed(code);