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();
}
Aggregations