Skip to content

Rowspan processing is possibly buggy #259

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Demosteneus opened this issue Aug 3, 2020 · 2 comments
Closed

Rowspan processing is possibly buggy #259

Demosteneus opened this issue Aug 3, 2020 · 2 comments
Assignees
Labels

Comments

@Demosteneus
Copy link
Contributor

Hi,

I think the processing of rowspan (or in combination with colspan) might be buggy.
I have attached 3 data.xml:

data0.xml - prints correctly
Column 1 and 2 have rowspan over 3 rows. Then I have some colspans, which also works.

Problems start as soon as I need to rowspan a later column. For example column 9, rows 2 and 3.
data1.xml - here cell from row 3, column 6 prints a column later, so there are some cells overlapping. More exactly, the spanned cell from column 9 overlaps, row 3 column 8.

Finally, if I want to use rowspan on column 10 row 1 to row 3, this breaks completely, and no PDF is output, with error:
data2.xml

  <Error code='1'>[page 1] ...am Files\speedata-publisher\sw/lua/publisher\tabular.lua:1077: attempt to index local 'current' (a nil value)
stack traceback:
	...ram Files\speedata-publisher\sw/lua/publisher\spinit.lua:45: in function 'call'
	...ram Files\speedata-publisher\sw/lua/publisher\spinit.lua:376: in function 'main_loop'
	...ram Files\speedata-publisher\sw/lua/publisher\spinit.lua:387: in main chunk
	[C]: in function 'require'
	[\directlua]:1: in main chunk</Error>

Rowspan - buggy.zip

@pgundlach pgundlach self-assigned this Aug 3, 2020
@pgundlach pgundlach added the Bug label Aug 3, 2020
@pgundlach
Copy link
Member

A slightly shorter example that triggers the error:

<data>
	<tr>
		<td rowspan="2" colspan="1"> 1/1, 1/2 </td>
		<td rowspan="1" colspan="4"> 3/1, 4/1, 5/1, 6/1 </td>
		<td rowspan="1" colspan="3"> 7/1, 8/1, 9/1</td>
		<td rowspan="2" colspan="1">10/1, 10/2</td>
	</tr>
	<tr>
		<td rowspan="1" colspan="2">3/2, 4/2</td>
		<td rowspan="1" colspan="2">5/2, 6/2</td>
		<td rowspan="1" colspan="2">7/2, 8/2</td>
		<td>9/2</td>
	</tr>
</data>

and

<Layout
  xmlns:sd="urn:speedata:2009/publisher/functions/en"
  xmlns="urn:speedata.de:2009/publisher/en" >
  <Trace grid="yes" />
  <SetGrid nx="10" height="12pt" />

  <Pageformat height="4cm" width="15cm" />

  <Record element="data">
    <PlaceObject column="1">
      <Table stretch="max" >
        <Columns>
          <Loop select="9">
            <Column width="1*"/>
          </Loop>
        </Columns>
        <ForAll select="tr">
          <Tr break-below="yes">
            <ForAll select="td">
              <Td padding="2pt" rowspan="{ @rowspan }" colspan="{ @colspan }" border-right="0.5pt" border-bottom="0.5pt">
                <Paragraph>
                  <Value select="."/>
                </Paragraph>
              </Td>
            </ForAll>
          </Tr>
        </ForAll>
      </Table>
    </PlaceObject>
  </Record>
</Layout>

@pgundlach
Copy link
Member

Fixed in version 3.9.28, available for dl now. Thank you for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants