Bug 66518 - ExcelToHtmlConverte conversion to hexadecimal color format is wrong
Summary: ExcelToHtmlConverte conversion to hexadecimal color format is wrong
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 5.2.3-FINAL
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-08 02:11 UTC by 1107637961
Modified: 2023-03-11 08:00 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description 1107637961 2023-03-08 02:11:44 UTC
org.apache.poi.hssf.converter.AbstractExcelUtils.getColor(HSSFColor)

#0e3466 will be converted to #e3466

The part of code:
for (short s : color.getTriplet()) {
    if (s < 10) {
        stringBuilder.append('0');
    }
        stringBuilder.append(Integer.toHexString(s));
    }
}

And I think that:
's < 10' should be 's < 16'
Comment 1 PJ Fanning 2023-03-08 11:03:37 UTC
I changed this using r1908191
Comment 2 PJ Fanning 2023-03-08 11:05:44 UTC
There was a bug in my change -> applied r1908192
Comment 3 Dominik Stadler 2023-03-11 08:00:38 UTC
This is fixed based on previous comments.