StepMasterCounter --> StepParentCounter

This commit is contained in:
Richard Kimberly Heck 2020-11-02 17:36:58 -05:00
parent fba1c434e5
commit 060c3de2f0
6 changed files with 66 additions and 18 deletions

View File

@ -1,5 +1,5 @@
#LyX 2.4 created this file. For more info see https://www.lyx.org/
\lyxformat 598
\lyxformat 599
\begin_document
\begin_header
\save_transient_properties true
@ -17239,7 +17239,13 @@ status collapsed
status collapsed
\begin_layout Plain Layout
StepMasterCounter
Step
\change_deleted 731793113 1604355211
Master
\change_inserted 731793113 1604355212
Parent
\change_unchanged
Counter
\end_layout
\end_inset
@ -17266,8 +17272,13 @@ status collapsed
\end_inset
] Steps the master counter of a given counter at the beginning of a new
sequence of layouts.
] Steps the
\change_deleted 731793113 1604355214
master
\change_inserted 731793113 1604355216
parent
\change_unchanged
counter of a given counter at the beginning of a new sequence of layouts.
This is currently only useful when
\begin_inset Flex Code
status collapsed
@ -21991,6 +22002,8 @@ textbf{Sourrounding text
\backslash
myinset{content}\SpecialChar ldots
}
\change_unchanged
\end_layout
\end_inset
@ -22021,6 +22034,8 @@ myinset{
\backslash
emph{content}}\SpecialChar ldots
}
\change_unchanged
\end_layout
\end_inset
@ -22035,6 +22050,8 @@ status collapsed
\backslash
emph
\change_unchanged
\end_layout
\end_inset
@ -22058,6 +22075,8 @@ status collapsed
\change_inserted -712698321 1597733292
0
\change_unchanged
\end_layout
\end_inset
@ -22505,12 +22524,24 @@ hebrew
\end_deeper
\begin_layout Standard
If LabelString is not defined, a default value is constructed as follows:
if the counter has a master counter
if the counter has a
\change_deleted 731793113 1604355218
master
\change_inserted 731793113 1604355221
parent
\change_unchanged
counter
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\change_deleted 731793113 1604355223
master
\change_inserted 731793113 1604355226
parent
\change_unchanged
\end_layout
\end_inset
@ -22536,7 +22567,13 @@ status collapsed
\begin_layout Plain Layout
\backslash
themaster.
the
\change_inserted 731793113 1604355228
parent
\change_deleted 731793113 1604355230
master
\change_unchanged
.
\backslash
arabic{counter}
\end_layout
@ -28440,6 +28477,8 @@ status collapsed
\change_inserted 1075283030 1598469476
para
\change_unchanged
\end_layout
\end_inset

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 = 86
currentFormat = 87
# Incremented to format 4, 6 April 2007, lasgouttes
@ -296,6 +296,8 @@ currentFormat = 86
# Incremented to format 86, 20 October 2020 by tcuvelier
# New tag DocBookSection.
# Incremeted to format 87, 2 November 2020 by rkh
# Do not forget to document format change in Customization
# Manual (section "Declaring a new text class").
@ -545,6 +547,13 @@ def convert(lines, end_format):
i += 1
continue
if format == 86:
if lines[i].lstrip().lower().startswith(b"stepmastercounter"):
pattern = re.compile(b"stepmastercounter", re.IGNORECASE)
lines[i] = pattern.sub(b"StepParentCounter", lines[i])
i += 1
continue
if 82 <= format <= 85:
# nothing to do.
i += 1

View File

@ -5153,8 +5153,8 @@ void Buffer::Impl::setLabel(ParIterator & it, UpdateType utype) const
}
if (needEnumCounterReset(it)) {
// Increase the master counter?
if (layout.stepmastercounter)
// Increase the parent counter?
if (layout.stepparentcounter)
counters.stepParent(enumcounter, utype);
// Maybe we have to reset the enumeration counter.
if (!layout.resumecounter)

View File

@ -138,7 +138,7 @@ enum LayoutTags {
LT_REFPREFIX,
LT_RESETARGS,
LT_RESUMECOUNTER,
LT_STEPMASTERCOUNTER,
LT_STEPPARENTCOUNTER,
LT_RIGHTDELIM,
LT_FORCELOCAL,
LT_TOGGLE_INDENT,
@ -156,7 +156,7 @@ Layout::Layout()
margintype = MARGIN_STATIC;
latextype = LATEX_PARAGRAPH;
resumecounter = false;
stepmastercounter = false;
stepparentcounter = false;
intitle = false;
inpreamble = false;
needprotect = false;
@ -327,7 +327,7 @@ bool Layout::readIgnoreForcelocal(Lexer & lex, TextClass const & tclass,
{ "rightmargin", LT_RIGHTMARGIN },
{ "spacing", LT_SPACING },
{ "spellcheck", LT_SPELLCHECK },
{ "stepmastercounter", LT_STEPMASTERCOUNTER },
{ "stepparentcounter", LT_STEPPARENTCOUNTER },
{ "textfont", LT_TEXTFONT },
{ "toclevel", LT_TOCLEVEL },
{ "toggleindent", LT_TOGGLE_INDENT },
@ -447,8 +447,8 @@ bool Layout::readIgnoreForcelocal(Lexer & lex, TextClass const & tclass,
lex >> resumecounter;
break;
case LT_STEPMASTERCOUNTER:
lex >> stepmastercounter;
case LT_STEPPARENTCOUNTER:
lex >> stepparentcounter;
break;
case LT_ARGUMENT:
@ -1400,7 +1400,7 @@ void Layout::write(ostream & os) const
"\tInPreamble " << inpreamble << "\n"
"\tTocLevel " << toclevel << "\n"
"\tResumeCounter " << resumecounter << "\n"
"\tStepMasterCounter " << stepmastercounter << '\n';
"\tStepParentCounter " << stepparentcounter << '\n';
// ResetArgs does not make sense here
for (LaTeXArgMap::const_iterator it = latexargs_.begin();
it != latexargs_.end(); ++it)

View File

@ -392,8 +392,8 @@ public:
docstring counter;
/// Resume counter?
bool resumecounter;
/// Step master counter?
bool stepmastercounter;
/// Step parent counter?
bool stepparentcounter;
/// Prefix to use when creating labels
docstring refprefix;
/// Depth of XML command

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 = 86; // tcuvelier: DocBookSection.
int const LAYOUT_FORMAT = 87; // rkh: master --> parent for counters
// Layout format for the current lyx file format. Controls which format is