use of org.loboevolution.html.dom.HTMLTableElement in project LoboEvolution by LoboEvolution.
the class TableCellRenderState method getPaddingInsets.
/**
* {@inheritDoc}
*/
@Override
public HtmlInsets getPaddingInsets() {
HtmlInsets insets = this.paddingInsets;
if (insets != INVALID_INSETS) {
return insets;
} else {
final HTMLTableElement tableElement = getTableElement();
if (tableElement == null) {
// Return without caching
return null;
}
String cellPaddingText = tableElement.getAttribute("cellpadding");
if (Strings.isNotBlank(cellPaddingText)) {
cellPaddingText = cellPaddingText.trim();
HTMLDocumentImpl doc = (HTMLDocumentImpl) tableElement.getOwnerDocument();
int cellPadding = HtmlValues.getPixelSize(cellPaddingText, this, doc.getDefaultView(), 0);
int cellPaddingType = HtmlInsets.TYPE_PIXELS;
if (cellPaddingText.endsWith("%")) {
cellPaddingType = HtmlInsets.TYPE_PERCENT;
}
insets = new HtmlInsets(cellPadding, cellPaddingType);
} else {
insets = super.getPaddingInsets();
}
}
this.paddingInsets = insets;
return insets;
}
Aggregations