From: Maxim Valyanskiy Date: Mon, 8 Feb 2010 12:08:15 +0000 (+0000) Subject: XSLFCommonSlideData: extract text data from group shape X-Git-Tag: REL_3_7_BETA1~110 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d596debbe5984019d5c8c23044b6e360fd6aa07d;p=poi.git XSLFCommonSlideData: extract text data from group shape git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@907626 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFCommonSlideData.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFCommonSlideData.java index 9111b18b6d..b32a430f39 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFCommonSlideData.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFCommonSlideData.java @@ -26,16 +26,10 @@ public class XSLFCommonSlideData { List out = new ArrayList(); - 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 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())); + } + } + }