diff options
author | PJ Fanning <fanningpj@apache.org> | 2021-12-21 14:41:50 +0000 |
---|---|---|
committer | PJ Fanning <fanningpj@apache.org> | 2021-12-21 14:41:50 +0000 |
commit | 134b7c1be5b834aec9c8d2a924c4f0c724568582 (patch) | |
tree | eaca1f3ca5b918e5c46a298c4843f0151a20c9e1 /poi-ooxml | |
parent | aeab91dce5bcc0556ec686fa417a550c2abda076 (diff) | |
download | poi-134b7c1be5b834aec9c8d2a924c4f0c724568582.tar.gz poi-134b7c1be5b834aec9c8d2a924c4f0c724568582.zip |
[bug-64732] add support for new line escaping when updating table names
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1896246 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-ooxml')
-rw-r--r-- | poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTable.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTable.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTable.java index 7cf2472ca4..e140a1ec96 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTable.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTable.java @@ -803,7 +803,10 @@ public class XSSFTable extends POIXMLDocumentPart implements Table { for (CTTableColumn col : ctTableColumns.getTableColumnList()) { XSSFCell cell = row.getCell(cellnum); if (cell != null) { - col.setName(formatter.formatCellValue(cell)); + String colName = formatter.formatCellValue(cell); + colName = colName.replace("\n", "_x000a_"); + colName = colName.replace("\r", "_x000d_"); + col.setName(colName); } cellnum++; } |