mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 18:08:10 +00:00
Simplify reversion code (keeping the same output)
This commit is contained in:
parent
c4acb6c5b9
commit
4419f6e059
@ -3506,16 +3506,13 @@ def revert_totalheight(document):
|
|||||||
special = m.group(1)
|
special = m.group(1)
|
||||||
mspecial = special.split(',')
|
mspecial = special.split(',')
|
||||||
for spc in mspecial:
|
for spc in mspecial:
|
||||||
if spc[:7] == "height=":
|
if spc.startswith("height="):
|
||||||
oldheight = spc.split('=')[1]
|
oldheight = spc.split('=')[1]
|
||||||
ms = rxx.search(oldheight)
|
ms = rxx.search(oldheight)
|
||||||
if ms:
|
if ms:
|
||||||
oldval = ms.group(1)
|
|
||||||
oldunit = ms.group(2)
|
oldunit = ms.group(2)
|
||||||
if len(oldval) > 1 and oldval[1] == ".":
|
|
||||||
oldval = "0" + oldval
|
|
||||||
if oldunit in list(relative_heights.keys()):
|
if oldunit in list(relative_heights.keys()):
|
||||||
oldval = str(float(oldval) * 100)
|
oldval = str(float(ms.group(1)) * 100)
|
||||||
oldunit = relative_heights[oldunit]
|
oldunit = relative_heights[oldunit]
|
||||||
oldheight = oldval + oldunit
|
oldheight = oldval + oldunit
|
||||||
mspecial.remove(spc)
|
mspecial.remove(spc)
|
||||||
|
Loading…
Reference in New Issue
Block a user