Allow counter formatting strings in PrettyFormat. Patch from Daniel.
This commit is contained in:
Richard Kimberly Heck 2023-07-27 21:20:53 -04:00
parent 5b2b0d5c76
commit 96dfc081b7
3 changed files with 7 additions and 4 deletions

View File

@ -11,7 +11,7 @@
# This script will update a .layout file to current format
# The latest layout format is also defined in src/TextClass.cpp
currentFormat = 102
currentFormat = 103
# Incremented to format 4, 6 April 2007, lasgouttes
@ -345,6 +345,9 @@ currentFormat = 102
# AllowedInLayouts, EndAllowedInLayouts, AllowedOccurrences,
# AllowedOccurrencesPerItem
# Incremented to format 103, 27 July 2023 by rikiheck
# Allow e.g. \roman{section} in PrettyFormat
# Do not forget to document format change in Customization
# Manual (section "Declaring a new text class").
@ -592,7 +595,7 @@ def convert(lines, end_format):
i += 1
continue
if format == 101:
if 101 <= format <= 102:
# nothing to do.
i += 1
continue

View File

@ -611,7 +611,7 @@ docstring Counters::prettyCounter(docstring const & name,
docstring const value = theCounter(name, lang);
docstring const & format =
translateIfPossible(ctr.prettyFormat(), lang);
translateIfPossible(counterLabel(ctr.prettyFormat(), lang), lang);
if (format.empty())
return value;
return subst(format, from_ascii("##"), value);

View File

@ -59,7 +59,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 = 102; // spitz: add tags AllowedInInsets, AllowedInLayouts, AllowedOccurrences
int const LAYOUT_FORMAT = 103; // rkh: allow counter specs in PrettyFormat
// Layout format for the current lyx file format. Controls which format is