]> git.lyx.org Git - features.git/commitdiff
Simplify reversion code (keeping the same output)
authorJosé Matos <jamatos@lyx.org>
Mon, 21 Sep 2020 13:36:52 +0000 (14:36 +0100)
committerJosé Matos <jamatos@lyx.org>
Mon, 21 Sep 2020 13:36:52 +0000 (14:36 +0100)
lib/lyx2lyx/lyx_2_4.py

index 9c724061f702dc2d9d4a3ff821ec90db0f65ca41..74f17cf11d54a5ed650b8f5ee1d925184d6e7543 100644 (file)
@@ -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)