]> source.dussan.org Git - poi.git/commitdiff
XSLFCommonSlideData: extract text data from group shape
authorMaxim Valyanskiy <maxcom@apache.org>
Mon, 8 Feb 2010 12:08:15 +0000 (12:08 +0000)
committerMaxim Valyanskiy <maxcom@apache.org>
Mon, 8 Feb 2010 12:08:15 +0000 (12:08 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@907626 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFCommonSlideData.java

index 9111b18b6d707efbfe1870bbfd00ef3c02470012..b32a430f393e6662b49e60e8f5edcf8ad5530a97 100644 (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()));
+        }
+    }
+
 }