diff options
Diffstat (limited to 'src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFPictureData.java')
-rw-r--r-- | src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFPictureData.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFPictureData.java b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFPictureData.java index 72aa4c115e..89dfcb1453 100644 --- a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFPictureData.java +++ b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFPictureData.java @@ -129,4 +129,26 @@ public class TestXWPFPictureData extends TestCase { public void testGetChecksum() { } + + public void testBug51770() throws InvalidFormatException, IOException { + XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("Bug51170.docx"); + XWPFHeaderFooterPolicy policy = doc.getHeaderFooterPolicy(); + XWPFHeader header = policy.getDefaultHeader(); + for (XWPFParagraph paragraph : header.getParagraphs()) { + for (XWPFRun run : paragraph.getRuns()) { + for (XWPFPicture picture : run.getEmbeddedPictures()) { + if (paragraph.getDocument() != null) { + System.out.println(picture.getCTPicture()); + XWPFPictureData data = picture.getPictureData(); + if(data != null) System.out.println(data.getFileName()); + } + } + } + } + + } + + private void process(XWPFParagraph paragraph){ + + } } |