X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FTextClass.cpp;h=9f22d6d8a17a2823e5a7c6472c072e78a5da2d02;hb=4c11ba11fdfa84b4cb36b7ee20cfadb749baa19d;hp=8b54a4cded2d81794f545968eea8039bd9cca94a;hpb=50abaa0e570e154a3ea885d04bb013422614f021;p=lyx.git diff --git a/src/TextClass.cpp b/src/TextClass.cpp index 8b54a4cded..9f22d6d8a1 100644 --- a/src/TextClass.cpp +++ b/src/TextClass.cpp @@ -62,7 +62,7 @@ namespace lyx { // You should also run the development/tools/updatelayouts.py script, // to update the format of all of our layout files. // -int const LAYOUT_FORMAT = 78; // spitz: FontsizeFormat +int const LAYOUT_FORMAT = 80; // spitz: Requires for floats // Layout format for the current lyx file format. Controls which format is @@ -150,11 +150,11 @@ docstring const TextClass::plain_layout_ = from_ascii(N_("Plain Layout")); TextClass::TextClass() : loaded_(false), tex_class_avail_(false), opt_enginetype_("authoryear|numerical"), opt_fontsize_("10|11|12"), - opt_pagesize_("default|a4paper|a5paper|b5paper|letterpaper|legalpaper|executivepaper"), + opt_pagesize_("default|a4|a5|b5|letter|legal|executive"), opt_pagestyle_("empty|plain|headings|fancy"), fontsize_format_("$$spt"), pagesize_("default"), - pagestyle_("default"), tablestyle_("default"), columns_(1), sides_(OneSide), secnumdepth_(3), - tocdepth_(3), outputType_(LATEX), outputFormat_("latex"), - has_output_format_(false), defaultfont_(sane_font), + pagesize_format_("$$spaper"), pagestyle_("default"), tablestyle_("default"), + columns_(1), sides_(OneSide), secnumdepth_(3), tocdepth_(3), outputType_(LATEX), + outputFormat_("latex"), has_output_format_(false), defaultfont_(sane_font), titletype_(TITLE_COMMAND_AFTER), titlename_("maketitle"), min_toclevel_(0), max_toclevel_(0), maxcitenames_(2), cite_full_author_list_(true), bibintoc_(false) @@ -1006,6 +1006,7 @@ void TextClass::readClassOptions(Lexer & lexrc) CO_FONTSIZE = 1, CO_FONTSIZE_FORMAT, CO_PAGESIZE, + CO_PAGESIZE_FORMAT, CO_PAGESTYLE, CO_OTHER, CO_HEADER, @@ -1019,6 +1020,7 @@ void TextClass::readClassOptions(Lexer & lexrc) {"header", CO_HEADER }, {"other", CO_OTHER }, {"pagesize", CO_PAGESIZE }, + {"pagesizeformat", CO_PAGESIZE_FORMAT }, {"pagestyle", CO_PAGESTYLE } }; @@ -1046,6 +1048,10 @@ void TextClass::readClassOptions(Lexer & lexrc) lexrc.next(); opt_pagesize_ = rtrim(lexrc.getString()); break; + case CO_PAGESIZE_FORMAT: + lexrc.next(); + pagesize_format_ = rtrim(lexrc.getString()); + break; case CO_PAGESTYLE: lexrc.next(); opt_pagestyle_ = rtrim(lexrc.getString()); @@ -1386,7 +1392,8 @@ bool TextClass::readFloat(Lexer & lexrc) FT_REFPREFIX, FT_ALLOWED_PLACEMENT, FT_ALLOWS_SIDEWAYS, - FT_ALLOWS_WIDE, + FT_ALLOWS_WIDE, + FT_REQUIRES, FT_END }; @@ -1406,6 +1413,7 @@ bool TextClass::readFloat(Lexer & lexrc) { "numberwithin", FT_WITHIN }, { "placement", FT_PLACEMENT }, { "refprefix", FT_REFPREFIX }, + { "requires", FT_REQUIRES }, { "style", FT_STYLE }, { "type", FT_TYPE }, { "usesfloatpkg", FT_USESFLOAT } @@ -1426,6 +1434,7 @@ bool TextClass::readFloat(Lexer & lexrc) string style; string type; string within; + string requires; bool usesfloat = true; bool ispredefined = false; bool allowswide = true; @@ -1501,6 +1510,10 @@ bool TextClass::readFloat(Lexer & lexrc) lexrc.next(); usesfloat = lexrc.getBool(); break; + case FT_REQUIRES: + lexrc.next(); + requires = lexrc.getString(); + break; case FT_PREDEFINED: lexrc.next(); ispredefined = lexrc.getBool(); @@ -1554,8 +1567,8 @@ bool TextClass::readFloat(Lexer & lexrc) } Floating fl(type, placement, ext, within, style, name, listname, listcommand, refprefix, allowed_placement, - htmltag, htmlattr, htmlstyle, usesfloat, ispredefined, - allowswide, allowssideways); + htmltag, htmlattr, htmlstyle, requires, usesfloat, + ispredefined, allowswide, allowssideways); floatlist_.newFloat(fl); // each float has its own counter counters_.newCounter(from_ascii(type), from_ascii(within),