You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by fa...@apache.org on 2021/12/21 14:41:50 UTC
svn commit: r1896246 - /poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTable.java
Author: fanningpj
Date: Tue Dec 21 14:41:50 2021
New Revision: 1896246
URL: http://svn.apache.org/viewvc?rev=1896246&view=rev
Log:
[bug-64732] add support for new line escaping when updating table names
Modified:
poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTable.java
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTable.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTable.java?rev=1896246&r1=1896245&r2=1896246&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTable.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTable.java Tue Dec 21 14:41:50 2021
@@ -803,7 +803,10 @@ public class XSSFTable extends POIXMLDoc
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++;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org