Okapi merger does not recognise vanish=on/off set by Apache POI >= 5.x
Summary In the current versions of Apache POI (≥ 5.x), the vanish property is set to "on" or "off" when hiding table columns. This differs from earlier versions (≤ 4.1.2), where the same property was set to "true" or "false".
Okapi’s merger logic only recognises "true" and "false" as valid values for hidden content. As a result, tables or columns marked as hidden using newer versions of Apache POI are not correctly processed by Okapi steps like HideTablesInWordStep.
Technical Details
Apache POI 4.1.2:
vanish.setVal(value ? STOnOff.TRUE : STOnOff.FALSE); // yields "true"/"false"
Apache POI 5.2.5 and later:
vanish.setVal(value ? STOnOff1.ON : STOnOff1.OFF); // yields "on"/"off"
Okapi's merger logic expects "true"/"false":
Proposed Fix To restore compatibility with documents created using Apache POI 5.x, we extended the BooleanAttributeValue enum to support the new values:
enum BooleanAttributeValue {
FALSE_INTEGER("0"),
TRUE_INTEGER("1"),
FALSE_STRING("false"),
TRUE_STRING("true"),
// Added for Apache POI 5.x compatibility
ON_TRUE_STRING("on"),
OFF_FALSE_STRING("off");
}
A patch file is attached:add-on-off-attr-value-to-XMLEventHelpers.patch