2 * \file InsetOptArg.cpp
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Martin Vermeer
8 * Full author contact details are available in file CREDITS.
13 #include "InsetOptArg.h"
26 InsetOptArg::InsetOptArg(BufferParams const & ins)
27 : InsetCollapsable(ins)
29 Font font(Font::ALL_SANE);
30 font.setColor(Color::collapsable);
36 InsetOptArg::InsetOptArg(InsetOptArg const & in)
37 : InsetCollapsable(in)
39 Font font(Font::ALL_SANE);
40 font.setColor(Color::collapsable);
46 auto_ptr<Inset> InsetOptArg::doClone() const
48 return auto_ptr<Inset>(new InsetOptArg(*this));
52 docstring const InsetOptArg::editMessage() const
54 return _("Opened Optional Argument Inset");
58 void InsetOptArg::write(Buffer const & buf, ostream & os) const
60 os << "OptArg" << "\n";
61 InsetCollapsable::write(buf, os);
65 int InsetOptArg::latex(Buffer const &, odocstream &,
66 OutputParams const &) const
72 int InsetOptArg::plaintext(Buffer const &, odocstream &,
73 OutputParams const &) const
75 return 0; // do not output optional arguments
79 int InsetOptArg::docbook(Buffer const &, odocstream &,
80 OutputParams const &) const
86 int InsetOptArg::latexOptional(Buffer const & buf, odocstream & os,
87 OutputParams const & runparams) const
90 int ret = InsetText::latex(buf, ss, runparams);
91 docstring str = ss.str();
92 if (str.find(']') != docstring::npos)
93 str = '{' + str + '}';
94 os << '[' << str << ']';