background = cellBackgroundProducer.getBackgroundAt(logicalPage, sheetLayout, col, row, true, sectionType);
}
if (background == null)
{
// An empty cell .. ignore
final PatchRtfCell cell = new PatchRtfCell();
cell.setBorderWidth(0);
cell.setMinimumHeight((float) StrictGeomUtility.toExternalValue(sheetLayout.getRowHeight(row)));
table.addCell(cell, row, col);
continue;
}
// A empty cell with a defined background ..
final PatchRtfCell cell = new PatchRtfCell();
cell.setBorderWidth(0);
cell.setMinimumHeight((float) StrictGeomUtility.toExternalValue(sheetLayout.getRowHeight(row)));
updateCellStyle(cell, background);
table.addCell(cell, row, col);
continue;
}
if (content.isCommited() == false)
{
throw new InvalidReportStateException("Uncommited content encountered");
}
final long contentOffset = contentProducer.getContentOffset(row, col);
final long colPos = sheetLayout.getXPosition(col);
final long rowPos = sheetLayout.getYPosition(row);
if (content.getX() != colPos || (content.getY() + contentOffset) != rowPos)
{
// A spanned cell ..
continue;
}
final int colSpan = sheetLayout.getColSpan(col, content.getX() + content.getWidth());
final int rowSpan = sheetLayout.getRowSpan(row, content.getY() + content.getHeight() + contentOffset);
final CellBackground realBackground = cellBackgroundProducer.getBackgroundForBox
(logicalPage, sheetLayout, col, row, colSpan, rowSpan, false, sectionType, content);
final PatchRtfCell cell = new PatchRtfCell();
cell.setRowspan(rowSpan);
cell.setColspan(colSpan);
cell.setBorderWidth(0);
cell.setMinimumHeight((float) StrictGeomUtility.toExternalValue(sheetLayout.getRowHeight(row)));
if (realBackground != null)
{
updateCellStyle(cell, realBackground);
}