Skip to content

Commit

Permalink
Merge branch 'release2.6.2' into trigger-release
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyqus committed Aug 31, 2023
2 parents f7e82ab + 3417e43 commit 5c149cd
Show file tree
Hide file tree
Showing 25 changed files with 1,163 additions and 95 deletions.
143 changes: 103 additions & 40 deletions OpenXmlFormats/Drawing/ShapeGeometry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ public enum ST_TextShapeType


[Serializable]
[DebuggerStepThrough]
//[DebuggerStepThrough]
[System.ComponentModel.DesignerCategory("code")]
[XmlType(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/main")]
[XmlRoot(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", IsNullable = true)]
Expand Down Expand Up @@ -772,33 +772,56 @@ public string fmla


[Serializable]
[System.Diagnostics.DebuggerStepThrough]
//[System.Diagnostics.DebuggerStepThrough]
[System.ComponentModel.DesignerCategory("code")]
[XmlType(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/main")]
[XmlRoot(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", IsNullable = true)]
public class CT_Path2DCubicBezierTo
{

private CT_AdjPoint2D[] ptField;
private List<CT_AdjPoint2D> pts = null;

public static CT_Path2DCubicBezierTo Parse(XmlNode node, XmlNamespaceManager namespaceManager)
{
CT_Path2DCubicBezierTo obj = new CT_Path2DCubicBezierTo();
foreach(XmlNode childNode in node.ChildNodes) {
if(childNode.LocalName == "pt") {
obj.pts.Add(CT_AdjPoint2D.Parse(childNode, namespaceManager));
}
}
return obj;
}

[XmlElement("pt", Order = 0)]
public CT_AdjPoint2D[] pt
internal void Write(StreamWriter sw, string nodeName) {

sw.Write("<a:{0}>", nodeName);
foreach(var cub in pts) {
cub.Write(sw, "pt");
}
sw.Write("</a:{0}>", nodeName);
}

public CT_Path2DCubicBezierTo() {
pts = new List<CT_AdjPoint2D>();
}

[XmlElement("pt", Order = 0)]
public List<CT_AdjPoint2D> pt
{
get
{
return this.ptField;
return this.pts;
}
set
{
this.ptField = value;
this.pts = value;
}
}
}


[Serializable]
[DebuggerStepThrough]
//[DebuggerStepThrough]
[System.ComponentModel.DesignerCategory("code")]
[XmlType(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/main")]
[XmlRoot(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", IsNullable = true)]
Expand Down Expand Up @@ -826,8 +849,8 @@ internal void Write(StreamWriter sw, string nodeName)
sw.Write(string.Format("<a:{0}", nodeName));
XmlHelper.WriteAttribute(sw, "x", this.x);
XmlHelper.WriteAttribute(sw, "y", this.y);
sw.Write(">");
sw.Write(string.Format("</a:{0}>", nodeName));
sw.Write("/>");

}

[XmlAttribute]
Expand Down Expand Up @@ -860,7 +883,7 @@ public string y


[Serializable]
[System.Diagnostics.DebuggerStepThrough]
//[System.Diagnostics.DebuggerStepThrough]
[System.ComponentModel.DesignerCategory("code")]
[XmlType(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/main")]
[XmlRoot(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", IsNullable = true)]
Expand All @@ -886,7 +909,7 @@ public CT_AdjPoint2D[] pt


[Serializable]
[System.Diagnostics.DebuggerStepThrough]
//[System.Diagnostics.DebuggerStepThrough]
[System.ComponentModel.DesignerCategory("code")]
[XmlType(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/main")]
[XmlRoot(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", IsNullable = true)]
Expand Down Expand Up @@ -948,7 +971,7 @@ internal void Write(StreamWriter sw, string nodeName)


[Serializable]
[System.Diagnostics.DebuggerStepThrough]
//[System.Diagnostics.DebuggerStepThrough]
[System.ComponentModel.DesignerCategory("code")]
[XmlType(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/main")]
[XmlRoot(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", IsNullable = true)]
Expand Down Expand Up @@ -1045,7 +1068,7 @@ public string b


[Serializable]
[System.Diagnostics.DebuggerStepThrough]
//[System.Diagnostics.DebuggerStepThrough]
[System.ComponentModel.DesignerCategory("code")]
[XmlType(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/main")]
[XmlRoot(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", IsNullable = true)]
Expand Down Expand Up @@ -1166,7 +1189,7 @@ public string maxY


[Serializable]
[System.Diagnostics.DebuggerStepThrough]
//[System.Diagnostics.DebuggerStepThrough]
[System.ComponentModel.DesignerCategory("code")]
[XmlType(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/main")]
[XmlRoot(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", IsNullable = true)]
Expand Down Expand Up @@ -1287,7 +1310,7 @@ public string maxAng


[Serializable]
[DebuggerStepThrough]
//[DebuggerStepThrough]
[System.ComponentModel.DesignerCategory("code")]
[XmlType(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/main")]
[XmlRoot(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", IsNullable = true)]
Expand Down Expand Up @@ -1353,7 +1376,7 @@ public string ang


[Serializable]
[System.Diagnostics.DebuggerStepThrough]
//[System.Diagnostics.DebuggerStepThrough]
[System.ComponentModel.DesignerCategory("code")]
[XmlType(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/main")]
[XmlRoot(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", IsNullable = true)]
Expand All @@ -1380,7 +1403,7 @@ public object[] Items


[Serializable]
[System.Diagnostics.DebuggerStepThrough]
//[System.Diagnostics.DebuggerStepThrough]
[System.ComponentModel.DesignerCategory("code")]
[XmlType(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/main")]
[XmlRoot(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", IsNullable = true)]
Expand Down Expand Up @@ -1433,7 +1456,7 @@ internal void Write(StreamWriter sw, string nodeName)


[Serializable]
[System.Diagnostics.DebuggerStepThrough]
//[System.Diagnostics.DebuggerStepThrough]
[System.ComponentModel.DesignerCategory("code")]
[XmlType(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/main")]
[XmlRoot(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", IsNullable = true)]
Expand Down Expand Up @@ -1494,19 +1517,41 @@ public uint idx


[Serializable]
[System.Diagnostics.DebuggerStepThrough]
//[System.Diagnostics.DebuggerStepThrough]
[System.ComponentModel.DesignerCategory("code")]
[XmlType(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/main")]
[XmlRoot(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", IsNullable = true)]
public class CT_Path2DMoveTo
{

private CT_AdjPoint2D ptField;
private CT_AdjPoint2D ptField = null;
public CT_Path2DMoveTo()
{
this.ptField = new CT_AdjPoint2D();
}
[XmlElement(Order = 0)]

public static CT_Path2DMoveTo Parse(XmlNode node, XmlNamespaceManager namespaceManager)
{
CT_Path2DMoveTo obj = new CT_Path2DMoveTo();
foreach(XmlNode childNode in node.ChildNodes) {
if(childNode.LocalName == "pt") {
obj.ptField = CT_AdjPoint2D.Parse(childNode, namespaceManager);
}
}
return obj;
}

internal void Write(StreamWriter sw, string nodeName) {

sw.Write("<a:{0}>", nodeName);

if(this.ptField != null) {
this.ptField.Write(sw, "pt");
}
sw.Write("</a:{0}>", nodeName);
}

[XmlElement(Order = 0)]
public CT_AdjPoint2D pt
{
get
Expand All @@ -1522,7 +1567,7 @@ public CT_AdjPoint2D pt


[Serializable]
[System.Diagnostics.DebuggerStepThrough]
//[System.Diagnostics.DebuggerStepThrough]
[System.ComponentModel.DesignerCategory("code")]
[XmlType(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/main")]
[XmlRoot(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", IsNullable = true)]
Expand Down Expand Up @@ -1552,7 +1597,7 @@ public CT_AdjPoint2D pt


[Serializable]
[System.Diagnostics.DebuggerStepThrough]
//[System.Diagnostics.DebuggerStepThrough]
[System.ComponentModel.DesignerCategory("code")]
[XmlType(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/main")]
[XmlRoot(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", IsNullable = true)]
Expand Down Expand Up @@ -1626,7 +1671,7 @@ public string swAng


[Serializable]
[System.Diagnostics.DebuggerStepThrough]
//[System.Diagnostics.DebuggerStepThrough]
[System.ComponentModel.DesignerCategory("code")]
[XmlType(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/main")]
[XmlRoot(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", IsNullable = true)]
Expand Down Expand Up @@ -1661,7 +1706,7 @@ public enum ST_PathFillMode


[Serializable]
[System.Diagnostics.DebuggerStepThrough]
//[System.Diagnostics.DebuggerStepThrough]
[System.ComponentModel.DesignerCategory("code")]
[XmlType(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/main")]
[XmlRoot(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", IsNullable = true)]
Expand All @@ -1681,7 +1726,12 @@ public class CT_Path2D
private bool strokeField;

private bool extrusionOkField;
public static CT_Path2D Parse(XmlNode node, XmlNamespaceManager namespaceManager)

private CT_Path2DMoveTo moveToFeild = null;

private List<CT_Path2DCubicBezierTo> cubicBezTo = null;

public static CT_Path2D Parse(XmlNode node, XmlNamespaceManager namespaceManager)
{
if (node == null)
return null;
Expand All @@ -1690,14 +1740,18 @@ public static CT_Path2D Parse(XmlNode node, XmlNamespaceManager namespaceManager
ctObj.h = XmlHelper.ReadLong(node.Attributes["h"]);
if (node.Attributes["fill"] != null)
ctObj.fill = (ST_PathFillMode)Enum.Parse(typeof(ST_PathFillMode), node.Attributes["fill"].Value);
ctObj.stroke = XmlHelper.ReadBool(node.Attributes["stroke"]);
ctObj.stroke = XmlHelper.ReadBool(node.Attributes["stroke"], true);
ctObj.extrusionOk = XmlHelper.ReadBool(node.Attributes["extrusionOk"]);
//foreach(XmlNode childNode in node.ChildNodes)
//{
foreach(XmlNode childNode in node.ChildNodes)
{
// if(childNode.LocalName == "ItemsElementName")
// ctObj.ItemsElementName = ItemsChoiceType[].Parse(childNode, namespaceManager);
//}
return ctObj;
if(childNode.LocalName == "moveTo")
ctObj.moveToFeild = CT_Path2DMoveTo.Parse(childNode, namespaceManager);
if(childNode.LocalName == "cubicBezTo")
ctObj.cubicBezTo.Add( CT_Path2DCubicBezierTo.Parse(childNode, namespaceManager));
}
return ctObj;
}


Expand All @@ -1711,9 +1765,16 @@ internal void Write(StreamWriter sw, string nodeName)
XmlHelper.WriteAttribute(sw, "stroke", this.stroke);
XmlHelper.WriteAttribute(sw, "extrusionOk", this.extrusionOk);
sw.Write(">");
//if (this.ItemsElementName != null)
// this.ItemsElementName.Write(sw, "ItemsElementName");
sw.Write(string.Format("</a:{0}>", nodeName));
//if (this.ItemsElementName != null)
// this.ItemsElementName.Write(sw, "ItemsElementName");
if(this.moveToFeild != null)
moveToFeild.Write(sw, "moveTo");
if(cubicBezTo.Count > 0) {
foreach(CT_Path2DCubicBezierTo cub in cubicBezTo) {
cub.Write(sw, "cubicBezTo");
}
}
sw.Write(string.Format("</a:{0}>", nodeName));
}

public CT_Path2D()
Expand All @@ -1723,7 +1784,9 @@ public CT_Path2D()
this.fillField = ST_PathFillMode.norm;
this.strokeField = true;
this.extrusionOkField = true;
}

this.cubicBezTo = new List<CT_Path2DCubicBezierTo>();
}


//[XmlElement("arcTo", typeof(CT_Path2DArcTo))]
Expand Down Expand Up @@ -1863,7 +1926,7 @@ public enum ItemsChoiceType


[Serializable]
[System.Diagnostics.DebuggerStepThrough]
//[System.Diagnostics.DebuggerStepThrough]
[System.ComponentModel.DesignerCategory("code")]
[XmlType(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/main")]
[XmlRoot(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", IsNullable = true)]
Expand Down Expand Up @@ -1917,7 +1980,7 @@ internal void Write(StreamWriter sw, string nodeName)


[Serializable]
[System.Diagnostics.DebuggerStepThrough]
//[System.Diagnostics.DebuggerStepThrough]
[System.ComponentModel.DesignerCategory("code")]
[XmlType(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/main")]
[XmlRoot(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", IsNullable = true)]
Expand Down Expand Up @@ -2000,7 +2063,7 @@ public ST_ShapeType prst


[Serializable]
[System.Diagnostics.DebuggerStepThrough]
//[System.Diagnostics.DebuggerStepThrough]
[System.ComponentModel.DesignerCategory("code")]
[XmlType(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/main")]
[XmlRoot(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", IsNullable = true)]
Expand Down Expand Up @@ -2074,7 +2137,7 @@ public ST_TextShapeType prst


[Serializable]
[System.Diagnostics.DebuggerStepThrough]
//[System.Diagnostics.DebuggerStepThrough]
[System.ComponentModel.DesignerCategory("code")]
[XmlType(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/main")]
[XmlRoot(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", IsNullable = true)]
Expand Down
12 changes: 6 additions & 6 deletions OpenXmlFormats/Drawing/SpreadsheetDrawing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1259,8 +1259,8 @@ public static CT_AnchorClientData Parse(XmlNode node, XmlNamespaceManager namesp
if (node == null)
return null;
CT_AnchorClientData ctObj = new CT_AnchorClientData();
ctObj.fLocksWithSheet = XmlHelper.ReadBool(node.Attributes["fLocksWithSheet"]);
ctObj.fPrintsWithSheet = XmlHelper.ReadBool(node.Attributes["fPrintsWithSheet"]);
ctObj.fLocksWithSheet = XmlHelper.ReadBool(node.Attributes["fLocksWithSheet"], true);
ctObj.fPrintsWithSheet = XmlHelper.ReadBool(node.Attributes["fPrintsWithSheet"], true);
return ctObj;
}

Expand All @@ -1269,12 +1269,12 @@ public static CT_AnchorClientData Parse(XmlNode node, XmlNamespaceManager namesp
internal void Write(StreamWriter sw, string nodeName)
{
sw.Write(string.Format("<xdr:{0}", nodeName));
XmlHelper.WriteAttribute(sw, "fLocksWithSheet", this.fLocksWithSheet, false);
XmlHelper.WriteAttribute(sw, "fPrintsWithSheet", this.fPrintsWithSheet,false);
XmlHelper.WriteAttribute(sw, "fLocksWithSheet", this.fLocksWithSheet, false, true);
XmlHelper.WriteAttribute(sw, "fPrintsWithSheet", this.fPrintsWithSheet, false, true);
sw.Write("/>");
}
bool _fLocksWithSheet;
bool _fPrintsWithSheet;
bool _fLocksWithSheet = true;
bool _fPrintsWithSheet = true;

[XmlAttribute]
public bool fLocksWithSheet
Expand Down
Loading

0 comments on commit 5c149cd

Please sign in to comment.