Complex document compiles with 2.3.x but not with master
José Abílio Matos
jamatos at lyx.org
Fri Sep 18 00:22:01 UTC 2020
On Thursday, September 17, 2020 7:24:57 PM WEST Scott Kostyshak wrote:
> There is another issue that is related. Before your fix, when I exported
> the small example document to LyX 2.3.x, I got a lyx2lyx error. I no
> longer get that error with the small example document, but I do with the
> complex document. The following reproduces the error (if "lyx" is your
> master binary):
>
> git clone 'https://github.com/ahmed-rashed/ThesisTemplate' && cd
> ThesisTemplate && lyx -e lyx23x Thesis.lyx
The original document was created on current stable, lyx 2.3.
The problem occurs with the reversion.
The following patch solves the crash:
diff --git a/lib/lyx2lyx/lyx_2_4.py b/lib/lyx2lyx/lyx_2_4.py
index b36ad1ea49..d0edd2482d 100644
--- a/lib/lyx2lyx/lyx_2_4.py
+++ b/lib/lyx2lyx/lyx_2_4.py
@@ -3512,7 +3512,7 @@ def revert_totalheight(document):
if ms:
oldval = ms.group(1)
oldunit = ms.group(2)
- if oldval[1] == ".":
+ if len(oldval) > 1 and oldval[1] == ".":
oldval = "0" + oldval
if oldunit in list(relative_heights.keys()):
oldval = str(float(oldval) * 100)
The fix is simple and reasonable so I committed it.
FWIW there is no difference using only lyx2lyx back and forth is:
diff -u Thesis.23.lyx Thesis.lyx
-#LyX 2.4 created this file. For more info see https://www.lyx.org/
+#LyX 2.3 created this file. For more info see http://www.lyx.org/
\lyxformat 544
\begin_document
\begin_header
--
José Abílio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20200918/4afb5ac2/attachment.html>
More information about the lyx-devel
mailing list