diff options
author | Jeremias Maerki <jeremias@apache.org> | 2006-05-18 14:00:11 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2006-05-18 14:00:11 +0000 |
commit | f16ef429a49fa9ab4520e28d470d76c58967792b (patch) | |
tree | 17bc1934004f9ceb5d641d13514e109b924486fd /src | |
parent | eb1ad60936a14f46c93fd97e64fc62a8c3d9d4e2 (diff) | |
download | xmlgraphics-fop-f16ef429a49fa9ab4520e28d470d76c58967792b.tar.gz xmlgraphics-fop-f16ef429a49fa9ab4520e28d470d76c58967792b.zip |
Bugzilla #39607:
Bugfix for NPE in RTF library.
Submitted by: Julien Aymé <julien.ayme.at.gmail.com>
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@407553 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r-- | src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableRow.java | 50 |
1 files changed, 26 insertions, 24 deletions
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableRow.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableRow.java index 681ab9a82..25e14d3e9 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableRow.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableRow.java @@ -198,36 +198,38 @@ public class RtfTableRow extends RtfContainer implements ITableAttributes { // Adjust the cell's display attributes so the table's/row's borders // are drawn properly. - // get border attributes from table - if (index == 0) { - if (!rtfcell.getRtfAttributes().isSet(ITableAttributes.CELL_BORDER_LEFT)) { - rtfcell.getRtfAttributes().set(ITableAttributes.CELL_BORDER_LEFT, - (RtfAttributes) tableBorderAttributes.getValue( - ITableAttributes.CELL_BORDER_LEFT)); + if (tableBorderAttributes != null) { + // get border attributes from table + if (index == 0) { + String border = ITableAttributes.CELL_BORDER_LEFT; + if (!rtfcell.getRtfAttributes().isSet(border)) { + rtfcell.getRtfAttributes().set(border, + (RtfAttributes) tableBorderAttributes.getValue(border)); + } } - } - if (index == this.getChildCount() - 1) { - if (!rtfcell.getRtfAttributes().isSet(ITableAttributes.CELL_BORDER_RIGHT)) { - rtfcell.getRtfAttributes().set(ITableAttributes.CELL_BORDER_RIGHT, - (RtfAttributes) tableBorderAttributes.getValue( - ITableAttributes.CELL_BORDER_RIGHT)); + if (index == this.getChildCount() - 1) { + String border = ITableAttributes.CELL_BORDER_RIGHT; + if (!rtfcell.getRtfAttributes().isSet(border)) { + rtfcell.getRtfAttributes().set(border, + (RtfAttributes) tableBorderAttributes.getValue(border)); + } } - } - if (isFirstRow()) { - if (!rtfcell.getRtfAttributes().isSet(ITableAttributes.CELL_BORDER_TOP)) { - rtfcell.getRtfAttributes().set(ITableAttributes.CELL_BORDER_TOP, - (RtfAttributes) (RtfAttributes) tableBorderAttributes.getValue( - ITableAttributes.CELL_BORDER_TOP)); + if (isFirstRow()) { + String border = ITableAttributes.CELL_BORDER_TOP; + if (!rtfcell.getRtfAttributes().isSet(border)) { + rtfcell.getRtfAttributes().set(border, + (RtfAttributes) tableBorderAttributes.getValue(border)); + } } - } - if ((parentTable != null) && (parentTable.isHighestRow(id))) { - if (!rtfcell.getRtfAttributes().isSet(ITableAttributes.CELL_BORDER_BOTTOM)) { - rtfcell.getRtfAttributes().set(ITableAttributes.CELL_BORDER_BOTTOM, - (RtfAttributes) tableBorderAttributes.getValue( - ITableAttributes.CELL_BORDER_BOTTOM)); + if ((parentTable != null) && (parentTable.isHighestRow(id))) { + String border = ITableAttributes.CELL_BORDER_BOTTOM; + if (!rtfcell.getRtfAttributes().isSet(border)) { + rtfcell.getRtfAttributes().set(border, + (RtfAttributes) tableBorderAttributes.getValue(border)); + } } } |