* @return the border setting
*/
public Border getBorder(CellBordersType type) {
Border tempBorder = null;
TableCellProperties properties = getTableCellPropertiesForRead();
if (properties != null) {
tempBorder = getNullableBorder(properties, type);
}
if (tempBorder != null)
return tempBorder;
boolean isDefault = isUseDefaultStyle;
// find in parent style definition
OdfStyleBase parentStyle = null;
if (!isDefault)
parentStyle = getParentStyle((OdfStyle) getCurrentUsedStyle());
while ((!isDefault) && (parentStyle != null)) {
TableCellProperties parentStyleSetting = TableCellProperties.getTableCellProperties(parentStyle);
tempBorder = getNullableBorder(parentStyleSetting, type);
;
if (tempBorder != null)
return tempBorder;
if (parentStyle instanceof OdfDefaultStyle)
isDefault = true;
else
parentStyle = getParentStyle((OdfStyle) parentStyle);
}
// find in default style definition
if (!isDefault) {
OdfDefaultStyle defaultStyle = getCellDefaultStyle();
TableCellProperties defaultStyleSetting = TableCellProperties.getTableCellProperties(defaultStyle);
tempBorder = getNullableBorder(defaultStyleSetting, type);
}
// use default
if (tempBorder == null) {
return Border.NONE;