]> git.lyx.org Git - lyx.git/blob - src/insets/InsetFootlike.cpp
* src/paragraph_funcs.cpp (breakParagraph): change parameter 'flag' to
[lyx.git] / src / insets / InsetFootlike.cpp
1 /**
2  * \file InsetFootlike.cpp
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Lars Gullik Bjønnes
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "InsetFootlike.h"
14
15 #include "Buffer.h"
16 #include "BufferView.h"
17 #include "BufferParams.h"
18 #include "MetricsInfo.h"
19
20
21 namespace lyx {
22
23
24 InsetFootlike::InsetFootlike(BufferParams const & bp)
25         : InsetCollapsable(bp)
26 {}
27
28
29 InsetFootlike::InsetFootlike(InsetFootlike const & in)
30         : InsetCollapsable(in)
31 {}
32
33
34 void InsetFootlike::metrics(MetricsInfo & mi, Dimension & dim) const
35 {
36         Font tmpfont = mi.base.font;
37         mi.base.font = mi.base.bv->buffer().params().getFont();
38         InsetCollapsable::metrics(mi, dim);
39         mi.base.font = tmpfont;
40 }
41
42
43 void InsetFootlike::draw(PainterInfo & pi, int x, int y) const
44 {
45         Font tmpfont = pi.base.font;
46         pi.base.font = pi.base.bv->buffer().params().getFont();
47         InsetCollapsable::draw(pi, x, y);
48         pi.base.font = tmpfont;
49 }
50
51
52 void InsetFootlike::write(Buffer const & buf, std::ostream & os) const
53 {
54         os << to_utf8(name()) << "\n";
55         InsetCollapsable::write(buf, os);
56 }
57
58
59 bool InsetFootlike::insetAllowed(Inset::Code code) const
60 {
61         if (code == Inset::FOOT_CODE || code == Inset::MARGIN_CODE
62             || code == Inset::FLOAT_CODE)
63                 return false;
64         return InsetCollapsable::insetAllowed(code);
65 }
66
67
68 } // namespace lyx