]> git.lyx.org Git - lyx.git/commitdiff
StepMasterCounter --> StepParentCounter
authorRichard Kimberly Heck <rikiheck@lyx.org>
Mon, 2 Nov 2020 22:36:58 +0000 (17:36 -0500)
committerRichard Kimberly Heck <rikiheck@lyx.org>
Mon, 2 Nov 2020 22:36:58 +0000 (17:36 -0500)
lib/doc/Customization.lyx
lib/scripts/layout2layout.py
src/Buffer.cpp
src/Layout.cpp
src/Layout.h
src/TextClass.cpp

index 357845a342973db4af2e79c194d894a25572abda..8f2e6dc33004ba33d174862a60623f588484e0fd 100644 (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
index 5c6de883a41c0d77440a0e347144e618eb90a39e..29159b0e502ea1fd86f48d6f69fdc9458dc2548e 100644 (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
index 10a38f61c79716e59dfed20774cde0ad3ed7a2c4..a6afadf1090fbd81c25426946d6c61bdca95011f 100644 (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)
index ac8fd5847c1aafd2e18763a4f2521a0299b08650..ff123dc32ef74c84eb76b00956dfdec4b67026c3 100644 (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)
index 3ea50491f2465a217fb9c98b18ade4bb6df6630e..102bab6abab71310932534c73f565cd3498d6deb 100644 (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
index 04b339f13e47a0955d4cc0cc4c5e196285d011df..cd87cca2e4efd6d1b2ae052ba94ea5198c6a458f 100644 (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