// Create the Shape for it
EscherContainerRecord container = (EscherContainerRecord)r;
Shape shape = ShapeFactory.createShape(container, this);
+ shape.setSheet(getSheet());
shapeList.add( shape );
} else {
// Should we do anything special with these non
\r
import junit.framework.TestCase;\r
import org.apache.poi.hslf.HSLFSlideShow;\r
-import org.apache.poi.hslf.model.Picture;\r
-import org.apache.poi.hslf.model.Slide;\r
-import org.apache.poi.hslf.model.Notes;\r
-import org.apache.poi.hslf.model.TextRun;\r
+import org.apache.poi.hslf.model.*;\r
\r
import java.io.*;\r
import java.util.HashSet;\r
}\r
}\r
}\r
+\r
+ /**\r
+ * Bug 42485: All TextBoxes inside ShapeGroups have null TextRuns\r
+ */\r
+ public void test42485 () throws Exception {\r
+ FileInputStream is = new FileInputStream(new File(cwd, "42485.ppt"));\r
+ HSLFSlideShow hslf = new HSLFSlideShow(is);\r
+ is.close();\r
+\r
+ SlideShow ppt = new SlideShow(hslf);\r
+ Shape[] shape = ppt.getSlides()[0].getShapes();\r
+ for (int i = 0; i < shape.length; i++) {\r
+ if(shape[i] instanceof ShapeGroup){\r
+ ShapeGroup group = (ShapeGroup)shape[i];\r
+ Shape[] sh = group.getShapes();\r
+ for (int j = 0; j < sh.length; j++) {\r
+ if( sh[j] instanceof TextBox){\r
+ TextBox txt = (TextBox)sh[j];\r
+ assertNotNull(txt.getTextRun());\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
}\r