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"
21 #include "support/lstrings.h"
31 InsetFootlike::InsetFootlike(Buffer * buf)
32 : InsetCollapsible(buf)
36 void InsetFootlike::metrics(MetricsInfo & mi, Dimension & dim) const
38 FontInfo tmpfont = mi.base.font;
39 mi.base.font = mi.base.bv->buffer().params().getFont().fontInfo();
40 InsetCollapsible::metrics(mi, dim);
41 mi.base.font = tmpfont;
45 void InsetFootlike::draw(PainterInfo & pi, int x, int y) const
47 FontInfo tmpfont = pi.base.font;
48 pi.base.font = pi.base.bv->buffer().params().getFont().fontInfo();
49 InsetCollapsible::draw(pi, x, y);
50 pi.base.font = tmpfont;
54 void InsetFootlike::write(ostream & os) const
56 // The layoutName may contain a "InTitle" qualifier
57 os << to_utf8(token(layoutName(), char_type(':'), 0)) << "\n";
58 InsetCollapsible::write(os);
62 bool InsetFootlike::insetAllowed(InsetCode code) const
64 if (code == FOOT_CODE || code == MARGIN_CODE || code == FLOAT_CODE)
66 return InsetCollapsible::insetAllowed(code);