Skip to content

Commit

Permalink
Merge pull request #108 from agileforge/WordProcessingFieldsIssue
Browse files Browse the repository at this point in the history
Word processing fields issue
  • Loading branch information
tonyqus authored Sep 7, 2017
2 parents d307fc8 + ca667de commit 815dc3a
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 46 deletions.
32 changes: 16 additions & 16 deletions ooxml/OpenXmlFormats/Wordprocessing/FormField.cs
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ internal static CT_FFData Parse(XmlNode node, XmlNamespaceManager namespaceManag
//}
else if (childNode.LocalName == "enabled")
{
ctObj.AddNewObject(CT_OnOff.Parse(childNode, namespaceManager), FFDataItemsType.name);
ctObj.AddNewObject(CT_OnOff.Parse(childNode, namespaceManager), FFDataItemsType.enabled);
}
else if (childNode.LocalName == "calcOnExit")
{
Expand Down Expand Up @@ -397,7 +397,7 @@ internal static CT_FFData Parse(XmlNode node, XmlNamespaceManager namespaceManag
}
internal void Write(StreamWriter sw, string nodeName)
{
sw.Write(string.Format("<w:{0}", nodeName));
sw.Write(string.Format("<w:{0}>", nodeName));

for (int i=0;i<this.itemsElementNameField.Count;i++)
{
Expand All @@ -423,7 +423,7 @@ internal void Write(StreamWriter sw, string nodeName)
(this.itemsField[i] as CT_FFTextInput).Write(sw, "textInput");
}

sw.Write(string.Format("</{0}>", nodeName));
sw.Write(string.Format("</w:{0}>", nodeName));
}
private void AddNewObject(object obj, FFDataItemsType type)
{
Expand Down Expand Up @@ -639,15 +639,15 @@ internal void Write(StreamWriter sw, string nodeName)
{
sw.Write(string.Format("<w:{0}>", nodeName));
if (this.defaultField != null)
this.defaultField.Write(sw, "w:default");
this.defaultField.Write(sw, "default");
if (this.checkedField != null)
this.checkedField.Write(sw, "w:checked");
this.checkedField.Write(sw, "checked");
if (this.itemField != null)
{
if (this.itemField is CT_OnOff)
(this.itemField as CT_OnOff).Write(sw, "w:sizeAuto");
(this.itemField as CT_OnOff).Write(sw, "sizeAuto");
else
(this.itemField as CT_HpsMeasure).Write(sw, "w:size");
(this.itemField as CT_HpsMeasure).Write(sw, "size");
}
sw.Write(string.Format("</w:{0}>", nodeName));
}
Expand Down Expand Up @@ -742,12 +742,12 @@ internal void Write(StreamWriter sw, string nodeName)
{
sw.Write(string.Format("<w:{0}>", nodeName));
if (this.defaultField != null)
this.defaultField.Write(sw, "w:default");
this.defaultField.Write(sw, "default");
if (this.resultField != null)
this.resultField.Write(sw, "w:result");
this.resultField.Write(sw, "result");
foreach (CT_String str in listEntry)
{
str.Write(sw, "w:listEntry");
str.Write(sw, "listEntry");
}
sw.Write(string.Format("</w:{0}>", nodeName));
}
Expand Down Expand Up @@ -1031,17 +1031,17 @@ public static CT_FFTextInput Parse(XmlNode node, XmlNamespaceManager namespaceMa

internal void Write(StreamWriter sw, string nodeName)
{
sw.Write(string.Format("<w:{0}", nodeName));
sw.Write(string.Format("<w:{0}>", nodeName));
if (this.typeField == null)
this.typeField.Write(sw, "w:type");
this.typeField.Write(sw, "type");
if (this.defaultField != null)
this.defaultField.Write(sw, "w:default");
this.defaultField.Write(sw, "default");
if (this.formatField != null)
this.formatField.Write(sw, "w:format");
this.formatField.Write(sw, "format");
if (this.maxLengthField != null)
this.maxLengthField.Write(sw, "w:maxLength");
this.maxLengthField.Write(sw, "maxLength");

sw.Write(string.Format("</{0}>", nodeName));
sw.Write(string.Format("</w:{0}>", nodeName));
}
}

Expand Down
16 changes: 8 additions & 8 deletions ooxml/OpenXmlFormats/Wordprocessing/HdrFtr.cs
Original file line number Diff line number Diff line change
Expand Up @@ -670,13 +670,13 @@ internal void Write(StreamWriter sw, string nodeName)
sw.Write(string.Format("<w:{0}", nodeName));
sw.Write(">");
if (this.pos != null)
this.pos.Write(sw, "w:pos");
this.pos.Write(sw, "pos");
if (this.numFmt != null)
this.numFmt.Write(sw, "w:numFmt");
this.numFmt.Write(sw, "numFmt");
if (this.numStart != null)
this.numStart.Write(sw, "w:numStart");
this.numStart.Write(sw, "numStart");
if (this.numRestart != null)
this.numRestart.Write(sw, "w:numRestart");
this.numRestart.Write(sw, "numRestart");
sw.Write(string.Format("</w:{0}>", nodeName));
}

Expand Down Expand Up @@ -1649,13 +1649,13 @@ internal void Write(StreamWriter sw, string nodeName)
sw.Write(string.Format("<w:{0}", nodeName));
sw.Write(">");
if (this.pos != null)
this.pos.Write(sw, "w:pos");
this.pos.Write(sw, "pos");
if (this.numFmt != null)
this.numFmt.Write(sw, "w:numFmt");
this.numFmt.Write(sw, "numFmt");
if (this.numStart != null)
this.numStart.Write(sw, "w:numStart");
this.numStart.Write(sw, "numStart");
if (this.numRestart != null)
this.numRestart.Write(sw, "w:numRestart");
this.numRestart.Write(sw, "numRestart");
sw.Write(string.Format("</w:{0}>", nodeName));
}

Expand Down
42 changes: 21 additions & 21 deletions ooxml/OpenXmlFormats/Wordprocessing/Paragraph.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2068,43 +2068,43 @@ internal void Write(StreamWriter sw, string nodeName)
XmlHelper.WriteAttribute(sw, "w:rsidSect", this.rsidSect);
sw.Write(">");
if (this.footnotePr != null)
this.footnotePr.Write(sw, "w:footnotePr");
this.footnotePr.Write(sw, "footnotePr");
if (this.endnotePr != null)
this.endnotePr.Write(sw, "w:endnotePr");
this.endnotePr.Write(sw, "endnotePr");
if (this.type != null)
this.type.Write(sw, "w:type");
this.type.Write(sw, "type");
if (this.pgSz != null)
this.pgSz.Write(sw, "w:pgSz");
this.pgSz.Write(sw, "pgSz");
if (this.pgMar != null)
this.pgMar.Write(sw, "w:pgMar");
this.pgMar.Write(sw, "pgMar");
if (this.paperSrc != null)
this.paperSrc.Write(sw, "w:paperSrc");
this.paperSrc.Write(sw, "paperSrc");
if (this.pgBorders != null)
this.pgBorders.Write(sw, "w:pgBorders");
this.pgBorders.Write(sw, "pgBorders");
if (this.lnNumType != null)
this.lnNumType.Write(sw, "w:lnNumType");
this.lnNumType.Write(sw, "lnNumType");
if (this.pgNumType != null)
this.pgNumType.Write(sw, "w:pgNumType");
this.pgNumType.Write(sw, "pgNumType");
if (this.cols != null)
this.cols.Write(sw, "w:cols");
this.cols.Write(sw, "cols");
if (this.formProt != null)
this.formProt.Write(sw, "w:formProt");
this.formProt.Write(sw, "formProt");
if (this.vAlign != null)
this.vAlign.Write(sw, "w:vAlign");
this.vAlign.Write(sw, "vAlign");
if (this.noEndnote != null)
this.noEndnote.Write(sw, "w:noEndnote");
this.noEndnote.Write(sw, "noEndnote");
if (this.titlePg != null)
this.titlePg.Write(sw, "w:titlePg");
this.titlePg.Write(sw, "titlePg");
if (this.textDirection != null)
this.textDirection.Write(sw, "w:textDirection");
this.textDirection.Write(sw, "textDirection");
if (this.bidi != null)
this.bidi.Write(sw, "w:bidi");
this.bidi.Write(sw, "bidi");
if (this.rtlGutter != null)
this.rtlGutter.Write(sw, "w:rtlGutter");
this.rtlGutter.Write(sw, "rtlGutter");
if (this.docGrid != null)
this.docGrid.Write(sw, "w:docGrid");
this.docGrid.Write(sw, "docGrid");
if (this.printerSettings != null)
this.printerSettings.Write(sw, "w:printerSettings");
this.printerSettings.Write(sw, "printerSettings");
sw.Write(string.Format("</w:{0}>", nodeName));
}

