]> git.lyx.org Git - lyx.git/blob - src/insets/InsetArgument.cpp
tex2lyx/text.cpp: fix typos
[lyx.git] / src / insets / InsetArgument.cpp
1 /**
2  * \file InsetArgument.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 "InsetArgument.h"
14
15 #include "support/debug.h"
16 #include "support/docstream.h"
17 #include "support/gettext.h"
18
19 using namespace std;
20
21 namespace lyx {
22
23
24 InsetArgument::InsetArgument(Buffer * buf)
25         : InsetCollapsable(buf)
26 {}
27
28
29 void InsetArgument::write(ostream & os) const
30 {
31         os << "Argument" << "\n";
32         InsetCollapsable::write(os);
33 }
34
35 void InsetArgument::latexArgument(otexstream & os,
36                 OutputParams const & runparams, bool optional) const
37 {
38         TexRow texrow;
39         odocstringstream ss;
40         otexstream ots(ss, texrow);
41         InsetText::latex(ots, runparams);
42         docstring str = ss.str();
43         if (optional && str.find(']') != docstring::npos)
44                 str = '{' + str + '}';
45         os << (optional ? '[' : '{') << str
46            << (optional ? ']' : '}');
47 }
48
49
50 } // namespace lyx