From 85904c550da7503dfabb91fb71a2a4d49a1efd36 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Wed, 13 Oct 2010 15:54:39 +0000 Subject: [PATCH] Add ResetsFont tag to InsetLayout, toward fixing bug #5657. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35626 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/scripts/layout2layout.py | 10 +++++++++- src/TextClass.cpp | 2 +- src/insets/InsetLayout.cpp | 8 +++++++- src/insets/InsetLayout.h | 4 ++++ 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/lib/scripts/layout2layout.py b/lib/scripts/layout2layout.py index 02ce4e3713..89866d2b7e 100644 --- a/lib/scripts/layout2layout.py +++ b/lib/scripts/layout2layout.py @@ -104,6 +104,9 @@ import os, re, string, sys # Changed Custom:Style, CharStyle:Style, and Element:Style # uniformly to Flex:Style. +# Incremented to format 30, 13 August 2010 by rgh +# Introduced ResetsFont tag for InsetLayout. + # Do not forget to document format change in Customization # Manual (section "Declaring a new text class"). @@ -111,7 +114,7 @@ import os, re, string, sys # development/tools/updatelayouts.sh script to update all # layout files to the new format. -currentFormat = 29 +currentFormat = 30 def usage(prog_name): @@ -286,6 +289,11 @@ def convert(lines): i += 1 continue + # Only new features + if format == 29: + i += 1 + continue + if format == 28: match = re_InsetLayout.match(lines[i]) if match: diff --git a/src/TextClass.cpp b/src/TextClass.cpp index 3e74b801db..9cf75a7669 100644 --- a/src/TextClass.cpp +++ b/src/TextClass.cpp @@ -60,7 +60,7 @@ namespace lyx { // development/updatelayouts.sh script, to update the format of // all of our layout files. // -int const LAYOUT_FORMAT = 29; +int const LAYOUT_FORMAT = 30; namespace { diff --git a/src/insets/InsetLayout.cpp b/src/insets/InsetLayout.cpp index 5255c669d0..4408b9d0b3 100644 --- a/src/insets/InsetLayout.cpp +++ b/src/insets/InsetLayout.cpp @@ -38,7 +38,8 @@ InsetLayout::InsetLayout() : multipar_(true), custompars_(true), forceplain_(false), passthru_(false), parbreakisnewline_(false), freespacing_(false), keepempty_(false), forceltr_(false), - needprotect_(false), intoc_(false), spellcheck_(true) + needprotect_(false), intoc_(false), spellcheck_(true), + resetsfont_(true) { labelfont_.setColor(Color_error); } @@ -109,6 +110,7 @@ bool InsetLayout::read(Lexer & lex, TextClass const & tclass) IL_REQUIRES, IL_SPELLCHECK, IL_REFPREFIX, + IL_RESETSFONT, IL_END }; @@ -149,6 +151,7 @@ bool InsetLayout::read(Lexer & lex, TextClass const & tclass) { "preamble", IL_PREAMBLE }, { "refprefix", IL_REFPREFIX }, { "requires", IL_REQUIRES }, + { "resetsfont", IL_RESETSFONT }, { "spellcheck", IL_SPELLCHECK } }; @@ -339,6 +342,9 @@ bool InsetLayout::read(Lexer & lex, TextClass const & tclass) case IL_SPELLCHECK: lex >> spellcheck_; break; + case IL_RESETSFONT: + lex >> resetsfont_; + break; case IL_END: getout = true; break; diff --git a/src/insets/InsetLayout.h b/src/insets/InsetLayout.h index 82fbe75edc..502428beb0 100644 --- a/src/insets/InsetLayout.h +++ b/src/insets/InsetLayout.h @@ -142,6 +142,8 @@ public: bool isInToc() const { return intoc_; } /// bool spellcheck() const { return spellcheck_; } + /// + bool resetsFont() const { return resetsfont_; } private: /// void makeDefaultCSS() const; @@ -228,6 +230,8 @@ private: bool intoc_; /// check spelling of this inset? bool spellcheck_; + /// + bool resetsfont_; }; /// -- 2.39.2