Expand Down Expand Up @@ -3292,7 +3292,7 @@ internal void Write(StreamWriter sw, string nodeName)
XmlHelper.WriteAttribute(sw, "w:beforeLines", this.beforeLines);
if(this.beforeAutospacing!= ST_OnOff.off)
XmlHelper.WriteAttribute(sw, "w:beforeAutospacing", this.beforeAutospacing.ToString());
XmlHelper.WriteAttribute(sw, "w:after", this.after);
XmlHelper.WriteAttribute(sw, "w:after", this.after, true);
XmlHelper.WriteAttribute(sw, "w:afterLines", this.afterLines);
if (this.afterAutospacing != ST_OnOff.off)
XmlHelper.WriteAttribute(sw, "w:afterAutospacing", this.afterAutospacing.ToString());
Expand Down Expand Up @@ -6690,7 +6690,7 @@ public CT_RPrChange()
XmlHelper.WriteAttribute(sw, "r:id", this.id);
sw.Write(">");
if (this.rPr != null)
this.rPr.Write(sw, "w:rPr");
this.rPr.Write(sw, "rPr");
sw.Write(string.Format("</w:{0}>", nodeName));
}

Expand Down
2 changes: 1 addition & 1 deletion ooxml/OpenXmlFormats/Wordprocessing/Run.cs
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ internal void Write(StreamWriter sw, string nodeName)
else if (o is CT_Br)
((CT_Br)o).Write(sw, "br");
else if (o is CT_Markup)
((CT_Markup)o).Write(sw, "w:commentReference");
((CT_Markup)o).Write(sw, "commentReference");
else if (o is CT_Empty && this.ItemsElementName[i] == RunItemsChoiceType.continuationSeparator)
sw.Write("<w:continuationSeparator/>");
else if (o is CT_Empty && this.ItemsElementName[i] == RunItemsChoiceType.cr)
Expand Down

0 comments on commit 815dc3a

Please sign in to comment.