From b89af43930392dd68a176470a2a6bc90531011ca Mon Sep 17 00:00:00 2001 From: Artem Koloskov Date: Tue, 12 Mar 2024 15:27:58 +0700 Subject: [PATCH] upstream-fix: in `CT_CellFormula` ensure the `siField` is written into `fField`'s attributes on `Write` even when it has a default value for cases when the type of the formula is Shared formula. --- OpenXmlFormats/Spreadsheet/Sheet.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenXmlFormats/Spreadsheet/Sheet.cs b/OpenXmlFormats/Spreadsheet/Sheet.cs index e96aa1621..538ff99e1 100644 --- a/OpenXmlFormats/Spreadsheet/Sheet.cs +++ b/OpenXmlFormats/Spreadsheet/Sheet.cs @@ -2701,7 +2701,7 @@ internal void Write(StreamWriter sw, string nodeName) XmlHelper.WriteAttribute(sw, "r1", this.r1); XmlHelper.WriteAttribute(sw, "r2", this.r2); XmlHelper.WriteAttribute(sw, "ca", this.ca, false); - if(this.si!=0) + if(this.t == ST_CellFormulaType.shared || this.si!=0) XmlHelper.WriteAttribute(sw, "si", this.si, true); XmlHelper.WriteAttribute(sw, "bx", this.bx, false); if (!string.IsNullOrEmpty(this.valueField))