/**
* Keeps track on all id-values used in this document and included parts, like headers, footers, etc.
*/
- private IdentifierManager drawingIdManager = new IdentifierManager(1L,4294967295L);
+ private IdentifierManager drawingIdManager = new IdentifierManager(0L,4294967295L);
protected List<XWPFFooter> footers = new ArrayList<XWPFFooter>();
protected List<XWPFHeader> headers = new ArrayList<XWPFHeader>();
protected List<XWPFComment> comments = new ArrayList<XWPFComment>();
doc.getPackage().revert();
}
+ public void testZeroLengthLibreOfficeDocumentWithWaterMarkHeader() throws IOException {
+ XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("zero-length.docx");
+ POIXMLProperties properties = doc.getProperties();
+
+ assertNotNull(properties.getCoreProperties());
+
+ XWPFHeader headerArray = doc.getHeaderArray(0);
+ assertEquals(1, headerArray.getAllPictures().size());
+ assertEquals("image1.png", headerArray.pictures.get(0).getFileName());
+ assertEquals("", headerArray.getText());
+
+ POIXMLProperties.ExtendedProperties extendedProperties = properties.getExtendedProperties();
+ assertNotNull(extendedProperties);
+ assertEquals(0, extendedProperties.getUnderlyingProperties().getCharacters());
+ }
public void testSettings(){
XWPFSettings settings = new XWPFSettings();