/** * add a new number to the numbering document * @param num */ public string AddNum(XWPFNum num) { ctNumbering.AddNewNum(); int pos = (ctNumbering.GetNumList().Count) - 1; ctNumbering.SetNumArray(pos, num.GetCTNum()); nums.Add(num); return(num.GetCTNum().numId); }
/** * read numbering form an existing package */ internal override void OnDocumentRead() { NumberingDocument numberingDoc = null; XmlDocument doc = ConvertStreamToXml(GetPackagePart().GetInputStream()); try { numberingDoc = NumberingDocument.Parse(doc, NamespaceManager); ctNumbering = numberingDoc.Numbering; //get any Nums foreach (CT_Num ctNum in ctNumbering.GetNumList()) { nums.Add(new XWPFNum(ctNum, this)); } foreach (CT_AbstractNum ctAbstractNum in ctNumbering.GetAbstractNumList()) { abstractNums.Add(new XWPFAbstractNum(ctAbstractNum, this)); } isNew = false; } catch (Exception e) { throw new POIXMLException(e); } }
/** * read numbering form an existing package */ internal override void OnDocumentRead() { NumberingDocument numberingDoc = null; XmlDocument doc = ConvertStreamToXml(GetPackagePart().GetInputStream()); try { numberingDoc = NumberingDocument.Parse(doc, NamespaceManager); ctNumbering = numberingDoc.Numbering; //get any Nums foreach (CT_Num ctNum in ctNumbering.GetNumList()) { nums.Add(new XWPFNum(ctNum, this)); } foreach (CT_AbstractNum ctAbstractNum in ctNumbering.GetAbstractNumList()) { abstractNums.Add(new XWPFAbstractNum(ctAbstractNum, this)); } //isNew = false; //ElectricSquare: The field 'XWPFNumbering.isNew' is assigned but its value is never used } catch (Exception e) { throw new POIXMLException(e); } }
/** * read numbering form an existing package */ internal override void OnDocumentRead() { NumberingDocument numberingDoc = null; Stream is1; is1 = GetPackagePart().GetInputStream(); try { numberingDoc = NumberingDocument.Parse(is1); ctNumbering = numberingDoc.Numbering; //get any Nums foreach (CT_Num ctNum in ctNumbering.GetNumList()) { nums.Add(new XWPFNum(ctNum, this)); } foreach (CT_AbstractNum ctAbstractNum in ctNumbering.GetAbstractNumList()) { abstractNums.Add(new XWPFAbstractNum(ctAbstractNum, this)); } isNew = false; } catch (Exception) { throw new POIXMLException(); } }