Exemplo n.º 1
0
        public void TestCompareAbstractNum()
        {
            XWPFDocument  doc       = XWPFTestDataSamples.OpenSampleDocument("Numbering.docx");
            XWPFNumbering numbering = doc.GetNumbering();
            int           numId     = 1;

            Assert.IsTrue(numbering.NumExist(numId.ToString()));
            XWPFNum         num                = numbering.GetNum(numId.ToString());
            string          abstrNumId         = num.GetCTNum().abstractNumId.val;
            XWPFAbstractNum abstractNum        = numbering.GetAbstractNum(abstrNumId);
            string          CompareAbstractNum = numbering.GetIdOfAbstractNum(abstractNum);

            Assert.AreEqual(abstrNumId, CompareAbstractNum);
        }
Exemplo n.º 2
0
        public void TestAddNumberingToDoc()
        {
            string abstractNumId = "1";
            string numId         = "1";

            XWPFDocument  docOut    = new XWPFDocument();
            XWPFNumbering numbering = docOut.CreateNumbering();

            numId = numbering.AddNum(abstractNumId);

            XWPFDocument docIn = XWPFTestDataSamples.WriteOutAndReadBack(docOut);

            numbering = docIn.GetNumbering();
            Assert.IsTrue(numbering.NumExist(numId));
            XWPFNum num = numbering.GetNum(numId);

            string CompareAbstractNum = num.GetCTNum().abstractNumId.val;

            Assert.AreEqual(abstractNumId, CompareAbstractNum);
        }
Exemplo n.º 3
0
        public void TestOverrideList()
        {
            //TODO: for now the try/catch block ensures loading/inclusion of CTNumLevel
            //for down stream Processing.
            //Ideally, we should find files that actually use overrides and test against those.
            //Use XWPFParagraph's GetNumStartOverride() in the actual tests

            XWPFDocument  doc = XWPFTestDataSamples.OpenSampleDocument("Numbering.docx");
            XWPFParagraph p = doc.Paragraphs[(18)]; XWPFNumbering numbering = doc.CreateNumbering();
            bool          ex = false;

            Assert.IsNull(p.GetNumStartOverride());
            try
            {
                numbering.GetNum(p.GetNumID()).GetCTNum().GetLvlOverrideArray(1);
            }
            catch (ArgumentOutOfRangeException e)
            {
                ex = true;
            }
            Assert.IsTrue(ex);
        }
Exemplo n.º 4
0
 public XWPFNum(CT_Num ctNum, XWPFNumbering numbering)
 {
     this.ctNum     = ctNum;
     this.numbering = numbering;
 }
Exemplo n.º 5
0
 public void SetNumbering(XWPFNumbering numbering)
 {
     this.numbering = numbering;
 }
Exemplo n.º 6
0
 public XWPFNum(XWPFNumbering numbering)
 {
     this.ctNum     = null;
     this.numbering = numbering;
 }
Exemplo n.º 7
0
 public XWPFNum(CT_Num ctNum)
 {
     this.ctNum     = ctNum;
     this.numbering = null;
 }
Exemplo n.º 8
0
 public XWPFNum()
 {
     this.ctNum     = null;
     this.numbering = null;
 }
Exemplo n.º 9
0
 public XWPFAbstractNum(CT_AbstractNum ctAbstractNum, XWPFNumbering numbering)
 {
     this.ctAbstractNum = ctAbstractNum;
     this.numbering     = numbering;
 }
Exemplo n.º 10
0
 protected XWPFAbstractNum()
 {
     this.ctAbstractNum = null;
     this.numbering     = null;
 }