X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLayout.cpp;h=0a783d0aad1542fb5e2124be8c62521dd2716b3c;hb=12bd7352fd3981798ede56082afbcc07f1f21e3a;hp=ec23e57f1eadcbda44d8d2ac2533bc97601b017f;hpb=ffd175b99f4e7957c4be9eed04f5124a78f192d5;p=lyx.git diff --git a/src/Layout.cpp b/src/Layout.cpp index ec23e57f1e..0a783d0aad 100644 --- a/src/Layout.cpp +++ b/src/Layout.cpp @@ -40,6 +40,8 @@ enum LayoutTags { LT_ALIGN = 1, LT_ALIGNPOSSIBLE, LT_ARGUMENT, + LT_AUTONESTS, + LT_AUTONESTEDBY, LT_MARGIN, LT_BOTTOMSEP, LT_CATEGORY, @@ -191,6 +193,7 @@ bool Layout::readIgnoreForcelocal(Lexer & lex, TextClass const & tclass) { "align", LT_ALIGN }, { "alignpossible", LT_ALIGNPOSSIBLE }, { "argument", LT_ARGUMENT }, + { "autonests", LT_AUTONESTS }, { "babelpreamble", LT_BABELPREAMBLE }, { "bottomsep", LT_BOTTOMSEP }, { "category", LT_CATEGORY }, @@ -217,6 +220,7 @@ bool Layout::readIgnoreForcelocal(Lexer & lex, TextClass const & tclass) { "innertag", LT_INNERTAG }, { "inpreamble", LT_INPREAMBLE }, { "intitle", LT_INTITLE }, + { "isautonestedby", LT_AUTONESTEDBY }, { "istoccaption", LT_ISTOCCAPTION }, { "itemcommand", LT_ITEMCOMMAND }, { "itemsep", LT_ITEMSEP }, @@ -592,6 +596,30 @@ bool Layout::readIgnoreForcelocal(Lexer & lex, TextClass const & tclass) break; } + case LT_AUTONESTS: { + docstring const autonest = + subst(subst(subst(lex.getLongString(from_ascii("EndAutoNests")), + from_ascii("\n"), docstring()), + from_ascii(" "), docstring()), + from_ascii("\t"), docstring()); + vector const autonests = + getVectorFromString(autonest); + autonests_.insert(autonests.begin(), autonests.end()); + break; + } + + case LT_AUTONESTEDBY: { + docstring const autonest = + subst(subst(subst(lex.getLongString(from_ascii("EndIsAutoNestedBy")), + from_ascii("\n"), docstring()), + from_ascii(" "), docstring()), + from_ascii("\t"), docstring()); + vector const autonests = + getVectorFromString(autonest); + autonested_by_.insert(autonests.begin(), autonests.end()); + break; + } + case LT_REFPREFIX: { docstring arg; lex >> arg; @@ -1387,6 +1415,26 @@ void Layout::write(ostream & os) const } os << '\n'; } + if (!autonests_.empty()) { + os << "\tAutoNests\n\t"; + for (set::const_iterator it = autonests_.begin(); + it != autonests_.end(); ++it) { + if (it != autonests_.begin()) + os << ','; + os << to_utf8(*it); + } + os << "\n\tEndAutoNests\n"; + } + if (!autonested_by_.empty()) { + os << "\tIsAutoNestedBy\n\t"; + for (set::const_iterator it = autonested_by_.begin(); + it != autonested_by_.end(); ++it) { + if (it != autonested_by_.begin()) + os << ','; + os << to_utf8(*it); + } + os << "\n\tIsAutoNestedBy\n"; + } if (refprefix.empty()) os << "\tRefPrefix OFF\n"; else