X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLayout.cpp;h=bb312877667c50908779db6ebdca0d727aafd446;hb=52fee3556e63859f3ba52609e8f025a491767a81;hp=46035513c7bd163a28d15c6505941f48c2001d12;hpb=7bdc34a98700f487a923ea2b3546f476b9d5d98c;p=lyx.git diff --git a/src/Layout.cpp b/src/Layout.cpp index 46035513c7..bb31287766 100644 --- a/src/Layout.cpp +++ b/src/Layout.cpp @@ -105,6 +105,7 @@ enum LayoutTags { LT_RESETARGS, LT_RIGHTDELIM, LT_FORCELOCAL, + LT_TOGGLE_INDENT, LT_INTITLE // keep this last! }; @@ -148,6 +149,7 @@ Layout::Layout() spellcheck = true; forcelocal = 0; itemcommand_ = "item"; + toggle_indent = ITOGGLE_DOCUMENT_DEFAULT; } @@ -243,6 +245,7 @@ bool Layout::readIgnoreForcelocal(Lexer & lex, TextClass const & tclass) { "spellcheck", LT_SPELLCHECK }, { "textfont", LT_TEXTFONT }, { "toclevel", LT_TOCLEVEL }, + { "toggleindent", LT_TOGGLE_INDENT }, { "topsep", LT_TOPSEP } }; @@ -383,6 +386,19 @@ bool Layout::readIgnoreForcelocal(Lexer & lex, TextClass const & tclass) lex >> nextnoindent; break; + case LT_TOGGLE_INDENT: { + string tog; + lex >> tog; + tog = support::ascii_lowercase(tog); + if (tog == "always") + toggle_indent = ITOGGLE_ALWAYS; + else if (tog == "never") + toggle_indent = ITOGGLE_NEVER; + else + toggle_indent = ITOGGLE_DOCUMENT_DEFAULT; + break; + } + case LT_COMMANDDEPTH: lex >> commanddepth; break; @@ -775,6 +791,8 @@ void Layout::readLabelType(Lexer & lex) void Layout::readEndLabelType(Lexer & lex) { + // this should be const, but can't be because + // of PushPopHelper. static LexerKeyword endlabelTypeTags[] = { { "box", END_LABEL_BOX }, { "filled_box", END_LABEL_FILLED_BOX }, @@ -1505,14 +1523,11 @@ void Layout::makeDefaultCSS() const htmldefaultstyle_ += from_ascii(tmp); } -// tex2lyx does not see output_xhtml.cpp -#ifndef NO_LAYOUT_CSS // alignment string where = alignmentToCSS(align); if (!where.empty()) { htmldefaultstyle_ += from_ascii("text-align: " + where + ";\n"); } -#endif // wrap up what we have, if anything if (!htmldefaultstyle_.empty())