boxable icon indicating copy to clipboard operation
boxable copied to clipboard

Issue in the code

Open alexey-levande opened this issue 5 years ago • 1 comments

Hello everyone,

I'm solving an issue in my app for building tables in PDF and found strange code in the method DrawRow of the Table class. Please look on the code snippet:

	// if it is not header row or first row in the table then remove row's
		// top border
		if (row != header && row != rows.get(0)) {
			if (!isEndOfPage(row)) {
				row.removeTopBorders();
			}
		}

here is the row variable compared to header. I'm not so deep in java, but they have different types - row is Row<T> and header is List<Row>. Could you please double check that it is correct?

I assumed that this comparison can be removed at all - so top borders can be removed if this row is not first and it is not EndOfPage.

alexey-levande avatar Mar 07 '20 09:03 alexey-levande

@alexey-levande thanks for your input.

You are right! row != header is redundant and makes no sense but we need this part of the code beacause not only that we need to check if row is not first row, we need to check if current row is part of the header rows. That need to be changed and I mark this as a bug.

Frulenzo avatar Oct 06 '20 05:10 Frulenzo