1 Commits

Author SHA1 Message Date
Jacobo Aragunde Pérez
4fb34ebeae
Fix rules for table style application in XSLFTables. (#969)
* Fix rules for table style application in XSLFTables.

Table styles contain rules for first and last rows/columns, even and
odd rows/columns... When one of these rules is empty, we are supposed
to fall back to the "whole table" rules. The fallback must also be
applied for the format that's not explicitly specified in the specific
rules.

when the corresponding specific rule is missing some info.

Fallback must also be applied when the corresponding specific rule is
missing some info. A couple of examples from the reproducer/test file
included:

The included reproducer/test file contained a few problems related to
table style application:
* The second style for horizontal/vertical banding (band2H, band2V) was
  never applied.
* In the table with horizontal banding enabled, the style band1H did
  not set a font color, POI returned a null font color instead of the
  color from wholeTable.
* In the table with horizontal banding enabled, the style band2H did
  not set a background color, POI returned null instead of the color
  specified in wholeTable.

This patches fixes the behaviors mentioned above, making POI behavior
match the one from MS Office and LibreOffice.

* Replace uses of java.util.list.getFirst().
2025-12-16 18:03:45 +01:00