From 1ed0ec974af7fd4fc7fc8e208e13455bd0c4a550 Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Mon, 31 Aug 2015 18:17:29 -0300 Subject: [PATCH] Arch: Fixed crash when loading old files --- src/Mod/Arch/ArchAxis.py | 65 +++++++++++++++++++++------------------- 1 file changed, 34 insertions(+), 31 deletions(-) diff --git a/src/Mod/Arch/ArchAxis.py b/src/Mod/Arch/ArchAxis.py index b8f9cf314..48f749edd 100644 --- a/src/Mod/Arch/ArchAxis.py +++ b/src/Mod/Arch/ArchAxis.py @@ -277,38 +277,41 @@ class _ViewProviderAxis: ('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