mirror of https://github.com/apache/poi.git
XWPFPicture: support for reading picture description
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1083780 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
71b9455d88
commit
ad6011bf47
|
@ -31,6 +31,7 @@ public class XWPFPicture {
|
|||
|
||||
protected XWPFParagraph paragraph;
|
||||
private CTPicture ctPic;
|
||||
private String description;
|
||||
|
||||
public XWPFParagraph getParagraph(){
|
||||
return paragraph;
|
||||
|
@ -39,6 +40,7 @@ public class XWPFPicture {
|
|||
public XWPFPicture(CTPicture ctPic, XWPFParagraph paragraph){
|
||||
this.paragraph = paragraph;
|
||||
this.ctPic = ctPic;
|
||||
description = ctPic.getNvPicPr().getCNvPr().getDescr();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -72,4 +74,7 @@ public class XWPFPicture {
|
|||
return null;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -343,6 +343,7 @@ public class TestXWPFRun extends TestCase {
|
|||
|
||||
for (XWPFPicture pic : pictures) {
|
||||
assertNotNull(pic.getPictureData());
|
||||
assertEquals("DOZOR", pic.getDescription());
|
||||
}
|
||||
|
||||
count+= pictures.size();
|
||||
|
|
Loading…
Reference in New Issue