]> git.lyx.org Git - lyx.git/blob - src/insets/insetfoot.C
Make it compile when USE_BOOST_FORMAT is unset
[lyx.git] / src / insets / insetfoot.C
1 /**
2  * \file insetfoot.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Jürgen Vigna
7  * \author Lars Gullik Bjønnes
8  *
9  * Full author contact details are available in file CREDITS
10  */
11
12 #include <config.h>
13
14 #ifdef __GNUG__
15 #pragma implementation
16 #endif
17
18 #include "insetfoot.h"
19 #include "gettext.h"
20 #include "lyxfont.h"
21 #include "BufferView.h"
22 #include "lyxtext.h"
23 #include "insets/insettext.h"
24 #include "support/LOstream.h"
25 #include "debug.h"
26 // the following are needed just to get the layout of the enclosing
27 // paragraph. This seems a bit too much to me (JMarc)
28 #include "lyxlayout.h"
29 #include "buffer.h"
30 #include "paragraph.h"
31
32
33 using std::ostream;
34
35
36 InsetFoot::InsetFoot(BufferParams const & bp)
37         : InsetFootlike(bp)
38 {
39         setLabel(_("foot"));
40         setInsetName("Foot");
41 }
42
43
44 InsetFoot::InsetFoot(InsetFoot const & in, bool same_id)
45         : InsetFootlike(in, same_id)
46 {
47         setLabel(_("foot"));
48         setInsetName("Foot");
49 }
50
51
52 Inset * InsetFoot::clone(Buffer const &, bool same_id) const
53 {
54         return new InsetFoot(*const_cast<InsetFoot *>(this), same_id);
55 }
56
57
58 string const InsetFoot::editMessage() const
59 {
60         return _("Opened Footnote Inset");
61 }
62
63
64 int InsetFoot::latex(Buffer const * buf,
65                      ostream & os, bool fragile, bool fp) const
66 {
67         if (buf && parOwner()) {
68                 LyXLayout_ptr const & layout = parOwner()->layout();
69                 fragile |= layout->intitle;
70         }
71
72         os << "%\n\\footnote{";
73
74         int const i = inset.latex(buf, os, fragile, fp);
75         os << "%\n}";
76
77         return i + 2;
78 }
79
80
81 int InsetFoot::docbook(Buffer const * buf, ostream & os, bool mixcont) const
82 {
83         os << "<footnote>";
84         int const i = inset.docbook(buf, os, mixcont);
85         os << "</footnote>";
86
87         return i;
88 }