neaten a report's style XML file, and add the new description
This commit is contained in:
@@ -147,22 +147,22 @@ class StyleSheetList:
|
||||
xml_file.write('<?xml version="1.0" encoding="utf-8"?>\n')
|
||||
xml_file.write('<stylelist>\n')
|
||||
|
||||
for name in sorted(self.map.keys()): # enable diff of archived copies
|
||||
for name in sorted(self.map.keys()): # enable diff of archived ones
|
||||
if name == "default":
|
||||
continue
|
||||
sheet = self.map[name]
|
||||
xml_file.write(' <sheet name="%s">\n' % escxml(name))
|
||||
|
||||
for p_name in sheet.get_paragraph_style_names():
|
||||
for p_name in sorted(sheet.get_paragraph_style_names()):
|
||||
self.write_paragraph_style(xml_file, sheet, p_name)
|
||||
|
||||
for t_name in sheet.get_table_style_names():
|
||||
for t_name in sorted(sheet.get_table_style_names()):
|
||||
self.write_table_style(xml_file, sheet, t_name)
|
||||
|
||||
for c_name in sheet.get_cell_style_names():
|
||||
for c_name in sorted(sheet.get_cell_style_names()):
|
||||
self.write_cell_style(xml_file, sheet, c_name)
|
||||
|
||||
for g_name in sheet.get_draw_style_names():
|
||||
for g_name in sorted(sheet.get_draw_style_names()):
|
||||
self.write_graphics_style(xml_file, sheet, g_name)
|
||||
|
||||
xml_file.write(' </sheet>\n')
|
||||
@@ -253,6 +253,7 @@ class StyleSheetList:
|
||||
xml_file.write(
|
||||
' <style name="%s">\n' % escxml(g_name) +
|
||||
' <draw para="%s" ' % draw.get_paragraph_style() +
|
||||
'description="%s" ' % escxml(draw.get_description()) +
|
||||
'width="%.3f" ' % draw.get_line_width() +
|
||||
'style="%d" ' % draw.get_line_style() +
|
||||
'color="#%02x%02x%02x" ' % draw.get_color() +
|
||||
@@ -507,6 +508,8 @@ class SheetParser(handler.ContentHandler):
|
||||
self.c.set_padding(float(attrs['pad']))
|
||||
elif tag == "draw":
|
||||
self.g = GraphicsStyle()
|
||||
if 'description' in attrs:
|
||||
self.g.set_description(attrs['description'])
|
||||
self.g.set_paragraph_style(attrs['para'])
|
||||
self.g.set_line_width(float(attrs['width']))
|
||||
self.g.set_line_style(int(attrs['style']))
|
||||
|
Reference in New Issue
Block a user