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
ddef996756
commit
eb267bb14a
@ -64,6 +64,7 @@ public class ShapeGroup extends Shape{
|
|||||||
// Create the Shape for it
|
// Create the Shape for it
|
||||||
EscherContainerRecord container = (EscherContainerRecord)r;
|
EscherContainerRecord container = (EscherContainerRecord)r;
|
||||||
Shape shape = ShapeFactory.createShape(container, this);
|
Shape shape = ShapeFactory.createShape(container, this);
|
||||||
|
shape.setSheet(getSheet());
|
||||||
shapeList.add( shape );
|
shapeList.add( shape );
|
||||||
} else {
|
} else {
|
||||||
// Should we do anything special with these non
|
// Should we do anything special with these non
|
||||||
|
BIN
src/scratchpad/testcases/org/apache/poi/hslf/data/42485.ppt
Normal file
BIN
src/scratchpad/testcases/org/apache/poi/hslf/data/42485.ppt
Normal file
Binary file not shown.
@ -19,10 +19,7 @@ package org.apache.poi.hslf.usermodel;
|
|||||||
|
|
||||||
import junit.framework.TestCase;
|
import junit.framework.TestCase;
|
||||||
import org.apache.poi.hslf.HSLFSlideShow;
|
import org.apache.poi.hslf.HSLFSlideShow;
|
||||||
import org.apache.poi.hslf.model.Picture;
|
import org.apache.poi.hslf.model.*;
|
||||||
import org.apache.poi.hslf.model.Slide;
|
|
||||||
import org.apache.poi.hslf.model.Notes;
|
|
||||||
import org.apache.poi.hslf.model.TextRun;
|
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.util.HashSet;
|
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
Block a user