aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/render/rtf
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2004-11-01 12:39:14 +0000
committerJeremias Maerki <jeremias@apache.org>2004-11-01 12:39:14 +0000
commitc00bdcc884f9a98d4d1d48e49ed528269badf70a (patch)
tree2d0516a4070e7fe5f1b3a0491ba4f1dad42cbe36 /src/java/org/apache/fop/render/rtf
parent204e15c6846fba6753a7c9f4e0a79df4c9c01973 (diff)
downloadxmlgraphics-fop-c00bdcc884f9a98d4d1d48e49ed528269badf70a.tar.gz
xmlgraphics-fop-c00bdcc884f9a98d4d1d48e49ed528269badf70a.zip
Avoid with certain NPEs.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198119 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/render/rtf')
-rw-r--r--src/java/org/apache/fop/render/rtf/TableAttributesConverter.java9
-rw-r--r--src/java/org/apache/fop/render/rtf/TextAttributesConverter.java7
-rw-r--r--src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableRow.java2
3 files changed, 10 insertions, 8 deletions
diff --git a/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java b/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java
index 8310f86bc..7ccc49ed5 100644
--- a/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java
+++ b/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java
@@ -119,10 +119,11 @@ public class TableAttributesConverter {
// Cell background color
ColorType color = fobj.getCommonBorderPaddingBackground().backgroundColor;
- if (color.getAlpha() != 0
- || color.getRed() != 0
- || color.getGreen() != 0
- || color.getBlue() != 0) {
+ if ((color != null)
+ && (color.getAlpha() != 0
+ || color.getRed() != 0
+ || color.getGreen() != 0
+ || color.getBlue() != 0)) {
attrib.set(ITableAttributes.CELL_COLOR_BACKGROUND, color);
}
diff --git a/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java b/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java
index 004281416..5df06ed1c 100644
--- a/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java
+++ b/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java
@@ -132,7 +132,7 @@ class TextAttributesConverter {
private static void attrFont(CommonFont font, FOPRtfAttributes rtfAttr) {
rtfAttr.set(RtfText.ATTR_FONT_FAMILY,
RtfFontManager.getInstance().getFontNumber(font.fontFamily));
- rtfAttr.set("fs", font.fontSize);
+ rtfAttr.set(RtfText.ATTR_FONT_SIZE, font.fontSize);
if (font.fontWeight.equals("bold") || font.fontWeight.equals("700")) {
rtfAttr.set("b", 1);
@@ -230,10 +230,11 @@ class TextAttributesConverter {
default here. Changing FOP's default to "white" causes problems in
PDF output, so we will look for the default here & change it to
"auto". */
- if ((fopValue.getRed() == 0)
+ if ((fopValue == null)
+ || ((fopValue.getRed() == 0)
&& (fopValue.getGreen() == 0)
&& (fopValue.getBlue() == 0)
- && (fopValue.getAlpha() == 0)) {
+ && (fopValue.getAlpha() == 0))) {
return;
} else {
rtfColor = convertFOPColorToRTF(fopValue);
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 14ee7c5af..681b07540 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
@@ -264,7 +264,7 @@ public class RtfTableRow extends RtfContainer implements ITableAttributes {
}
}
- if (parentTable.isHighestRow(id)) {
+ if ((parentTable != null) && (parentTable.isHighestRow(id))) {
if (!cell.getRtfAttributes().isSet(ITableAttributes.CELL_BORDER_BOTTOM)) {
cell.getRtfAttributes().set(ITableAttributes.CELL_BORDER_BOTTOM,
(String)attrib.getValue(ITableAttributes.ROW_BORDER_BOTTOM));