This commit is contained in:
Behdad Esfahbod 2014-06-05 17:58:15 -04:00
parent ced737e249
commit d65b587708

View File

@ -191,7 +191,7 @@ class Struct(BaseConverter):
# If there are attributes (probably index), then
# don't drop this even if it's NULL. It will mess
# up the array indices of the containing element.
xmlWriter.simpletag(name, attrs + [("empty", True)])
xmlWriter.simpletag(name, attrs + [("empty", 1)])
xmlWriter.newline()
else:
pass # NULL table, ignore
@ -199,9 +199,9 @@ class Struct(BaseConverter):
value.toXML(xmlWriter, font, attrs, name=name)
def xmlRead(self, attrs, content, font):
table = self.tableClass()
if attrs.get("empty"):
if "empty" in attrs and safeEval(attrs["empty"]):
return None
table = self.tableClass()
Format = attrs.get("Format")
if Format is not None:
table.Format = int(Format)