diff options
author | William Victor Mote <vmote@apache.org> | 2003-09-16 14:50:16 +0000 |
---|---|---|
committer | William Victor Mote <vmote@apache.org> | 2003-09-16 14:50:16 +0000 |
commit | 1af5e562a64c85c0119dc9019619d5e89f0010ca (patch) | |
tree | 55539cbe3ce8585074d39cc66aef961b754f2630 /src/java | |
parent | 392e47d54622190b132b43085d7e7ac8a5293a9c (diff) | |
download | xmlgraphics-fop-1af5e562a64c85c0119dc9019619d5e89f0010ca.tar.gz xmlgraphics-fop-1af5e562a64c85c0119dc9019619d5e89f0010ca.zip |
make RtfColorTable.getColorNumber return an Integer instead of int, so that it can return a null value -- submitted by Peter Herweg, see http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23082
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196915 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java')
-rw-r--r-- | src/java/org/apache/fop/rtf/renderer/RTFHandler.java | 4 | ||||
-rwxr-xr-x | src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfColorTable.java | 26 |
2 files changed, 15 insertions, 15 deletions
diff --git a/src/java/org/apache/fop/rtf/renderer/RTFHandler.java b/src/java/org/apache/fop/rtf/renderer/RTFHandler.java index f602dc90f..54386ca90 100644 --- a/src/java/org/apache/fop/rtf/renderer/RTFHandler.java +++ b/src/java/org/apache/fop/rtf/renderer/RTFHandler.java @@ -452,7 +452,7 @@ public class RTFHandler extends FOInputHandler { white. */ if ((fopValue.getRed() == 0) && (fopValue.getGreen() == 0) && (fopValue.getBlue() == 0) && (fopValue.getAlpha() == 0)) { - rtfColor = RtfColorTable.getInstance().getColorNumber("white"); + rtfColor = RtfColorTable.getInstance().getColorNumber("white").intValue(); } else { rtfColor = convertFOPColorToRTF(fopValue); } @@ -472,7 +472,7 @@ public class RTFHandler extends FOInputHandler { int greenComponent = ColorType.convertChannelToInteger (fopColor.getGreen()); int blueComponent = ColorType.convertChannelToInteger (fopColor.getBlue()); return RtfColorTable.getInstance().getColorNumber(redComponent, - greenComponent, blueComponent); + greenComponent, blueComponent).intValue(); } } diff --git a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfColorTable.java b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfColorTable.java index ed5656a87..d8e64dce0 100755 --- a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfColorTable.java +++ b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfColorTable.java @@ -131,14 +131,14 @@ public class RtfColorTable { * Initialize the color table. */ private void init () { - addNamedColor("black", getColorNumber (0, 0, 0)); - addNamedColor("white", getColorNumber (255, 255, 255)); - addNamedColor("red", getColorNumber (255, 0, 0)); - addNamedColor("green", getColorNumber (0, 255, 0)); - addNamedColor("blue", getColorNumber (0, 0, 255)); - addNamedColor("cyan", getColorNumber (0, 255, 255)); - addNamedColor("magenta", getColorNumber (255, 0, 255)); - addNamedColor("yellow", getColorNumber (255, 255, 0)); + addNamedColor("black", getColorNumber (0, 0, 0).intValue()); + addNamedColor("white", getColorNumber (255, 255, 255).intValue()); + addNamedColor("red", getColorNumber (255, 0, 0).intValue()); + addNamedColor("green", getColorNumber (0, 255, 0).intValue()); + addNamedColor("blue", getColorNumber (0, 0, 255).intValue()); + addNamedColor("cyan", getColorNumber (0, 255, 255).intValue()); + addNamedColor("magenta", getColorNumber (255, 0, 255).intValue()); + addNamedColor("yellow", getColorNumber (255, 255, 0).intValue()); getColorNumber (0, 0, 128); getColorNumber (0, 128, 128); @@ -150,7 +150,7 @@ public class RtfColorTable { // Added by Normand Masse // Gray color added - addNamedColor("gray", getColorNumber(128, 128, 128)); + addNamedColor("gray", getColorNumber(128, 128, 128).intValue()); getColorNumber (192, 192, 192); } @@ -168,8 +168,8 @@ public class RtfColorTable { * @param name a named color * @return the RTF number of a named color, or null if name not found */ - public int getColorNumber (String name) { - return ((Integer)namedColors.get(name.toLowerCase())).intValue(); + public Integer getColorNumber (String name) { + return ((Integer)namedColors.get(name.toLowerCase())); } /** @@ -181,7 +181,7 @@ public class RtfColorTable { * * @return The number of the color in the table */ - public int getColorNumber (int red, int green, int blue) { + public Integer getColorNumber (int red, int green, int blue) { Integer identifier = new Integer (determineIdentifier (red, green, blue)); Object o = colorIndex.get (identifier); int retVal; @@ -194,7 +194,7 @@ public class RtfColorTable { retVal = ((Integer) o).intValue (); } - return retVal + 1; + return new Integer(retVal + 1); } /** |