From ffbb1ee03d62420a0e687c71e55ee3088aa2d659 Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Fri, 4 Jul 2008 09:58:21 +0000 Subject: [PATCH] Fix bug #45336 - Fix HSSFColor.getTripletHash() git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@673987 13f79535-47bb-0310-9956-ffa450edef68 --- src/documentation/content/xdocs/changes.xml | 1 + src/documentation/content/xdocs/status.xml | 1 + src/java/org/apache/poi/hssf/util/HSSFColor.java | 12 ++++++++---- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/documentation/content/xdocs/changes.xml b/src/documentation/content/xdocs/changes.xml index 104082dedd..f9f29be397 100644 --- a/src/documentation/content/xdocs/changes.xml +++ b/src/documentation/content/xdocs/changes.xml @@ -37,6 +37,7 @@ + 45336 - Fix HSSFColor.getTripletHash() 45334 - Fixed formula parser to handle dots in identifiers 45252 - Improvement for HWPF Range.replaceText() 45001 - Further fix for HWPF Range.delete() and unicode characters diff --git a/src/documentation/content/xdocs/status.xml b/src/documentation/content/xdocs/status.xml index 6a890e9934..d2c0907a8b 100644 --- a/src/documentation/content/xdocs/status.xml +++ b/src/documentation/content/xdocs/status.xml @@ -34,6 +34,7 @@ + 45336 - Fix HSSFColor.getTripletHash() 45334 - Fixed formula parser to handle dots in identifiers 45252 - Improvement for HWPF Range.replaceText() 45001 - Further fix for HWPF Range.delete() and unicode characters diff --git a/src/java/org/apache/poi/hssf/util/HSSFColor.java b/src/java/org/apache/poi/hssf/util/HSSFColor.java index 4ecc6545fd..289b01ef2b 100644 --- a/src/java/org/apache/poi/hssf/util/HSSFColor.java +++ b/src/java/org/apache/poi/hssf/util/HSSFColor.java @@ -152,8 +152,12 @@ public class HSSFColor { String hexString = color.getHexString(); if (result.containsKey(hexString)) { - throw new RuntimeException("Dup color hexString (" + hexString - + ") for color (" + color.getClass().getName() + ")"); + HSSFColor other = (HSSFColor)result.get(hexString); + throw new RuntimeException( + "Dup color hexString (" + hexString + + ") for color (" + color.getClass().getName() + ") - " + + " already taken by (" + other.getClass().getName() + ")" + ); } result.put(hexString, color); } @@ -1508,9 +1512,9 @@ public class HSSFColor { public final static short index = 0x19; public final static short[] triplet = { - 153, 51, 102 + 127, 0, 0 }; - public final static String hexString = "9999:3333:6666"; + public final static String hexString = "8000:0:0"; public short getIndex() { -- 2.39.5