aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPJ Fanning <fanningpj@apache.org>2023-03-08 11:03:19 +0000
committerPJ Fanning <fanningpj@apache.org>2023-03-08 11:03:19 +0000
commit9a181c1a2dc9a59da4ad9ad657cdea96f470420c (patch)
treec54dbea4b60815b261635f7a0cb0133867156ff7
parent2f2e61311aa96c425d13ab42b297bb0408c1cc9e (diff)
downloadpoi-9a181c1a2dc9a59da4ad9ad657cdea96f470420c.tar.gz
poi-9a181c1a2dc9a59da4ad9ad657cdea96f470420c.zip
[bug-66518] fix issue in AbstractExcelUtils.getColor(HSSFColor)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1908191 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--poi-scratchpad/src/main/java/org/apache/poi/hssf/converter/AbstractExcelUtils.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hssf/converter/AbstractExcelUtils.java b/poi-scratchpad/src/main/java/org/apache/poi/hssf/converter/AbstractExcelUtils.java
index a4f9b13e23..9d85fea971 100644
--- a/poi-scratchpad/src/main/java/org/apache/poi/hssf/converter/AbstractExcelUtils.java
+++ b/poi-scratchpad/src/main/java/org/apache/poi/hssf/converter/AbstractExcelUtils.java
@@ -113,13 +113,13 @@ class AbstractExcelUtils {
StringBuilder stringBuilder = new StringBuilder(7);
stringBuilder.append('#');
for (short s : color.getTriplet()) {
- if (s < 10) {
+ String hex = Integer.toHexString(s);
+ if (hex.length() == 1) {
stringBuilder.append('0');
}
-
- stringBuilder.append(Integer.toHexString(s));
+ stringBuilder.append(hex);
}
- String result = stringBuilder.toString();
+ String result = color.getHexString();
if (result.equals("#ffffff")) {
return "white";