Skip to content

Commit

Permalink
Merge pull request #15 from marcinn/support/issue11
Browse files Browse the repository at this point in the history
Issue 11 fix w/test
  • Loading branch information
strichter committed Dec 10, 2013
2 parents 21e1e82 + 366232f commit c5e20e0
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -43,7 +43,7 @@ def alltests():

setup (
name='z3c.rml',
version='2.4.1.dev0',
version='2.4.1.dev1',
author="Stephan Richter and the Zope Community",
author_email="zope-dev@zope.org",
description="An alternative implementation of RML",
Expand Down
6 changes: 4 additions & 2 deletions src/z3c/rml/flowable.py
Expand Up @@ -683,9 +683,11 @@ class BlockTable(Flowable):
def process(self):
attrs = dict(self.getAttributeValues())
# Get the table style; create a new one, if none is found
self.style = attrs.pop('style', None)
if self.style is None:
style = attrs.pop('style', None)
if style is None:
self.style = reportlab.platypus.tables.TableStyle()
else:
self.style = copy.deepcopy(style)
hAlign = attrs.pop('alignment', None)
# Extract all table rows and cells
self.rows = []
Expand Down
Binary file not shown.
35 changes: 35 additions & 0 deletions src/z3c/rml/tests/input/tag-blockTableStyle-3.rml
@@ -0,0 +1,35 @@
<!DOCTYPE document SYSTEM "rml.dtd">
<document filename="tag-blockTableStyle-2.pdf">
<pageInfo pageSize="A4" />
<template showBoundary="0">
<pageTemplate id="main">
<frame id="first" x1="10mm" y1="15mm" width="190mm" height="272mm"/>
</pageTemplate>
</template>

<stylesheet>
<blockTableStyle id="my-table-style">
<blockFont name="Helvetica-Bold" size="6" start="0,0" stop="-1,-1"/>
</blockTableStyle>
</stylesheet>

<story>
<blockTable style="my-table-style" colWidths="50% 50%">
<tr>
<td>Item1</td>
<td align="right">$1.00</td>
</tr>
<tr>
<td>Item2</td>
<td align="right">$2.00</td>
</tr>
</blockTable>
<blockTable style="my-table-style" colWidths="50% 50%">
<tr>
<td>Item3</td>
<td align="right">$3.00</td>
</tr>
</blockTable>
</story>

</document>

0 comments on commit c5e20e0

Please sign in to comment.