lyx_mirror/src/insets/InsetOptArg.cpp
Abdelrazak Younes 5ddc612b73 Splitup Font in saner bits:
* Font::FontBits -> FontInfo
* Font::FONT_XXX -> all enums transfered to FontEnums.h and renamed to FontXxx

I've replaced Font uses with FontInfo were the language() member was not needed, basically all draw() and metrics methods. There's one problematic cases with InsetQuotes which I solved by taking the Buffer main language.




git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21240 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-28 18:51:54 +00:00

96 lines
1.7 KiB
C++

/**
* \file InsetOptArg.cpp
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author Martin Vermeer
*
* Full author contact details are available in file CREDITS.
*/
#include <config.h>
#include "InsetOptArg.h"
#include "debug.h"
#include "gettext.h"
namespace lyx {
InsetOptArg::InsetOptArg(BufferParams const & ins)
: InsetCollapsable(ins)
{
FontInfo font = sane_font;
font.setColor(Color_collapsable);
setLabelFont(font);
setLabel(_("opt"));
}
InsetOptArg::InsetOptArg(InsetOptArg const & in)
: InsetCollapsable(in)
{
FontInfo font = sane_font;
font.setColor(Color_collapsable);
setLabelFont(font);
setLabel(_("opt"));
}
Inset * InsetOptArg::clone() const
{
return new InsetOptArg(*this);
}
docstring const InsetOptArg::editMessage() const
{
return _("Opened Optional Argument Inset");
}
void InsetOptArg::write(Buffer const & buf, std::ostream & os) const
{
os << "OptArg" << "\n";
InsetCollapsable::write(buf, os);
}
int InsetOptArg::latex(Buffer const &, odocstream &,
OutputParams const &) const
{
return 0;
}
int InsetOptArg::plaintext(Buffer const &, odocstream &,
OutputParams const &) const
{
return 0; // do not output optional arguments
}
int InsetOptArg::docbook(Buffer const &, odocstream &,
OutputParams const &) const
{
return 0;
}
int InsetOptArg::latexOptional(Buffer const & buf, odocstream & os,
OutputParams const & runparams) const
{
odocstringstream ss;
int ret = InsetText::latex(buf, ss, runparams);
docstring str = ss.str();
if (str.find(']') != docstring::npos)
str = '{' + str + '}';
os << '[' << str << ']';
return ret;
}
} // namespace lyx