]> git.lyx.org Git - features.git/commitdiff
Rename Caption:LongTableNoNumber to Caption:Unnumbered
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 25 Mar 2016 18:22:57 +0000 (19:22 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 30 Mar 2016 14:07:00 +0000 (16:07 +0200)
The term LongTable has been deprecated and moreover the renaming makes the interface easier to the eye.

File format updated to 507. (conversion based on jamatos patch)
Layout format updated to 60.
tex2ylx tests updated.
Document EmbeddedObjects.lyx has been updated.

28 files changed:
development/FORMAT
lib/doc/EmbeddedObjects.lyx
lib/doc/attic/Changelog-EmbeddedObjects-LyX_22x.txt
lib/lyx2lyx/LyX.py
lib/lyx2lyx/lyx_2_2.py
lib/scripts/layout2layout.py
src/Text3.cpp
src/TextClass.cpp
src/insets/InsetCaption.cpp
src/insets/InsetFloat.cpp
src/insets/InsetTabular.cpp
src/tex2lyx/test/CJK.lyx.lyx
src/tex2lyx/test/CJKutf8.lyx.lyx
src/tex2lyx/test/DummyDocument.lyx.lyx
src/tex2lyx/test/Dummy~Document.lyx.lyx
src/tex2lyx/test/XeTeX-polyglossia.lyx.lyx
src/tex2lyx/test/algo2e.lyx.lyx
src/tex2lyx/test/box-color-size-space-align.lyx.lyx
src/tex2lyx/test/test-insets-basic.lyx.lyx
src/tex2lyx/test/test-insets.lyx.lyx
src/tex2lyx/test/test-memoir.lyx.lyx
src/tex2lyx/test/test-modules.lyx.lyx
src/tex2lyx/test/test-refstyle-theorems.lyx.lyx
src/tex2lyx/test/test-scr.lyx.lyx
src/tex2lyx/test/test-structure.lyx.lyx
src/tex2lyx/test/test.lyx.lyx
src/tex2lyx/test/verbatim.lyx.lyx
src/version.h

index 1d24d9293715b1e3696dbe3aee6b0a43bcccb821..9384409b530a56a32166c7dc06c3148e81c89041 100644 (file)
@@ -11,6 +11,10 @@ adjustments are made to tex2lyx and bugs are fixed in lyx2lyx.
 
 -----------------------
 
+2016-03-25 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
+       * Format incremented to 507
+         Convert caption subtype LongTableNoNumber to Unnumbered
+
 2016-01-26 Guillaume Munch <gm@lyx.org>
        * Format incremented to 506
          No new parameters.
index ad7ed8b7934be397fde8ab40bac5104e82f79267..63f8e170c53fa5ee876f5602bb028f16ba6ad2a2 100644 (file)
@@ -1,5 +1,5 @@
 #LyX 2.2 created this file. For more info see http://www.lyx.org/
-\lyxformat 506
+\lyxformat 507
 \begin_document
 \begin_header
 \save_transient_properties true
@@ -7689,7 +7689,7 @@ Caption
 \begin_inset space ~
 \end_inset
 
-(LongTableNoNumber)
+(Unnumbered)
 \family default
 .
  Table
@@ -7842,7 +7842,7 @@ TEL.
 \begin_inset Text
 
 \begin_layout Plain Layout
-\begin_inset Caption LongTableNoNumber
+\begin_inset Caption Unnumbered
 
 \begin_layout Plain Layout
 Continued Example Phone List
@@ -10017,7 +10017,7 @@ TEL.
 \begin_inset Text
 
 \begin_layout Plain Layout
-\begin_inset Caption LongTableNoNumber
+\begin_inset Caption Unnumbered
 
 \begin_layout Plain Layout
 Continued Example Phone List
index 722ed35e3f79c3d3987d95b98dc55de91c240a9e..8e02ad7f2c21135a3f150adbd16e2eff279626db 100644 (file)
@@ -16,3 +16,6 @@ second step:
   entries)of longtable accordingly
   occurrences: sec. 2.2, 2.6, 2.7, 4.2
 - sec. 7.1: new template "vector graphics"
