Skip to content

Commit

Permalink
Arch: Fixed crash when loading old files
Browse files Browse the repository at this point in the history
  • Loading branch information
yorikvanhavre committed Aug 31, 2015
1 parent 650f328 commit 1ed0ec9
Showing 1 changed file with 34 additions and 31 deletions.
65 changes: 34 additions & 31 deletions src/Mod/Arch/ArchAxis.py
Expand Up @@ -277,38 +277,41 @@ def onChanged(self, vobj, prop):
('X',10),('IX',9),('V',5),('IV',4),('I',1))
num = 0
for t in self.bubbletexts:
if vobj.NumberingStyle == "1,2,3":
if hasattr(vobj,"NumberingStyle"):
if vobj.NumberingStyle == "1,2,3":
t.string = str(num+1)
elif vobj.NumberingStyle == "01,02,03":
t.string = str(num+1).zfill(2)
elif vobj.NumberingStyle == "001,002,003":
t.string = str(num+1).zfill(3)
elif vobj.NumberingStyle == "A,B,C":
result = ""
base = num/26
if base:
result += chars[base].upper()
remainder = num % 26
result += chars[remainder].upper()
t.string = result
elif vobj.NumberingStyle == "a,b,c":
result = ""
base = num/26
if base:
result += chars[base]
remainder = num % 26
result += chars[remainder]
t.string = result
elif vobj.NumberingStyle == "I,II,III":
result = ""
num += 1
for numeral, integer in roman:
while num >= integer:
result += numeral
num -= integer
t.string = result
elif vobj.NumberingStyle == "L0,L1,L2":
t.string = "L"+str(num)
else:
t.string = str(num+1)
elif vobj.NumberingStyle == "01,02,03":
t.string = str(num+1).zfill(2)
elif vobj.NumberingStyle == "001,002,003":
t.string = str(num+1).zfill(3)
elif vobj.NumberingStyle == "A,B,C":
result = ""
base = num/26
if base:
result += chars[base].upper()
remainder = num % 26
result += chars[remainder].upper()
t.string = result
elif vobj.NumberingStyle == "a,b,c":
result = ""
base = num/26
if base:
result += chars[base]
remainder = num % 26
result += chars[remainder]
t.string = result
elif vobj.NumberingStyle == "I,II,III":
result = ""
num += 1
for numeral, integer in roman:
while num >= integer:
result += numeral
num -= integer
t.string = result
elif vobj.NumberingStyle == "L0,L1,L2":
t.string = "L"+str(num)
num += 1


Expand Down

0 comments on commit 1ed0ec9

Please sign in to comment.