mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-29 05:01:49 +00:00
Improve hex2ratio.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36090 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
2d7bbab89f
commit
586b5685f5
@ -352,8 +352,11 @@ def revert_layout_command(document, name, LaTeXname, position):
|
||||
|
||||
|
||||
def hex2ratio(s):
|
||||
val = string.atoi(s, 16)
|
||||
if val != 0:
|
||||
val += 1
|
||||
return str(val / 256.0)
|
||||
try:
|
||||
val = int(s, 16)
|
||||
except:
|
||||
val = 0
|
||||
if val != 0:
|
||||
val += 1
|
||||
return str(val / 256.0)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user