X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLayout.cpp;h=db8c317764797306dd098b7e58958c7b05c9b9d9;hb=0c7bd9a57f2a308bb9659200eda3b7e45f8d5d3c;hp=748d867a36a8824cfd5b3a89ab9ffa91e2e592b9;hpb=4005a4d470acbecb1ed06c50f3680def6c4edf10;p=lyx.git diff --git a/src/Layout.cpp b/src/Layout.cpp index 748d867a36..db8c317764 100644 --- a/src/Layout.cpp +++ b/src/Layout.cpp @@ -75,6 +75,7 @@ enum LayoutTags { LT_NEED_PROTECT, LT_NEWLINE, LT_NEXTNOINDENT, + LT_PAR_GROUP, LT_PARINDENT, LT_PARSEP, LT_PARSKIP, @@ -107,12 +108,15 @@ enum LayoutTags { LT_RIGHTDELIM, LT_FORCELOCAL, LT_TOGGLE_INDENT, + LT_ADDTOTOC, + LT_ISTOCCAPTION, LT_INTITLE // keep this last! }; ///////////////////// Layout::Layout() + : add_to_toc_(false), is_toc_caption_(false) { unknown_ = false; margintype = MARGIN_STATIC; @@ -151,6 +155,7 @@ Layout::Layout() forcelocal = 0; itemcommand_ = "item"; toggle_indent = ITOGGLE_DOCUMENT_DEFAULT; + par_group_ = false; } @@ -178,6 +183,7 @@ bool Layout::readIgnoreForcelocal(Lexer & lex, TextClass const & tclass) { // This table is sorted alphabetically [asierra 30March96] LexerKeyword layoutTags[] = { + { "addtotoc", LT_ADDTOTOC }, { "align", LT_ALIGN }, { "alignpossible", LT_ALIGNPOSSIBLE }, { "argument", LT_ARGUMENT }, @@ -207,6 +213,7 @@ bool Layout::readIgnoreForcelocal(Lexer & lex, TextClass const & tclass) { "innertag", LT_INNERTAG }, { "inpreamble", LT_INPREAMBLE }, { "intitle", LT_INTITLE }, + { "istoccaption", LT_ISTOCCAPTION }, { "itemcommand", LT_ITEMCOMMAND }, { "itemsep", LT_ITEMSEP }, { "itemtag", LT_ITEMTAG }, @@ -231,6 +238,7 @@ bool Layout::readIgnoreForcelocal(Lexer & lex, TextClass const & tclass) { "newline", LT_NEWLINE }, { "nextnoindent", LT_NEXTNOINDENT }, { "obsoletedby", LT_OBSOLETEDBY }, + { "paragraphgroup", LT_PAR_GROUP }, { "parbreakisnewline", LT_PARBREAK_IS_NEWLINE }, { "parindent", LT_PARINDENT }, { "parsep", LT_PARSEP }, @@ -542,6 +550,10 @@ bool Layout::readIgnoreForcelocal(Lexer & lex, TextClass const & tclass) counter = trim(counter); break; + case LT_PAR_GROUP: + lex >> par_group_; + break; + case LT_FREE_SPACING: lex >> free_spacing; break; @@ -631,6 +643,16 @@ bool Layout::readIgnoreForcelocal(Lexer & lex, TextClass const & tclass) case LT_FORCELOCAL: lex >> forcelocal; break; + + case LT_ADDTOTOC: + lex >> toc_type_; + add_to_toc_ = !toc_type_.empty(); + break; + + case LT_ISTOCCAPTION: + lex >> is_toc_caption_; + break; + } } lex.popTable(); @@ -875,12 +897,15 @@ void Layout::readLatexType(Lexer & lex) return; case LATEX_PARAGRAPH: case LATEX_COMMAND: - case LATEX_ENVIRONMENT: case LATEX_ITEM_ENVIRONMENT: - case LATEX_BIB_ENVIRONMENT: case LATEX_LIST_ENVIRONMENT: latextype = static_cast(le); break; + case LATEX_ENVIRONMENT: + case LATEX_BIB_ENVIRONMENT: + latextype = static_cast(le); + par_group_ = true; + break; default: LYXERR0("Unhandled value " << le); break; @@ -941,6 +966,7 @@ void Layout::readArgument(Lexer & lex) bool finished = false; arg.font = inherit_font; arg.labelfont = inherit_font; + arg.is_toc_caption = false; string id; lex >> id; bool const itemarg = prefixIs(id, "item:"); @@ -1001,6 +1027,9 @@ void Layout::readArgument(Lexer & lex) } else if (tok == "passthruchars") { lex.next(); arg.pass_thru_chars = lex.getDocString(); + } else if (tok == "istoccaption") { + lex.next(); + arg.is_toc_caption = lex.getBool(); } else { lex.printError("Unknown tag"); error = true; @@ -1210,6 +1239,7 @@ void Layout::write(ostream & os) const os << "\tEndLabelType Static\n"; break; } + os << "\tParagraphGroup \"" << par_group_ << "\"\n"; if (!leftmargin.empty()) os << "\tLeftMargin \"" << to_utf8(leftmargin) << "\"\n"; if (!rightmargin.empty()) @@ -1254,8 +1284,6 @@ void Layout::write(ostream & os) const bool first = true; os << "\tAlignPossible"; if (alignpossible & LYX_ALIGN_BLOCK) { - if (!first) - os << ','; os << " Block"; first = false; }