diff --git a/ChangeLog b/ChangeLog index e4444cb41..2cc7561af 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2007-12-27 Brian Matherly + * src/docgen/CairoDoc.py: Fix 0001431: Tried to run a statistics report: + 2007-12-27 Brian Matherly * src/plugins/DescendReport.py: * src/plugins/AncestorReport.py: diff --git a/src/docgen/CairoDoc.py b/src/docgen/CairoDoc.py index f42a82d3d..729a04b7d 100644 --- a/src/docgen/CairoDoc.py +++ b/src/docgen/CairoDoc.py @@ -1212,19 +1212,20 @@ class CairoDoc(BaseDoc.BaseDoc, BaseDoc.TextDoc, BaseDoc.DrawDoc): # ...the text separately paragraph_style_name = style.get_paragraph_style() - paragraph_style = style_sheet.get_paragraph_style(paragraph_style_name) - paragraph_style.set_alignment(BaseDoc.PARA_ALIGN_LEFT) - - # horizontal position of the text is not included in the style, - # we assume that it is the size of the shadow, or 0.2mm - if style.get_shadow(): - x_offset = style.get_shadow_space() - else: - x_offset = 0.2 + if paragraph_style_name: + paragraph_style = style_sheet.get_paragraph_style(paragraph_style_name) + paragraph_style.set_alignment(BaseDoc.PARA_ALIGN_LEFT) - new_text = GtkDocText(paragraph_style, 'center', text, - x + x_offset , y + h / 2, angle=0) - self._active_element.add_child(new_text) + # horizontal position of the text is not included in the style, + # we assume that it is the size of the shadow, or 0.2mm + if style.get_shadow(): + x_offset = style.get_shadow_space() + else: + x_offset = 0.2 + + new_text = GtkDocText(paragraph_style, 'center', text, + x + x_offset , y + h / 2, angle=0) + self._active_element.add_child(new_text) def draw_text(self, style_name, text, x, y): style_sheet = self.get_style_sheet()