XSLFCommonSlideData: extract text data from group shape

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@907626 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Maxim Valyanskiy 2010-02-08 12:08:15 +00:00
parent 943d3d19e1
commit b8dbb48254
1 changed files with 17 additions and 9 deletions

View File

@ -26,16 +26,10 @@ public class XSLFCommonSlideData {
List<DrawingParagraph> out = new ArrayList<DrawingParagraph>();
CTShape[] shapes = gs.getSpArray();
for (int i = 0; i < shapes.length; i++) {
CTTextBody ctTextBody = shapes[i].getTxBody();
if (ctTextBody==null) {
continue;
}
processShape(gs, out);
DrawingTextBody textBody = new DrawingTextBody(ctTextBody);
out.addAll(Arrays.asList(textBody.getParagraphs()));
for (CTGroupShape shape : gs.getGrpSpArray()) {
processShape(shape, out);
}
CTGraphicalObjectFrame[] graphicFrames = gs.getGraphicFrameArray();
@ -64,4 +58,18 @@ public class XSLFCommonSlideData {
return out;
}
private void processShape(CTGroupShape gs, List<DrawingParagraph> out) {
CTShape[] shapes = gs.getSpArray();
for (int i = 0; i < shapes.length; i++) {
CTTextBody ctTextBody = shapes[i].getTxBody();
if (ctTextBody==null) {
continue;
}
DrawingTextBody textBody = new DrawingTextBody(ctTextBody);
out.addAll(Arrays.asList(textBody.getParagraphs()));
}
}
}