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

View File

@ -11,7 +11,7 @@
# This script will update a .layout file to current format # This script will update a .layout file to current format
# The latest layout format is also defined in src/TextClass.cpp # The latest layout format is also defined in src/TextClass.cpp
currentFormat = 86 currentFormat = 87
# Incremented to format 4, 6 April 2007, lasgouttes # Incremented to format 4, 6 April 2007, lasgouttes
@ -296,6 +296,8 @@ currentFormat = 86
# Incremented to format 86, 20 October 2020 by tcuvelier # Incremented to format 86, 20 October 2020 by tcuvelier
# New tag DocBookSection. # New tag DocBookSection.
# Incremeted to format 87, 2 November 2020 by rkh
# Do not forget to document format change in Customization # Do not forget to document format change in Customization
# Manual (section "Declaring a new text class"). # Manual (section "Declaring a new text class").
@ -545,6 +547,13 @@ def convert(lines, end_format):
i += 1 i += 1
continue 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: if 82 <= format <= 85:
# nothing to do. # nothing to do.
i += 1 i += 1

View File

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

View File

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

View File

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

View File

@ -59,7 +59,7 @@ namespace lyx {
// You should also run the development/tools/updatelayouts.py script, // You should also run the development/tools/updatelayouts.py script,
// to update the format of all of our layout files. // 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 // Layout format for the current lyx file format. Controls which format is