commit fd1ee3b424786db6428bd9e39cad9a79071f9482
Author: Jean-Marc Lasgouttes <[email protected]>
Date: Fri Mar 25 19:22:57 2016 +0100
Rename Caption:LongTableNoNumber to Caption:Unnumbered
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.
diff --git a/development/FORMAT b/development/FORMAT
index 1d24d92..9384409 100644
--- a/development/FORMAT
+++ b/development/FORMAT
@@ -11,6 +11,10 @@ adjustments are made to tex2lyx and bugs are fixed in
lyx2lyx.
-----------------------
+2016-03-25 Jean-Marc Lasgouttes <[email protected]>
+ * Format incremented to 507
+ Convert caption subtype LongTableNoNumber to Unnumbered
+
2016-01-26 Guillaume Munch <[email protected]>
* Format incremented to 506
No new parameters.
diff --git a/lib/doc/EmbeddedObjects.lyx b/lib/doc/EmbeddedObjects.lyx
index ad7ed8b..63f8e17 100644
--- a/lib/doc/EmbeddedObjects.lyx
+++ b/lib/doc/EmbeddedObjects.lyx
@@ -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
diff --git a/lib/doc/attic/Changelog-EmbeddedObjects-LyX_22x.txt
b/lib/doc/attic/Changelog-EmbeddedObjects-LyX_22x.txt
index 722ed35..8e02ad7 100644
--- a/lib/doc/attic/Changelog-EmbeddedObjects-LyX_22x.txt
+++ b/lib/doc/attic/Changelog-EmbeddedObjects-LyX_22x.txt
@@ -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.
diff --git a/lib/lyx2lyx/LyX.py b/lib/lyx2lyx/LyX.py
index b2b5731..e7078f1 100644
--- a/lib/lyx2lyx/LyX.py
+++ b/lib/lyx2lyx/LyX.py
@@ -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))
]
####################################################################
diff --git a/lib/lyx2lyx/lyx_2_2.py b/lib/lyx2lyx/lyx_2_2.py
index a1f3005..04c32ce 100644
--- a/lib/lyx2lyx/lyx_2_2.py
+++ b/lib/lyx2lyx/lyx_2_2.py
@@ -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]],
diff --git a/lib/scripts/layout2layout.py b/lib/scripts/layout2layout.py
index a87c300..7de844b 100644
--- a/lib/scripts/layout2layout.py
+++ b/lib/scripts/layout2layout.py
@@ -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
diff --git a/src/Text3.cpp b/src/Text3.cpp
index fbcd9b7..15ffb28 100644
--- a/src/Text3.cpp
+++ b/src/Text3.cpp
@@ -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
diff --git a/src/TextClass.cpp b/src/TextClass.cpp
index c9655df..e1e4027 100644
--- a/src/TextClass.cpp
+++ b/src/TextClass.cpp
@@ -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 {
diff --git a/src/insets/InsetCaption.cpp b/src/insets/InsetCaption.cpp
index 21b834a..b69d1ba 100644
--- a/src/insets/InsetCaption.cpp
+++ b/src/insets/InsetCaption.cpp
@@ -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);
diff --git a/src/insets/InsetFloat.cpp b/src/insets/InsetFloat.cpp
index cfd4002..ae1bf63 100644
--- a/src/insets/InsetFloat.cpp
+++ b/src/insets/InsetFloat.cpp
@@ -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";
}
diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp
index 6d8f7d0..4f94c83 100644
--- a/src/insets/InsetTabular.cpp
+++ b/src/insets/InsetTabular.cpp
@@ -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");
}
diff --git a/src/tex2lyx/test/CJK.lyx.lyx b/src/tex2lyx/test/CJK.lyx.lyx
index 7bc5896..eaee089 100644
--- a/src/tex2lyx/test/CJK.lyx.lyx
+++ b/src/tex2lyx/test/CJK.lyx.lyx
@@ -1,5 +1,5 @@
#LyX file created by tex2lyx 2.2
-\lyxformat 506
+\lyxformat 507
\begin_document
\begin_header
\save_transient_properties true
diff --git a/src/tex2lyx/test/CJKutf8.lyx.lyx b/src/tex2lyx/test/CJKutf8.lyx.lyx
index 1b23ea1..d065946 100644
--- a/src/tex2lyx/test/CJKutf8.lyx.lyx
+++ b/src/tex2lyx/test/CJKutf8.lyx.lyx
@@ -1,5 +1,5 @@
#LyX file created by tex2lyx 2.2
-\lyxformat 506
+\lyxformat 507
\begin_document
\begin_header
\save_transient_properties true
diff --git a/src/tex2lyx/test/DummyDocument.lyx.lyx
b/src/tex2lyx/test/DummyDocument.lyx.lyx
index 8be454e..583c8e4 100644
--- a/src/tex2lyx/test/DummyDocument.lyx.lyx
+++ b/src/tex2lyx/test/DummyDocument.lyx.lyx
@@ -1,5 +1,5 @@
#LyX file created by tex2lyx 2.2
-\lyxformat 506
+\lyxformat 507
\begin_document
\begin_header
\save_transient_properties true
diff --git a/src/tex2lyx/test/Dummy~Document.lyx.lyx
b/src/tex2lyx/test/Dummy~Document.lyx.lyx
index db40c8b..5f1ac1f 100644
--- a/src/tex2lyx/test/Dummy~Document.lyx.lyx
+++ b/src/tex2lyx/test/Dummy~Document.lyx.lyx
@@ -1,5 +1,5 @@
#LyX file created by tex2lyx 2.2
-\lyxformat 506
+\lyxformat 507
\begin_document
\begin_header
\save_transient_properties true
diff --git a/src/tex2lyx/test/XeTeX-polyglossia.lyx.lyx
b/src/tex2lyx/test/XeTeX-polyglossia.lyx.lyx
index 1c34977..eb50ffe 100644
--- a/src/tex2lyx/test/XeTeX-polyglossia.lyx.lyx
+++ b/src/tex2lyx/test/XeTeX-polyglossia.lyx.lyx
@@ -1,5 +1,5 @@
#LyX file created by tex2lyx 2.2
-\lyxformat 506
+\lyxformat 507
\begin_document
\begin_header
\save_transient_properties true
diff --git a/src/tex2lyx/test/algo2e.lyx.lyx b/src/tex2lyx/test/algo2e.lyx.lyx
index 4615e90..7f1de8a 100644
--- a/src/tex2lyx/test/algo2e.lyx.lyx
+++ b/src/tex2lyx/test/algo2e.lyx.lyx
@@ -1,5 +1,5 @@
#LyX file created by tex2lyx 2.2
-\lyxformat 506
+\lyxformat 507
\begin_document
\begin_header
\save_transient_properties true
diff --git a/src/tex2lyx/test/box-color-size-space-align.lyx.lyx
b/src/tex2lyx/test/box-color-size-space-align.lyx.lyx
index 762f3bf..4a572e0 100644
--- a/src/tex2lyx/test/box-color-size-space-align.lyx.lyx
+++ b/src/tex2lyx/test/box-color-size-space-align.lyx.lyx
@@ -1,5 +1,5 @@
#LyX file created by tex2lyx 2.2
-\lyxformat 506
+\lyxformat 507
\begin_document
\begin_header
\save_transient_properties true
diff --git a/src/tex2lyx/test/test-insets-basic.lyx.lyx
b/src/tex2lyx/test/test-insets-basic.lyx.lyx
index dfd4042..369a479 100644
--- a/src/tex2lyx/test/test-insets-basic.lyx.lyx
+++ b/src/tex2lyx/test/test-insets-basic.lyx.lyx
@@ -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)
diff --git a/src/tex2lyx/test/test-insets.lyx.lyx
b/src/tex2lyx/test/test-insets.lyx.lyx
index 33e83f6..e22b2da 100644
--- a/src/tex2lyx/test/test-insets.lyx.lyx
+++ b/src/tex2lyx/test/test-insets.lyx.lyx
@@ -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)
diff --git a/src/tex2lyx/test/test-memoir.lyx.lyx
b/src/tex2lyx/test/test-memoir.lyx.lyx
index 41e382f..73bc66a 100644
--- a/src/tex2lyx/test/test-memoir.lyx.lyx
+++ b/src/tex2lyx/test/test-memoir.lyx.lyx
@@ -1,5 +1,5 @@
#LyX file created by tex2lyx 2.2
-\lyxformat 506
+\lyxformat 507
\begin_document
\begin_header
\save_transient_properties true
diff --git a/src/tex2lyx/test/test-modules.lyx.lyx
b/src/tex2lyx/test/test-modules.lyx.lyx
index a248d6a..3de6556 100644
--- a/src/tex2lyx/test/test-modules.lyx.lyx
+++ b/src/tex2lyx/test/test-modules.lyx.lyx
@@ -1,5 +1,5 @@
#LyX file created by tex2lyx 2.2
-\lyxformat 506
+\lyxformat 507
\begin_document
\begin_header
\save_transient_properties true
diff --git a/src/tex2lyx/test/test-refstyle-theorems.lyx.lyx
b/src/tex2lyx/test/test-refstyle-theorems.lyx.lyx
index a51c546..eeae6ff 100644
--- a/src/tex2lyx/test/test-refstyle-theorems.lyx.lyx
+++ b/src/tex2lyx/test/test-refstyle-theorems.lyx.lyx
@@ -1,5 +1,5 @@
#LyX file created by tex2lyx 2.2
-\lyxformat 506
+\lyxformat 507
\begin_document
\begin_header
\save_transient_properties true
diff --git a/src/tex2lyx/test/test-scr.lyx.lyx
b/src/tex2lyx/test/test-scr.lyx.lyx
index 8d0ebff..6e6688e 100644
--- a/src/tex2lyx/test/test-scr.lyx.lyx
+++ b/src/tex2lyx/test/test-scr.lyx.lyx
@@ -1,5 +1,5 @@
#LyX file created by tex2lyx 2.2
-\lyxformat 506
+\lyxformat 507
\begin_document
\begin_header
\save_transient_properties true
diff --git a/src/tex2lyx/test/test-structure.lyx.lyx
b/src/tex2lyx/test/test-structure.lyx.lyx
index f4bba82..db2763c 100644
--- a/src/tex2lyx/test/test-structure.lyx.lyx
+++ b/src/tex2lyx/test/test-structure.lyx.lyx
@@ -1,5 +1,5 @@
#LyX file created by tex2lyx 2.2
-\lyxformat 506
+\lyxformat 507
\begin_document
\begin_header
\save_transient_properties true
diff --git a/src/tex2lyx/test/test.lyx.lyx b/src/tex2lyx/test/test.lyx.lyx
index 407f802..dfc628c 100644
--- a/src/tex2lyx/test/test.lyx.lyx
+++ b/src/tex2lyx/test/test.lyx.lyx
@@ -1,5 +1,5 @@
#LyX file created by tex2lyx 2.2
-\lyxformat 506
+\lyxformat 507
\begin_document
\begin_header
\save_transient_properties true
diff --git a/src/tex2lyx/test/verbatim.lyx.lyx
b/src/tex2lyx/test/verbatim.lyx.lyx
index d552d16..6438247 100644
--- a/src/tex2lyx/test/verbatim.lyx.lyx
+++ b/src/tex2lyx/test/verbatim.lyx.lyx
@@ -1,5 +1,5 @@
#LyX file created by tex2lyx 2.2
-\lyxformat 506
+\lyxformat 507
\begin_document
\begin_header
\save_transient_properties true
diff --git a/src/version.h b/src/version.h
index 9a37739..a87b5bc 100644
--- a/src/version.h
+++ b/src/version.h
@@ -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