]> git.lyx.org Git - lyx.git/blob - src/insets/InsetOptArg.cpp
Fix GRAPHICS_EDIT of InsetGraphics
[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/docstream.h"
17 #include "support/gettext.h"
18
19 using namespace std;
20
21 namespace lyx {
22
23
24 InsetOptArg::InsetOptArg(Buffer const & buf)
25         : InsetCollapsable(buf)
26 {}
27
28
29 docstring InsetOptArg::editMessage() const
30 {
31         return _("Opened Optional Argument Inset");
32 }
33
34
35 void InsetOptArg::write(ostream & os) const
36 {
37         os << "OptArg" << "\n";
38         InsetCollapsable::write(os);
39 }
40
41
42 int InsetOptArg::latex(odocstream &, OutputParams const &) const
43 {
44         return 0;
45 }
46
47
48 int InsetOptArg::plaintext(odocstream &, OutputParams const &) const
49 {
50         return 0; // do not output optional arguments
51 }
52
53
54 int InsetOptArg::docbook(odocstream &, OutputParams const &) const
55 {
56         return 0;
57 }
58
59
60 int InsetOptArg::latexOptional(odocstream & os,
61                                OutputParams const & runparams) const
62 {
63         odocstringstream ss;
64         int ret = InsetText::latex(ss, runparams);
65         docstring str = ss.str();
66         if (str.find(']') != docstring::npos)
67                 str = '{' + str + '}';
68         os << '[' << str << ']';
69         return ret;
70 }
71
72
73 } // namespace lyx