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
8d72b9137a
commit
db05d9158a
@ -31,15 +31,17 @@ public class XWPFPicture {
|
||||
|
||||
protected XWPFParagraph paragraph;
|
||||
private CTPicture ctPic;
|
||||
|
||||
public XWPFParagraph getParagraph(){
|
||||
private String description;
|
||||
|
||||
public XWPFParagraph getParagraph(){
|
||||
return paragraph;
|
||||
}
|
||||
|
||||
public XWPFPicture(CTPicture ctPic, XWPFParagraph paragraph){
|
||||
this.paragraph = paragraph;
|
||||
this.ctPic = ctPic;
|
||||
}
|
||||
description = ctPic.getNvPicPr().getCNvPr().getDescr();
|
||||
}
|
||||
|
||||
/**
|
||||
* Link Picture with PictureData
|
||||
@ -71,5 +73,8 @@ 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
Block a user