Skip to content

Commit

Permalink
The default value of PatternType should be null instead of ST_Pattern…
Browse files Browse the repository at this point in the history
…Type.none

fix #186
  • Loading branch information
tonyqus committed May 30, 2021
1 parent 8d701db commit 13d5db0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions OpenXmlFormats/Spreadsheet/Styles/CT_PatternFill.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class CT_PatternFill

private CT_Color bgColorField = null;

private ST_PatternType patternTypeField = ST_PatternType.none;
private ST_PatternType? patternTypeField=null;

public bool IsSetPatternType()
{
Expand Down Expand Up @@ -67,7 +67,8 @@ public static CT_PatternFill Parse(XmlNode node, XmlNamespaceManager namespaceMa
internal void Write(StreamWriter sw, string nodeName)
{
sw.Write(string.Format("<{0}", nodeName));
XmlHelper.WriteAttribute(sw, "patternType", this.patternType.ToString());
if(patternType!=null)
XmlHelper.WriteAttribute(sw, "patternType", this.patternType.ToString());
if (this.fgColor == null && this.bgColor == null)
{
sw.Write("/>");
Expand Down Expand Up @@ -120,7 +121,7 @@ public CT_Color bgColor
}

[XmlAttribute]
public ST_PatternType patternType
public ST_PatternType? patternType
{
get
{
Expand Down

0 comments on commit 13d5db0

Please # to comment.