[LyX/master] Simplify reversion code (keeping the same output)
José Matos
jamatos at lyx.org
Mon Sep 21 13:09:53 UTC 2020
commit 4419f6e0591bdaed0f6cebfd6b5d108363628f88
Author: José Matos <jamatos at lyx.org>
Date: Mon Sep 21 14:36:52 2020 +0100
Simplify reversion code (keeping the same output)
---
lib/lyx2lyx/lyx_2_4.py | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/lib/lyx2lyx/lyx_2_4.py b/lib/lyx2lyx/lyx_2_4.py
index 9c72406..74f17cf 100644
--- a/lib/lyx2lyx/lyx_2_4.py
+++ b/lib/lyx2lyx/lyx_2_4.py
@@ -3506,16 +3506,13 @@ def revert_totalheight(document):
special = m.group(1)
mspecial = special.split(',')
for spc in mspecial:
- if spc[:7] == "height=":
+ if spc.startswith("height="):
oldheight = spc.split('=')[1]
ms = rxx.search(oldheight)
if ms:
- oldval = ms.group(1)
oldunit = ms.group(2)
- if len(oldval) > 1 and oldval[1] == ".":
- oldval = "0" + oldval
if oldunit in list(relative_heights.keys()):
- oldval = str(float(oldval) * 100)
+ oldval = str(float(ms.group(1)) * 100)
oldunit = relative_heights[oldunit]
oldheight = oldval + oldunit
mspecial.remove(spc)
More information about the lyx-cvs
mailing list