if (otherRow != null) {
otherBody = otherGridUnit.getBody();
}
//get columns
TableColumn currentColumn = currentGridUnit.getColumn();
TableColumn otherColumn = null;
if (otherGridUnit != null) {
otherColumn = otherGridUnit.getColumn();
}
//TODO get column groups
//Get table
Table table = currentGridUnit.getTable();
//----------------------------------------------------------------------
//We're creating two arrays containing the applicable BorderInfos for
//each cell in question.
//0 = cell, 1 = row, 2 = row group (body), 3 = column,
//4 = col group (spanned column, see 6.7.3), 5 = table
BorderInfo[] current = new BorderInfo[6];
BorderInfo[] other = new BorderInfo[6];
//cell
current[0] = currentGridUnit.getOriginalBorderInfoForCell(side);
if (otherGridUnit != null) {
other[0] = otherGridUnit.getOriginalBorderInfoForCell(otherSide);
}
if ((currentRow != null)
&& (side == BEFORE
|| side == AFTER
|| (currentGridUnit.getFlag(GridUnit.IN_FIRST_COLUMN) && side == START)
|| (currentGridUnit.getFlag(GridUnit.IN_LAST_COLUMN) && side == END))) {
//row
current[1] = currentRow.getCommonBorderPaddingBackground().getBorderInfo(side);
}
if (otherRow != null) {
//row
other[1] = otherRow.getCommonBorderPaddingBackground().getBorderInfo(otherSide);
}
if (currentBody != null
&& ((side == BEFORE && currentGridUnit.getFlag(GridUnit.FIRST_IN_PART))
|| (side == AFTER && currentGridUnit.getFlag(GridUnit.LAST_IN_PART))
|| (currentGridUnit.getFlag(GridUnit.IN_FIRST_COLUMN) && side == START)
|| (currentGridUnit.getFlag(GridUnit.IN_LAST_COLUMN) && side == END))) {
//row group (=body, table-header or table-footer)
current[2] = currentBody.getCommonBorderPaddingBackground().getBorderInfo(side);
}
if (otherGridUnit != null
&& otherBody != null
&& ((otherSide == BEFORE && otherGridUnit.getFlag(GridUnit.FIRST_IN_PART))
|| (otherSide == AFTER && otherGridUnit.getFlag(GridUnit.LAST_IN_PART)))) {
//row group (=body, table-header or table-footer)
other[2] = otherBody.getCommonBorderPaddingBackground().getBorderInfo(otherSide);
}
if ((side == BEFORE && otherGridUnit == null)
|| (side == AFTER && otherGridUnit == null)
|| (side == START)
|| (side == END)) {
//column
current[3] = currentColumn.getCommonBorderPaddingBackground().getBorderInfo(side);
}
if (otherColumn != null) {
//column
other[3] = otherColumn.getCommonBorderPaddingBackground().getBorderInfo(otherSide);
}
//TODO current[4] and other[4] for column groups
if (otherGridUnit == null
&& ((side == BEFORE && (flags & VERTICAL_START_END_OF_TABLE) > 0)
|| (side == AFTER && (flags & VERTICAL_START_END_OF_TABLE) > 0)