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)
{ "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 },
{ "refprefix", IL_REFPREFIX },
{ "requires", IL_REQUIRES },
{ "parbreakisnewline", IL_PARBREAKISNEWLINE },
{ "passthru", IL_PASSTHRU },
{ "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 }
+ 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;
+ }
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();
+
+Layout::LaTeXArgMap InsetLayout::args() const
+{
+ Layout::LaTeXArgMap args = latexargs_;
+ if (!postcommandargs_.empty())
+ args.insert(postcommandargs_.begin(), postcommandargs_.end());
+ return args;
+}
+
+
- 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) {