InsetLayout::InsetLayout() :
name_(from_ascii("undefined")), lyxtype_(STANDARD),
labelstring_(from_ascii("UNDEFINED")), contentaslabel_(false),
InsetLayout::InsetLayout() :
name_(from_ascii("undefined")), lyxtype_(STANDARD),
labelstring_(from_ascii("UNDEFINED")), contentaslabel_(false),
- decoration_(DEFAULT), latextype_(NOLATEXTYPE), font_(sane_font),
+ decoration_(DEFAULT), latextype_(NOLATEXTYPE), font_(inherit_font),
labelfont_(sane_font), bgcolor_(Color_error),
htmlforcecss_ (false), htmlisblock_(true),
multipar_(true), custompars_(true), forceplain_(false),
passthru_(false), parbreakisnewline_(false), freespacing_(false),
keepempty_(false), forceltr_(false),
needprotect_(false), intoc_(false), spellcheck_(true),
labelfont_(sane_font), bgcolor_(Color_error),
htmlforcecss_ (false), htmlisblock_(true),
multipar_(true), custompars_(true), forceplain_(false),
passthru_(false), parbreakisnewline_(false), freespacing_(false),
keepempty_(false), forceltr_(false),
needprotect_(false), intoc_(false), spellcheck_(true),
InsetLayout::InsetDecoration translateDecoration(std::string const & str)
{
if (support::compare_ascii_no_case(str, "classic") == 0)
InsetLayout::InsetDecoration translateDecoration(std::string const & str)
{
if (support::compare_ascii_no_case(str, "classic") == 0)
InsetLayout::InsetLaTeXType translateLaTeXType(std::string const & str)
{
if (support::compare_ascii_no_case(str, "command") == 0)
InsetLayout::InsetLaTeXType translateLaTeXType(std::string const & str)
{
if (support::compare_ascii_no_case(str, "command") == 0)
{ "forceltr", IL_FORCELTR },
{ "forceplain", IL_FORCEPLAIN },
{ "freespacing", IL_FREESPACING },
{ "forceltr", IL_FORCELTR },
{ "forceplain", IL_FORCEPLAIN },
{ "freespacing", IL_FREESPACING },
{ "preamble", IL_PREAMBLE },
{ "refprefix", IL_REFPREFIX },
{ "requires", IL_REQUIRES },
{ "preamble", IL_PREAMBLE },
{ "refprefix", IL_REFPREFIX },
{ "requires", IL_REQUIRES },
{ "resetsfont", IL_RESETSFONT },
{ "rightdelim", IL_RIGHTDELIM },
{ "spellcheck", IL_SPELLCHECK }
{ "resetsfont", IL_RESETSFONT },
{ "rightdelim", IL_RIGHTDELIM },
{ "spellcheck", IL_SPELLCHECK }
while (!finished && lex.isOK() && !error) {
lex.next();
string const tok = support::ascii_lowercase(lex.getString());
while (!finished && lex.isOK() && !error) {
lex.next();
string const tok = support::ascii_lowercase(lex.getString());
+ arg.rdelim = support::subst(arg.rdelim,
+ from_ascii("<br/>"), from_ascii("\n"));
+ } else if (tok == "defaultarg") {
+ lex.next();
+ arg.defaultarg = lex.getDocString();
+ } else if (tok == "presetarg") {
+ lex.next();
+ arg.presetarg = lex.getDocString();
} else if (tok == "tooltip") {
lex.next();
arg.tooltip = lex.getDocString();
} else if (tok == "requires") {
lex.next();
arg.requires = lex.getString();
} else if (tok == "tooltip") {
lex.next();
arg.tooltip = lex.getDocString();
} else if (tok == "requires") {
lex.next();
arg.requires = lex.getString();
+ } else if (tok == "decoration") {
+ lex.next();
+ arg.decoration = lex.getString();
+ } else if (tok == "font") {
+ arg.font = lyxRead(lex, arg.font);
+ } else if (tok == "labelfont") {
+ arg.labelfont = lyxRead(lex, arg.labelfont);
-unsigned int InsetLayout::numOptArgs() const
+
+Layout::LaTeXArgMap InsetLayout::args() const
+{
+ Layout::LaTeXArgMap args = latexargs_;
+ if (!postcommandargs_.empty())
+ args.insert(postcommandargs_.begin(), postcommandargs_.end());
+ return args;
+}
+
+
+unsigned int InsetLayout::optArgs() const
- Layout::LaTeXArgMap::const_iterator it = latexargs_.begin();
- for (; it != latexargs_.end(); ++it) {
+ Layout::LaTeXArgMap const args = InsetLayout::args();
+ Layout::LaTeXArgMap::const_iterator it = args.begin();
+ for (; it != args.end(); ++it) {
- Layout::LaTeXArgMap::const_iterator it = latexargs_.begin();
- for (; it != latexargs_.end(); ++it) {
+ Layout::LaTeXArgMap const args = InsetLayout::args();
+ Layout::LaTeXArgMap::const_iterator it = args.begin();
+ for (; it != args.end(); ++it) {