/**
         * Get a <b>copy</b> of the currently used CTPInd, if none is used, return
         * a new instance.
         */
        private CT_Ind GetCTInd(bool create)
        {
            CT_PPr pr = GetCTPPr();
            CT_Ind ct = pr.ind == null ? null : pr.ind;

            if (create && ct == null)
            {
                ct = pr.AddNewInd();
            }
            return(ct);
        }
Example #2
0
        private CT_Ind GetCTInd(bool create)
        {
            CT_PPr ctpPr = this.GetCTPPr();
            CT_Ind ctInd = ctpPr.ind == null ? (CT_Ind)null : ctpPr.ind;

            if (create && ctInd == null)
            {
                ctInd = ctpPr.AddNewInd();
            }
            return(ctInd);
        }
Example #3
0
        public void TestSetGetIndentation()
        {
            XWPFDocument  doc = new XWPFDocument();
            XWPFParagraph p   = doc.CreateParagraph();

            Assert.AreEqual(-1, p.IndentationLeft);

            CT_P   ctp = p.GetCTP();
            CT_PPr ppr = ctp.pPr == null?ctp.AddNewPPr() : ctp.pPr;

            Assert.AreEqual(-1, p.IndentationLeft);

            CT_Ind ind = ppr.AddNewInd();

            ind.left = "10";
            Assert.AreEqual(10, p.IndentationLeft);

            p.IndentationLeft = 100;
            Assert.AreEqual(100, int.Parse(ind.left));
        }