bdw429s opened a new pull request, #1234: URL: https://github.com/apache/poi/pull/1234
When a table column header contains a newline character (`\n`), `updateHeaders()` encodes it as `_x000a_` (the OOXML `_xXXXX_` escape convention) before storing in the column definition. However, `findColumnIndex()` did not perform the reverse encoding when looking up column names, causing lookups against multi-line column headers to always return `-1`. This fix adds `\n` → `_x000a_` and `\r` → `_x000d_` replacements to the `findColumnIndex()` string normalization chain, matching the encoding already applied by `updateHeaders()`. **Changes:** - `XSSFTable.java` — `findColumnIndex()` now replaces `\n` with `_x000a_` and `\r` with `_x000d_` before looking up the column name in the map - `TestXSSFTable.java` — Added `findColumnIndex` assertion to `testNamesWithNewLines()` and new `testFormulaWithNewlineColumnName()` test that verifies `SUM(Table1[Value\nA])` evaluates correctly with newline column names -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
