Search in sources :

Example 1 with CTInd

use of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTInd in project poi by apache.

the class TestXWPFParagraph method testSetGetIndentation.

@Test
public void testSetGetIndentation() throws IOException {
    XWPFDocument doc = new XWPFDocument();
    XWPFParagraph p = doc.createParagraph();
    assertEquals(-1, p.getIndentationLeft());
    CTP ctp = p.getCTP();
    CTPPr ppr = ctp.getPPr() == null ? ctp.addNewPPr() : ctp.getPPr();
    assertEquals(-1, p.getIndentationLeft());
    CTInd ind = ppr.addNewInd();
    ind.setLeft(new BigInteger("10"));
    assertEquals(10, p.getIndentationLeft());
    p.setIndentationLeft(100);
    assertEquals(100, ind.getLeft().intValue());
    doc.close();
}
Also used : CTPPr(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTPPr) CTInd(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTInd) BigInteger(java.math.BigInteger) CTP(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP) Test(org.junit.Test)

Aggregations

BigInteger (java.math.BigInteger)1 Test (org.junit.Test)1 CTInd (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTInd)1 CTP (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP)1 CTPPr (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTPPr)1