+
+second step (cont'd by lasgouttes)
+- sec. 2.6.3.3: caption type LongTableNoNumber has been renamed to Unumbered.
index b2b57313ce453670b32a90797bdf013d3bd3fffa..e7078f148c83c15b4bd5422ee8d57b5d1e998367 100644 (file)
@@ -86,7 +86,7 @@ format_relation = [("0_06",    [200], minor_versions("0.6" , 4)),
                    ("1_6", list(range(277,346)), minor_versions("1.6" , 10)),
                    ("2_0", list(range(346,414)), minor_versions("2.0" , 8)),
                    ("2_1", list(range(414,475)), minor_versions("2.1" , 0)),
-                   ("2_2", list(range(475,507)), minor_versions("2.2" , 0))
+                   ("2_2", list(range(475,508)), minor_versions("2.2" , 0))
                   ]
 
 ####################################################################
index a1f3005d7e1b9351a3e4a9aeecac27f39bb62f19..04c32ce7aa6d6d2b813445b5b5640a4de0c0e53c 100644 (file)
@@ -104,6 +104,36 @@ def revert_Argument_to_TeX_brace(document, line, endline, n, nmax, environment,
 ###
 ###############################################################################
 
+def convert_longtable_label_internal(document, forward):
+    """
+    Convert reference to "LongTableNoNumber" into "Unnumbered" if forward is True
+    else revert it.
+    """
+    old_reference = "\\begin_inset Caption LongTableNoNumber"
+    new_reference = "\\begin_inset Caption Unnumbered"
+
+    # if the purpose is to revert swap the strings roles
+    if not forward:
+        old_reference, new_reference = new_reference, old_reference
+
+    i = 0
+    while True:
+        i = find_token(document.body, old_reference, i)
+
+        if i == -1:
+            return
+
+        document.body[i] = new_reference
+
+
+def convert_longtable_label(document):
+    convert_longtable_label_internal(document, True)
+
+
+def revert_longtable_label(document):
+    convert_longtable_label_internal(document, False)
+
+
 def convert_separator(document):
     """
     Convert layout separators to separator insets and add (LaTeX) paragraph
@@ -2253,10 +2283,12 @@ convert = [
            [503, []],
            [504, [convert_save_props]],
            [505, []],
-           [506, [convert_info_tabular_feature]]
+           [506, [convert_info_tabular_feature]],
+           [507, [convert_longtable_label]]
           ]
 
 revert =  [
+           [506, [revert_longtable_label]],
            [505, [revert_info_tabular_feature]],
            [504, []],
            [503, [revert_save_props]],
index a87c300a8872af3725444f85e0da768d5364b9e0..7de844b87fb66ed41f5aaf216c5f0caa4165c08c 100644 (file)
@@ -198,6 +198,9 @@ import os, re, string, sys
 # New Layout tags "AddToToc", "IsTocCaption"
 # New Layout argument tag "IsTocCaption"
 
+# Incremented to format 60, 25 March 2016 by lasgouttes
+# Rename caption subtype LongTableNoNumber to Unnumbered
+
 # Do not forget to document format change in Customization
 # Manual (section "Declaring a new text class").
 
@@ -205,7 +208,7 @@ import os, re, string, sys
 # development/tools/updatelayouts.py script to update all
 # layout files to the new format.
 
-currentFormat = 59
+currentFormat = 60
 
 
 def usage(prog_name):
@@ -319,6 +322,7 @@ def convert(lines):
     re_TopEnvironment = re.compile(r'^(\s*)LabelType(\s+)Top_Environment\s*$', re.IGNORECASE)
     re_CenteredEnvironment = re.compile(r'^(\s*)LabelType(\s+)Centered_Top_Environment\s*$', re.IGNORECASE)
     re_ChapterStyle = re.compile(r'^\s*Style\s+Chapter\s*$', re.IGNORECASE)
+    re_InsetLayout_CaptionLTNN = re.compile(r'^(\s*InsetLayout\s+)(Caption:LongTableNonumber)', re.IGNORECASE)
 
 
     # counters for sectioning styles (hardcoded in 1.3)
@@ -430,6 +434,17 @@ def convert(lines):
                 i += 1
             continue
 
+        if format == 59:
+            match = re_InsetLayout_CaptionLTNN.match(lines[i])
+            if not match:
+                i += 1
+                continue
+            # '^(\s*InsetLayout\s+)(Caption:LongTableNonumber)'
+            lead  = match.group(1)
+            lines[i] = lead + "Caption:Unnumbered"
+            i += 1
+            continue
+
         if format == 58:
             # nothing to do.
             i += 1
index fbcd9b7206a2dd4f0c51810fcabce05af22dc925..15ffb2881f6b4cee7b6449363ec49e53b101618a 100644 (file)
@@ -2718,7 +2718,7 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
        case LFUN_CAPTION_INSERT: {
                code = CAPTION_CODE;
                string arg = cmd.getArg(0);
-               bool varia = arg != "LongTableNoNumber"
+               bool varia = arg != "Unnumbered"
                        && cur.inset().allowsCaptionVariation(arg);
                // not allowed in description items,
                // and in specific insets
index c9655df6dcde3c75d38cb9883c9fef8978a17ee0..e1e40272ea0651b71c21a9f657feead535c7cf56 100644 (file)
@@ -61,7 +61,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 = 59; //gm: OutlinerName, AddToToc, IsTocCaption
+int const LAYOUT_FORMAT = 60; //lasgouttes LongTableNoNumber => Unnumbered
 
 namespace {
 
index 21b834aac50031e0d38ebe67203adf1a12db28c3..b69d1ba71a31526b31251e74a6b3f14d55303f2d 100644 (file)
@@ -224,7 +224,7 @@ bool InsetCaption::getStatus(Cursor & cur, FuncRequest const & cmd,
                if (first_arg == "changetype") {
                        string const type = cmd.getArg(1);
                        status.setOnOff(type == type_);
-                       bool varia = type != "LongTableNoNumber";
+                       bool varia = type != "Unnumbered";
                        // check if the immediate parent inset allows caption variation
                        if (cur.depth() > 1) {
                                varia = cur[cur.depth() - 2].inset().allowsCaptionVariation(type);
index cfd40026777413c2b71a910e57297ef6cb1754ce..ae1bf63816325f575032fd1574dfa42f64c80cb2 100644 (file)
@@ -487,7 +487,7 @@ void InsetFloat::setNewLabel()
 
 bool InsetFloat::allowsCaptionVariation(std::string const & newtype) const
 {
-       return !params_.subfloat && newtype != "LongTableNoNumber";
+       return !params_.subfloat && newtype != "Unnumbered";
 }
 
 
index 6d8f7d0737138f45d5a1b6183e0290c2f96b66d9..4f94c8333fa09b3c2f48dc68aed1a90f59956f08 100644 (file)
@@ -3521,7 +3521,7 @@ bool InsetTabular::insetAllowed(InsetCode code) const
 bool InsetTabular::allowsCaptionVariation(std::string const & newtype) const
 {
        return tabular.is_long_tabular &&
-               (newtype == "Standard" || newtype == "LongTableNoNumber");
+               (newtype == "Standard" || newtype == "Unnumbered");
 }
 
 
index 7bc5896ff101e3686f11aaeb2c22f337be8c4aca..eaee0894f6ecc4bd4caeb8b11761506b21eca299 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.2
-\lyxformat 506
+\lyxformat 507
 \begin_document
 \begin_header
 \save_transient_properties true
index 1b23ea107a9b845021edc1d0243013a66008aaae..d065946b7b14386836475c4eceb5163cd56023c5 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.2
-\lyxformat 506
+\lyxformat 507
 \begin_document
 \begin_header
 \save_transient_properties true
index 8be454e868ea9ba4f3179de2dde995660f9f0e46..583c8e414a742ca75e7f31b4affed9fa5a6755d4 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.2
-\lyxformat 506
+\lyxformat 507
 \begin_document
 \begin_header
 \save_transient_properties true
index db40c8bd93d82179f4c9b6f2a84fbc33b4c47d93..5f1ac1f4df8d8ea282a31b16485d0743cf601061 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.2
-\lyxformat 506
+\lyxformat 507
 \begin_document
 \begin_header
 \save_transient_properties true
index 1c34977234243c100ecde1744e1452f91ab96149..eb50ffe2cf64cb4519f5774ecbe46e95a95a1933 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.2
-\lyxformat 506
+\lyxformat 507
 \begin_document
 \begin_header
 \save_transient_properties true
index 4615e903fffc929aa6b8e3c70dca5ecebfe60797..7f1de8a1c9cd76414ab80b71c0f0bee6a1716d67 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.2
-\lyxformat 506
+\lyxformat 507
 \begin_document
 \begin_header
 \save_transient_properties true
index 762f3bfceca7d4246f3efd932d0293c08a1c184a..4a572e0d7f08d9d40f0b805eeea8c39daebb8f83 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.2
-\lyxformat 506
+\lyxformat 507
 \begin_document
 \begin_header
 \save_transient_properties true
index dfd4042a271ca88e824e1c9d6bf637e0a0f9ce43..369a4798fcb281c28b9d0b910f3b9fcf82035163 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.2
-\lyxformat 506
+\lyxformat 507
 \begin_document
 \begin_header
 \save_transient_properties true
@@ -1539,7 +1539,7 @@ Second
 
 \begin_layout Standard
 
-\begin_inset Caption LongTableNoNumber
+\begin_inset Caption Unnumbered
 
 \begin_layout Plain Layout
 standard foot
@@ -1584,7 +1584,7 @@ bottom.
 
 \begin_layout Standard
 
-\begin_inset Caption LongTableNoNumber
+\begin_inset Caption Unnumbered
 
 \begin_layout Plain Layout
 (last foot)
index 33e83f665cfd3f2a9672ec8c3b98fc633c198105..e22b2da361756d60342e1492250c46c6d2d7bb2a 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.2
-\lyxformat 506
+\lyxformat 507
 \begin_document
 \begin_header
 \save_transient_properties true
@@ -1596,7 +1596,7 @@ Second
 
 \begin_layout Standard
 
-\begin_inset Caption LongTableNoNumber
+\begin_inset Caption Unnumbered
 
 \begin_layout Plain Layout
 standard foot
@@ -1641,7 +1641,7 @@ bottom.
 
 \begin_layout Standard
 
-\begin_inset Caption LongTableNoNumber
+\begin_inset Caption Unnumbered
 
 \begin_layout Plain Layout
 (last foot)
index 41e382f836ef9cddeee3d044202f993eb13c2ca2..73bc66a3df5597e21e82093c3b41d844059bc479 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.2
-\lyxformat 506
+\lyxformat 507
 \begin_document
 \begin_header
 \save_transient_properties true
index a248d6a166e7ce6e1dfc389afa4c747f3419f511..3de655608337301eb02198f48ed4f475511185ac 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.2
-\lyxformat 506
+\lyxformat 507
 \begin_document
 \begin_header
 \save_transient_properties true
index a51c5460e1a6ceb7d061c4edcfa9d1549bc10a79..eeae6ffba1a0cf2ea15e43a41a0324d65736d53d 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.2
-\lyxformat 506
+\lyxformat 507
 \begin_document
 \begin_header
 \save_transient_properties true
index 8d0ebffc0ce191befb7ab274fcca2f0dd90f2373..6e6688ef4f3170b0604f0cf54e2a73dd0f4c00de 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.2
-\lyxformat 506
+\lyxformat 507
 \begin_document
 \begin_header
 \save_transient_properties true
index f4bba823cf759c8f8756ba931ff0e3ad07ce05c9..db2763ca2b3375db3858533c4a2fccf8d8209146 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.2
-\lyxformat 506
+\lyxformat 507
 \begin_document
 \begin_header
 \save_transient_properties true
index 407f8023624b1522508b1c6b39f0a49d08397195..dfc628cfcf82b1e56955085383d3da14b38c7223 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.2
-\lyxformat 506
+\lyxformat 507
 \begin_document
 \begin_header
 \save_transient_properties true
index d552d1698eb84b72e6538ad8f669c971b75080d7..6438247dd827a74cdefadf92107416fd225b61d4 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.2
-\lyxformat 506
+\lyxformat 507
 \begin_document
 \begin_header
 \save_transient_properties true
index 9a377391d262cb2be038db544b6f0c8d543deccf..a87b5bcd448781474596ec450ead38cf5dce5c67 100644 (file)
@@ -32,8 +32,8 @@ extern char const * const lyx_version_info;
 
 // Do not remove the comment below, so we get merge conflict in
 // independent branches. Instead add your own.
-#define LYX_FORMAT_LYX 506 // guillaume munch: convert "inset-modify tabular"
-#define LYX_FORMAT_TEX2LYX 506
+#define LYX_FORMAT_LYX 507 // lasgouttes: rename LongTableNoNumber to Unnumbered
+#define LYX_FORMAT_TEX2LYX 507
 
 #if LYX_FORMAT_TEX2LYX != LYX_FORMAT_LYX
 #ifndef _MSC_VER