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 },
{ "latexname", IL_LATEXNAME },
{ "latexparam", IL_LATEXPARAM },
{ "latextype", IL_LATEXTYPE },
{ "latexname", IL_LATEXNAME },
{ "latexparam", IL_LATEXPARAM },
{ "latextype", IL_LATEXTYPE },
{ "lyxtype", IL_LYXTYPE },
{ "multipar", IL_MULTIPAR },
{ "needprotect", IL_NEEDPROTECT },
{ "lyxtype", IL_LYXTYPE },
{ "multipar", IL_MULTIPAR },
{ "needprotect", IL_NEEDPROTECT },
{ "preamble", IL_PREAMBLE },
{ "refprefix", IL_REFPREFIX },
{ "requires", IL_REQUIRES },
{ "preamble", IL_PREAMBLE },
{ "refprefix", IL_REFPREFIX },
{ "requires", IL_REQUIRES },
+ case IL_LEFTDELIM:
+ lex >> leftdelim_;
+ leftdelim_ = support::subst(leftdelim_, from_ascii("<br/>"),
+ from_ascii("\n"));
+ break;
+ case IL_FORCE_LOCAL_FONT_SWITCH:
+ lex >> forcelocalfontswitch_;
+ break;
+ case IL_RIGHTDELIM:
+ lex >> rightdelim_;
+ rightdelim_ = support::subst(rightdelim_, from_ascii("<br/>"),
+ from_ascii("\n"));
+ break;
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 == "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);
-int InsetLayout::optArgs() 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
- int nr = 0;
- Layout::LaTeXArgMap::const_iterator it = latexargs_.begin();
- for (; it != latexargs_.end(); ++it) {
+ unsigned int nr = 0;
+ Layout::LaTeXArgMap const args = InsetLayout::args();
+ Layout::LaTeXArgMap::const_iterator it = args.begin();
+ for (; it != args.end(); ++it) {
- int nr = 0;
- Layout::LaTeXArgMap::const_iterator it = latexargs_.begin();
- for (; it != latexargs_.end(); ++it) {
+ unsigned int nr = 0;
+ Layout::LaTeXArgMap const args = InsetLayout::args();
+ Layout::LaTeXArgMap::const_iterator it = args.begin();
+ for (; it != args.end(); ++it) {