assertEquals(p3, doc.getBodyElements().get(0));
assertEquals(p3, doc.getParagraphs().get(0));
}
public void testSettings() throws Exception {
XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("WithGIF.docx");
assertEquals(120, doc.getZoomPercent());
assertEquals(false, doc.isEnforcedCommentsProtection());
assertEquals(false, doc.isEnforcedFillingFormsProtection());
assertEquals(false, doc.isEnforcedReadonlyProtection());
assertEquals(false, doc.isEnforcedTrackedChangesProtection());
doc.setZoomPercent(124);
// Only one enforcement allowed, last one wins!
doc.enforceFillingFormsProtection();
doc.enforceReadonlyProtection();
doc = XWPFTestDataSamples.writeOutAndReadBack(doc);
assertEquals(124, doc.getZoomPercent());
assertEquals(false, doc.isEnforcedCommentsProtection());
assertEquals(false, doc.isEnforcedFillingFormsProtection());
assertEquals(true, doc.isEnforcedReadonlyProtection());
assertEquals(false, doc.isEnforcedTrackedChangesProtection());
}