[Fix] trml2pdf: set the Heading tag name
authorsbh (Open ERP) <sbh@tinyerp.com>
Fri, 2 Apr 2010 08:49:26 +0000 (14:19 +0530)
committersbh (Open ERP) <sbh@tinyerp.com>
Fri, 2 Apr 2010 08:49:26 +0000 (14:19 +0530)
bzr revid: sbh@tinyerp.com-20100402084926-vys4yshlxk5yx42z

bin/report/render/rml2pdf/trml2pdf.py

index 0574f56..fa1595e 100644 (file)
@@ -636,9 +636,9 @@ class _rml_flowable(object):
             styles = reportlab.lib.styles.getSampleStyleSheet()
             style = styles['Title']
             return platypus.Paragraph(self._textual(node), style, **(utils.attr_get(node, [], {'bulletText':'str'})))
-        elif re.match('^h([1-9]+[0-9]*)$', (node.text or '')):
+        elif re.match('^h([1-9]+[0-9]*)$', (node.tag or '')):
             styles = reportlab.lib.styles.getSampleStyleSheet()
-            style = styles['Heading'+str(node.get[1:])]
+            style = styles['Heading'+str(node.tag[1:])]
             return platypus.Paragraph(self._textual(node), style, **(utils.attr_get(node, [], {'bulletText':'str'})))
         elif node.tag=='image':
             if not node.get('file'):