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),
{ "font", IL_FONT },
{ "forcelocalfontswitch", IL_FORCE_LOCAL_FONT_SWITCH },
{ "forceltr", IL_FORCELTR },
{ "font", IL_FONT },
{ "forcelocalfontswitch", IL_FORCE_LOCAL_FONT_SWITCH },
{ "forceltr", IL_FORCELTR },
{ "forceplain", IL_FORCEPLAIN },
{ "freespacing", IL_FREESPACING },
{ "htmlattr", IL_HTMLATTR },
{ "forceplain", IL_FORCEPLAIN },
{ "freespacing", IL_FREESPACING },
{ "htmlattr", IL_HTMLATTR },
{ "lyxtype", IL_LYXTYPE },
{ "multipar", IL_MULTIPAR },
{ "needprotect", IL_NEEDPROTECT },
{ "lyxtype", IL_LYXTYPE },
{ "multipar", IL_MULTIPAR },
{ "needprotect", IL_NEEDPROTECT },
{ "parbreakisnewline", IL_PARBREAKISNEWLINE },
{ "passthru", IL_PASSTHRU },
{ "preamble", IL_PREAMBLE },
{ "parbreakisnewline", IL_PARBREAKISNEWLINE },
{ "passthru", IL_PASSTHRU },
{ "preamble", IL_PREAMBLE },
+ case IL_OBSOLETEDBY: {
+ docstring style;
+ lex >> style;
+ style = support::subst(style, '_', ' ');
+
+ // We don't want to apply the algorithm in DocumentClass::insetLayout()
+ // here. So we do it the long way.
+ TextClass::InsetLayouts::const_iterator it =
+ tclass.insetLayouts().find(style);
+ if (it != tclass.insetLayouts().end()) {
+ docstring const tmpname = name_;
+ this->operator=(it->second);
+ name_ = tmpname;
+ if (obsoleted_by().empty())
+ obsoleted_by_ = style;
+ } else {
+ LYXERR0("Cannot replace with unknown InsetLayout `"
+ << style << '\'');
+ }
+ break;
+ }
arg.rdelim = lex.getDocString();
arg.rdelim = support::subst(arg.rdelim,
from_ascii("<br/>"), from_ascii("\n"));
arg.rdelim = lex.getDocString();
arg.rdelim = support::subst(arg.rdelim,
from_ascii("<br/>"), from_ascii("\n"));
- Layout::LaTeXArgMap::const_iterator it = args().begin();
- for (; it != args().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 = args().begin();
- for (; it != args().end(); ++it) {
+ Layout::LaTeXArgMap const args = InsetLayout::args();
+ Layout::LaTeXArgMap::const_iterator it = args.begin();
+ for (; it != args.end(); ++it) {