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"
22 InsetOptArg::InsetOptArg(BufferParams const & ins)
23 : InsetCollapsable(ins)
25 Font font(Font::ALL_SANE);
26 font.setColor(Color_collapsable);
32 InsetOptArg::InsetOptArg(InsetOptArg const & in)
33 : InsetCollapsable(in)
35 Font font(Font::ALL_SANE);
36 font.setColor(Color_collapsable);
42 Inset * InsetOptArg::clone() const
44 return new InsetOptArg(*this);
48 docstring const InsetOptArg::editMessage() const
50 return _("Opened Optional Argument Inset");
54 void InsetOptArg::write(Buffer const & buf, std::ostream & os) const
56 os << "OptArg" << "\n";
57 InsetCollapsable::write(buf, os);
61 int InsetOptArg::latex(Buffer const &, odocstream &,
62 OutputParams const &) const
68 int InsetOptArg::plaintext(Buffer const &, odocstream &,
69 OutputParams const &) const
71 return 0; // do not output optional arguments
75 int InsetOptArg::docbook(Buffer const &, odocstream &,
76 OutputParams const &) const
82 int InsetOptArg::latexOptional(Buffer const & buf, odocstream & os,
83 OutputParams const & runparams) const
86 int ret = InsetText::latex(buf, ss, runparams);
87 docstring str = ss.str();
88 if (str.find(']') != docstring::npos)
89 str = '{' + str + '}';
90 os << '[' << str << ']';