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/08/02 17:22:14 UTC

svn commit: r1891962 - /poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java

Author: fanningpj
Date: Mon Aug  2 17:22:13 2021
New Revision: 1891962

URL: http://svn.apache.org/viewvc?rev=1891962&view=rev
Log:
[bug-65464] fix issue where shared formulas can be corrupted. Thanks to Nico Seegert

Modified:
    poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java

Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java?rev=1891962&r1=1891961&r2=1891962&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java Mon Aug  2 17:22:13 2021
@@ -4625,7 +4625,11 @@ public class XSSFSheet extends POIXMLDoc
                             if(nextCell != null && nextCell != cell && nextCell.getCellType() == CellType.FORMULA) {
                                 CTCellFormula nextF = nextCell.getCTCell().getF();
                                 nextF.setStringValue(nextCell.getCellFormula(evalWb));
-                                nextF.setT(STCellFormulaType.SHARED); //https://bz.apache.org/bugzilla/show_bug.cgi?id=65464
+                                //https://bz.apache.org/bugzilla/show_bug.cgi?id=65464
+                                nextF.setT(STCellFormulaType.SHARED);
+                                if (!nextF.isSetSi()) {
+                                    nextF.setSi(f.getSi());
+                                }
                                 CellRangeAddress nextRef = new CellRangeAddress(
                                         nextCell.getRowIndex(), ref.getLastRow(),
                                         nextCell.getColumnIndex(), ref.getLastColumn());



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org