]> git.lyx.org Git - lyx.git/blob - src/insets/InsetOptArg.cpp
getting rid of superfluous std:: statements.
[lyx.git] / src / insets / InsetOptArg.cpp
1 /**
2  * \file InsetOptArg.cpp
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Martin Vermeer
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "InsetOptArg.h"
14
15 #include "support/debug.h"
16 #include "support/gettext.h"
17
18 #include "support/docstream.h"
19
20 using namespace std;
21
22 namespace lyx {
23
24
25 InsetOptArg::InsetOptArg(BufferParams const & ins)
26         : InsetCollapsable(ins)
27 {}
28
29
30 InsetOptArg::InsetOptArg(InsetOptArg const & in)
31         : InsetCollapsable(in)
32 {}
33
34
35 Inset * InsetOptArg::clone() const
36 {
37         return new InsetOptArg(*this);
38 }
39
40
41 docstring const InsetOptArg::editMessage() const
42 {
43         return _("Opened Optional Argument Inset");
44 }
45
46
47 void InsetOptArg::write(Buffer const & buf, ostream & os) const
48 {
49         os << "OptArg" << "\n";
50         InsetCollapsable::write(buf, os);
51 }
52
53
54 int InsetOptArg::latex(Buffer const &, odocstream &,
55                        OutputParams const &) const
56 {
57         return 0;
58 }
59
60
61 int InsetOptArg::plaintext(Buffer const &, odocstream &,
62                            OutputParams const &) const
63 {
64         return 0; // do not output optional arguments
65 }
66
67
68 int InsetOptArg::docbook(Buffer const &, odocstream &,
69                          OutputParams const &) const
70 {
71         return 0;
72 }
73
74
75 int InsetOptArg::latexOptional(Buffer const & buf, odocstream & os,
76                                OutputParams const & runparams) const
77 {
78         odocstringstream ss;
79         int ret = InsetText::latex(buf, ss, runparams);
80         docstring str = ss.str();
81         if (str.find(']') != docstring::npos)
82                 str = '{' + str + '}';
83         os << '[' << str << ']';
84         return ret;
85 }
86
87
88 } // namespace lyx