Ejemplo n.º 1
0
        /**
         * read numbering form an existing package
         */

        internal override void OnDocumentRead()
        {
            NumberingDocument numberingDoc = null;

            XDocument 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));
                }
            }
            catch (Exception e)
            {
                throw new POIXMLException(e);
            }
        }
Ejemplo n.º 2
0
        /**
         * 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);
            }
        }
Ejemplo n.º 3
0
        /**
         * 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();
            }
        }