mirror of https://github.com/apache/poi.git
fixed bug 42485: All TextBoxes inside ShapeGroups have null TextRuns
git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@541274 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
4b76f7c104
commit
a0e489bb4d
|
@ -64,6 +64,7 @@ public class ShapeGroup extends Shape{
|
|||
// 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
|
||||
|
|
Binary file not shown.
|
@ -19,10 +19,7 @@ package org.apache.poi.hslf.usermodel;
|
|||
|
||||
import junit.framework.TestCase;
|
||||
import org.apache.poi.hslf.HSLFSlideShow;
|
||||
import org.apache.poi.hslf.model.Picture;
|
||||
import org.apache.poi.hslf.model.Slide;
|
||||
import org.apache.poi.hslf.model.Notes;
|
||||
import org.apache.poi.hslf.model.TextRun;
|
||||
import org.apache.poi.hslf.model.*;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.HashSet;
|
||||
|
@ -118,4 +115,29 @@ public class TestBugs extends TestCase {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Bug 42485: All TextBoxes inside ShapeGroups have null TextRuns
|
||||
*/
|
||||
public void test42485 () throws Exception {
|
||||
FileInputStream is = new FileInputStream(new File(cwd, "42485.ppt"));
|
||||
HSLFSlideShow hslf = new HSLFSlideShow(is);
|
||||
is.close();
|
||||
|
||||
SlideShow ppt = new SlideShow(hslf);
|
||||
Shape[] shape = ppt.getSlides()[0].getShapes();
|
||||
for (int i = 0; i < shape.length; i++) {
|
||||
if(shape[i] instanceof ShapeGroup){
|
||||
ShapeGroup group = (ShapeGroup)shape[i];
|
||||
Shape[] sh = group.getShapes();
|
||||
for (int j = 0; j < sh.length; j++) {
|
||||
if( sh[j] instanceof TextBox){
|
||||
TextBox txt = (TextBox)sh[j];
|
||||
assertNotNull(txt.getTextRun());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue