poi
poi copied to clipboard
feat: Full color support in CellFormat expressions
This change adds full support for named and indexed color in cell format expressions by adding in the standard color palette to CellFormatPart, from where the formatting information is free to propagate down the stack.
For strict format compatibility, only the 8 basic named colors and 56 indexed colors should be allowed, but this change retains the assumed intended feature of the original code to also support the full set of colors specified in HSSFColor.HSSFColorPredefined. If this is undesirable, the dependency on HSSFColor should be dropped entirely.
This change is required in order to properly support named and indexed colors as part of cell format expressions in products using POI.
This submission is based on a change we were required to make in order to add color support to cell format expressions in Vaadin Spreadsheet; the functionality cannot be added to mainline until the corresponding change is in Apache POI mainline.
This pull request is submitted as a conversation opener; any implementation specifics are open to discussion. As it was, the implementation was completely lacking support for indexed color, and the color names in HSSFColorPredefined did not include some of the basic colors, such as magenta or cyan, and the color definitons for what existed were not compatible with expectations of formatting as presented in other products.
Thanks @thevaadinman - would you be in a position to extend the test coverage to better test the code in this PR?
Thanks @thevaadinman - would you be in a position to extend the test coverage to better test the code in this PR?
Yup, I'll get started on that on Monday.
@thevaadinman I'll leave this PR but at the moment, it cannot be merged due to the absence of test coverage.
@thevaadinman there is conflict in git. Could you rebase?
@thevaadinman there is conflict in git. Could you rebase?
Rebased. Looks good to my eye, but please look over the changes carefully yourself. (edit: turns out Visual Studio Code doesn't do a good job of highlighting these types of errors)
Seems I missed something after all.
I think I'm done fixing small stuff for now. Compilation and tests run fine on my end.
thanks - merged
Thank you!
One question from higher up: could you provide a guesstimate as to when this change would be available in a mainline release? Q4/2025 perhaps?
One question from higher up: could you provide a guesstimate as to when this change would be available in a mainline release? Q4/2025 perhaps?
no plans for a release at the moment and I won't provide a guess