Skip to content

Commit

Permalink
Upstream fix: fix CT_DataValidations.Write method.
Browse files Browse the repository at this point in the history
It was writing an empty dataValidations node if its dataValidation property was empty, which was breaking the resulting xlsx file
  • Loading branch information
Artem Koloskov committed Feb 9, 2024
1 parent 8e4b633 commit fefe574
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions OpenXmlFormats/Spreadsheet/Sheet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7133,6 +7133,8 @@ public static CT_DataValidations Parse(XmlNode node, XmlNamespaceManager namespa

internal void Write(StreamWriter sw, string nodeName)
{
if (this.countField == 0)
return;
sw.Write(string.Format("<{0}", nodeName));
XmlHelper.WriteAttribute(sw, "disablePrompts", this.disablePrompts);
XmlHelper.WriteAttribute(sw, "xWindow", this.xWindow);
Expand Down

0 comments on commit fefe574

Please sign in to comment.