[LyX/master] lyx_2_0.pyx_ add convert_includeall method
Juergen Spitzmueller
spitz at lyx.org
Sun Mar 15 08:13:11 UTC 2020
commit 07e8e4352f07c5f4261ca200e141491e76f1a6dd
Author: Juergen Spitzmueller <spitz at lyx.org>
Date: Sun Mar 15 09:32:02 2020 +0100
lyx_2_0.pyx_ add convert_includeall method
It's better to have that param explicitly in the document.
---
lib/lyx2lyx/lyx_2_0.py | 16 +++++++++++++++-
1 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/lib/lyx2lyx/lyx_2_0.py b/lib/lyx2lyx/lyx_2_0.py
index 480971b..a70f399 100644
--- a/lib/lyx2lyx/lyx_2_0.py
+++ b/lib/lyx2lyx/lyx_2_0.py
@@ -971,6 +971,20 @@ def revert_includeonly(document):
document.header[i : j + 1] = []
+def convert_includeall(document):
+ " Add maintain_unincluded_children param "
+
+ i = 0
+ i = find_token(document.header, "\\maintain_unincluded_children", 0)
+ if i == -1:
+ i = find_token(document.header, "\\textclass", 0)
+ if i == -1:
+ document.warning("Malformed LyX document! Missing \\textclass header.")
+ return
+ document.header.insert(i, "\\maintain_unincluded_children false")
+ return
+
+
def revert_includeall(document):
" Remove maintain_unincluded_children param "
del_token(document.header, '\\maintain_unincluded_children', 0)
@@ -2489,7 +2503,7 @@ convert = [[346, []],
[373, [merge_gbrief]],
[374, []],
[375, []],
- [376, []],
+ [376, [convert_includeall]],
[377, []],
[378, []],
[379, [convert_math_output]],
More information about the lyx-cvs
mailing list