On Sat, Jan 29, 2011 at 03:56:57AM +0100, Enrico Forestieri wrote: > On Fri, Jan 28, 2011 at 11:48:52PM +0100, Jean-Marc Lasgouttes wrote: > > > Le 28 janv. 2011 à 22:55, Enrico Forestieri a écrit : > > >> I can do this for you, if you wish. > > > > > > Thanks Richard. Let's try to coordinate the change, then. > > > > This part of your patch can go in separately, actually. > > I have committed it. > > Richard, please, do whatever is needed to bump the layout format.
I tried to do it, but I am not sure which of the two attached patches is the right one. -- Enrico
Index: src/TextClass.cpp =================================================================== --- src/TextClass.cpp (revisione 37372) +++ src/TextClass.cpp (copia locale) @@ -60,7 +60,7 @@ namespace lyx { // development/updatelayouts.sh script, to update the format of // all of our layout files. // -int const LAYOUT_FORMAT = 31; +int const LAYOUT_FORMAT = 32; namespace { Index: lib/scripts/layout2layout.py =================================================================== --- lib/scripts/layout2layout.py (revisione 37372) +++ lib/scripts/layout2layout.py (copia locale) @@ -110,6 +110,9 @@ import os, re, string, sys # Incremented to format 31, 12 January 2011 by rgh # Introducted NoCounter tag. +# Incremented to format 32, 30 January 2011 by forenr +# Added Display tag for InsetLayout + # Do not forget to document format change in Customization # Manual (section "Declaring a new text class"). @@ -117,7 +120,7 @@ import os, re, string, sys # development/tools/updatelayouts.sh script to update all # layout files to the new format. -currentFormat = 31 +currentFormat = 32 def usage(prog_name): @@ -204,6 +207,7 @@ def convert(lines): re_InsetLayout = re.compile(r'^\s*InsetLayout\s+(?:Custom|CharStyle|Element):(\S+)\s*$') # with quotes re_QInsetLayout = re.compile(r'^\s*InsetLayout\s+"(?:Custom|CharStyle|Element):([^"]+)"\s*$') + re_Notes = re.compile(r'^\s*InsetLayout\s*Note:(.*)\s*$', re.IGNORECASE) # counters for sectioning styles (hardcoded in 1.3) counters = {"part" : "\\Roman{part}", @@ -291,7 +295,17 @@ def convert(lines): while i < len(lines) and not re_EndBabelPreamble.match(lines[i]): i += 1 continue - + + if format < 32: + match = re_Notes.match(lines[i]) + if match: + notetype = match.group(1).lower() + if notetype == "comment" or notetype == "greyedout": + i += 1 + lines.insert(i, "\tDisplay false") + i += 1 + continue + # Only new features if format == 29 or format == 30: i += 1
Index: src/TextClass.cpp =================================================================== --- src/TextClass.cpp (revisione 37372) +++ src/TextClass.cpp (copia locale) @@ -60,7 +60,7 @@ namespace lyx { // development/updatelayouts.sh script, to update the format of // all of our layout files. // -int const LAYOUT_FORMAT = 31; +int const LAYOUT_FORMAT = 32; namespace { Index: lib/scripts/layout2layout.py =================================================================== --- lib/scripts/layout2layout.py (revisione 37372) +++ lib/scripts/layout2layout.py (copia locale) @@ -110,6 +110,9 @@ import os, re, string, sys # Incremented to format 31, 12 January 2011 by rgh # Introducted NoCounter tag. +# Incremented to format 32, 30 January 2011 by forenr +# Added Display tag for InsetLayout + # Do not forget to document format change in Customization # Manual (section "Declaring a new text class"). @@ -117,7 +120,7 @@ import os, re, string, sys # development/tools/updatelayouts.sh script to update all # layout files to the new format. -currentFormat = 31 +currentFormat = 32 def usage(prog_name): @@ -291,9 +294,9 @@ def convert(lines): while i < len(lines) and not re_EndBabelPreamble.match(lines[i]): i += 1 continue - + # Only new features - if format == 29 or format == 30: + if format == 29 or format == 30 or format == 32: i += 1 continue Index: lib/layouts/stdinsets.inc =================================================================== --- lib/layouts/stdinsets.inc (revisione 37372) +++ lib/layouts/stdinsets.inc (copia locale) @@ -4,7 +4,7 @@ # # Detailled format description is available in the customization manual -Format 31 +Format 32 Provides stdinsets 1