poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kiwiwi...@apache.org
Subject svn commit: r1664935 [4/4] - in /poi/branches/common_sl/src: examples/src/org/apache/poi/hslf/examples/ ooxml/java/org/apache/poi/xslf/model/ ooxml/java/org/apache/poi/xslf/usermodel/ scratchpad/src/org/apache/poi/hslf/blip/ scratchpad/src/org/apache/p...
Date Sat, 07 Mar 2015 23:35:41 GMT
Modified: poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/model/TestBackground.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/model/TestBackground.java?rev=1664935&r1=1664934&r2=1664935&view=diff
==============================================================================
--- poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/model/TestBackground.java
(original)
+++ poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/model/TestBackground.java
Sat Mar  7 23:35:40 2015
@@ -60,7 +60,7 @@ public final class TestBackground {
         assertTrue(slide.getFollowMasterBackground());
         assertEquals(Fill.FILL_SOLID, slide.getBackground().getFill().getFillType());
 
-        Shape shape = new AutoShape(ShapeType.RECT);
+        HSLFShape shape = new AutoShape(ShapeType.RECT);
         assertEquals(Fill.FILL_SOLID, shape.getFill().getFillType());
     }
 
@@ -71,7 +71,7 @@ public final class TestBackground {
     public void readBackground() throws Exception {
         SlideShow ppt = new SlideShow(_slTests.openResourceAsStream("backgrounds.ppt"));
         Fill fill;
-        Shape shape;
+        HSLFShape shape;
 
         Slide[] slide = ppt.getSlides();
 
@@ -104,7 +104,7 @@ public final class TestBackground {
         SlideShow ppt = new SlideShow();
         Slide slide;
         Fill fill;
-        Shape shape;
+        HSLFShape shape;
         int idx;
 
         //slide 1
@@ -202,9 +202,9 @@ public final class TestBackground {
 
     }
 
-    private int getFillPictureRefCount(Shape shape, Fill fill) {
+    private int getFillPictureRefCount(HSLFShape shape, Fill fill) {
         EscherOptRecord opt = shape.getEscherOptRecord();
-        EscherSimpleProperty p = Shape.getEscherProperty(opt, EscherProperties.FILL__PATTERNTEXTURE);
+        EscherSimpleProperty p = HSLFShape.getEscherProperty(opt, EscherProperties.FILL__PATTERNTEXTURE);
         if(p != null) {
             int idx = p.getPropertyValue();
 
@@ -212,7 +212,7 @@ public final class TestBackground {
             SlideShow ppt = sheet.getSlideShow();
             Document doc = ppt.getDocumentRecord();
             EscherContainerRecord dggContainer = doc.getPPDrawingGroup().getDggContainer();
-            EscherContainerRecord bstore = Shape.getEscherChild(dggContainer, EscherContainerRecord.BSTORE_CONTAINER);
+            EscherContainerRecord bstore = HSLFShape.getEscherChild(dggContainer, EscherContainerRecord.BSTORE_CONTAINER);
             List<EscherRecord> lst = bstore.getChildRecords();
             return ((EscherBSERecord)lst.get(idx-1)).getRef();
         }

Modified: poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/model/TestOleEmbedding.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/model/TestOleEmbedding.java?rev=1664935&r1=1664934&r2=1664935&view=diff
==============================================================================
--- poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/model/TestOleEmbedding.java
(original)
+++ poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/model/TestOleEmbedding.java
Sat Mar  7 23:35:40 2015
@@ -64,7 +64,7 @@ public final class TestOleEmbedding exte
         SlideShow ppt = new SlideShow(_slTests.openResourceAsStream("ole2-embedding-2003.ppt"));
 
         Slide slide = ppt.getSlides()[0];
-        Shape[] sh = slide.getShapes();
+        HSLFShape[] sh = slide.getShapes();
         int cnt = 0;
         for (int i = 0; i < sh.length; i++) {
             if(sh[i] instanceof OLEShape){

Modified: poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/model/TestPPGraphics2D.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/model/TestPPGraphics2D.java?rev=1664935&r1=1664934&r2=1664935&view=diff
==============================================================================
--- poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/model/TestPPGraphics2D.java
(original)
+++ poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/model/TestPPGraphics2D.java
Sat Mar  7 23:35:40 2015
@@ -49,7 +49,7 @@ public final class TestPPGraphics2D exte
     	assertEquals(1, ppt.getSlides().length);
 
     	// Add some stuff into it
-        ShapeGroup group = new ShapeGroup();
+        HSLFGroupShape group = new HSLFGroupShape();
         Dimension pgsize = ppt.getPageSize();
         java.awt.Rectangle bounds = new java.awt.Rectangle(0, 0, (int)pgsize.getWidth(),
(int)pgsize.getHeight());
         group.setAnchor(bounds);
@@ -77,12 +77,12 @@ public final class TestPPGraphics2D exte
         assertEquals(1, ppt.getSlides().length);
 
         slide = ppt.getSlides()[0];
-        Shape[] shape = slide.getShapes();
+        HSLFShape[] shape = slide.getShapes();
         assertEquals(shape.length, 1); //group shape
 
-        assertTrue(shape[0] instanceof ShapeGroup); //group shape
+        assertTrue(shape[0] instanceof HSLFGroupShape); //group shape
 
-        group = (ShapeGroup)shape[0];
+        group = (HSLFGroupShape)shape[0];
         shape = group.getShapes();
         assertEquals(shape.length, 3);
     }

Modified: poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/model/TestShapes.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/model/TestShapes.java?rev=1664935&r1=1664934&r2=1664935&view=diff
==============================================================================
--- poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/model/TestShapes.java
(original)
+++ poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/model/TestShapes.java
Sat Mar  7 23:35:40 2015
@@ -101,7 +101,7 @@ public final class TestShapes {
         assertEquals(1, ppt.getSlides().length);
 
         slide = ppt.getSlides()[0];
-        Shape[] shape = slide.getShapes();
+        HSLFShape[] shape = slide.getShapes();
         assertEquals(2, shape.length);
 
         assertTrue(shape[0] instanceof Line); //group shape
@@ -119,7 +119,7 @@ public final class TestShapes {
     public void textBoxRead() throws Exception {
         ppt = new SlideShow(_slTests.openResourceAsStream("with_textbox.ppt"));
         Slide sl = ppt.getSlides()[0];
-        Shape[] sh = sl.getShapes();
+        HSLFShape[] sh = sl.getShapes();
         for (int i = 0; i < sh.length; i++) {
             assertTrue(sh[i] instanceof TextBox);
             TextBox txtbox = (TextBox)sh[i];
@@ -241,7 +241,7 @@ public final class TestShapes {
             }
 
             ArrayList<String> lst2 = new ArrayList<String>();
-            Shape[] sh = sl[k].getShapes();
+            HSLFShape[] sh = sl[k].getShapes();
             for (int i = 0; i < sh.length; i++) {
                 if (sh[i] instanceof TextShape){
                     TextShape tbox = (TextShape)sh[i];
@@ -263,7 +263,7 @@ public final class TestShapes {
         Slide slide = ppt.createSlide();
         Dimension pgsize = ppt.getPageSize();
 
-        ShapeGroup group = new ShapeGroup();
+        HSLFGroupShape group = new HSLFGroupShape();
 
         group.setAnchor(new Rectangle(0, 0, (int)pgsize.getWidth(), (int)pgsize.getHeight()));
         slide.addShape(group);
@@ -288,12 +288,12 @@ public final class TestShapes {
 
         slide = ppt.getSlides()[0];
 
-        Shape[] shape = slide.getShapes();
+        HSLFShape[] shape = slide.getShapes();
         assertEquals(1, shape.length);
-        assertTrue(shape[0] instanceof ShapeGroup);
+        assertTrue(shape[0] instanceof HSLFGroupShape);
 
-        group = (ShapeGroup)shape[0];
-        Shape[] grshape = group.getShapes();
+        group = (HSLFGroupShape)shape[0];
+        HSLFShape[] grshape = group.getShapes();
         assertEquals(2, grshape.length);
         assertTrue(grshape[0] instanceof Picture);
         assertTrue(grshape[1] instanceof Line);
@@ -313,7 +313,7 @@ public final class TestShapes {
         String file = "with_textbox.ppt";
         SlideShow ppt = new SlideShow(_slTests.openResourceAsStream(file));
         Slide sl = ppt.getSlides()[0];
-        Shape[] sh = sl.getShapes();
+        HSLFShape[] sh = sl.getShapes();
         assertEquals("expected four shaped in " + file, 4, sh.length);
         //remove all
         for (int i = 0; i < sh.length; i++) {
@@ -352,7 +352,7 @@ public final class TestShapes {
     public void shapeId() {
         SlideShow ppt = new SlideShow();
         Slide slide = ppt.createSlide();
-        Shape shape = null;
+        HSLFShape shape = null;
 
         //EscherDgg is a document-level record which keeps track of the drawing groups
         EscherDggRecord dgg = ppt.getDocumentRecord().getPPDrawingGroup().getEscherDggRecord();
@@ -401,7 +401,7 @@ public final class TestShapes {
     @Test
     public void lineColor() throws IOException {
         SlideShow ppt = new SlideShow(_slTests.openResourceAsStream("51731.ppt"));
-        Shape[] shape = ppt.getSlides()[0].getShapes();
+        HSLFShape[] shape = ppt.getSlides()[0].getShapes();
 
         assertEquals(4, shape.length);
 

Modified: poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/model/TestSheet.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/model/TestSheet.java?rev=1664935&r1=1664934&r2=1664935&view=diff
==============================================================================
--- poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/model/TestSheet.java
(original)
+++ poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/model/TestSheet.java
Sat Mar  7 23:35:40 2015
@@ -87,7 +87,7 @@ public final class TestSheet extends Tes
             assertNotNull(txt[i].getSheet());
         }
 
-        Shape[] shape = sheet.getShapes();
+        HSLFShape[] shape = sheet.getShapes();
         if (shape == null) {
             throw new AssertionFailedError("no shapes");
         }

Modified: poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/model/TestTable.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/model/TestTable.java?rev=1664935&r1=1664934&r2=1664935&view=diff
==============================================================================
--- poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/model/TestTable.java
(original)
+++ poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/model/TestTable.java
Sat Mar  7 23:35:40 2015
@@ -70,7 +70,7 @@ public final class TestTable extends Tes
     public void test45889(){
         SlideShow ppt = new SlideShow();
         Slide slide = ppt.createSlide();
-        Shape[] shapes;
+        HSLFShape[] shapes;
         Table tbl1 = new Table(1, 5);
         assertEquals(5, tbl1.getNumberOfColumns());
         assertEquals(1, tbl1.getNumberOfRows());

Modified: poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/model/TestTextRun.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/model/TestTextRun.java?rev=1664935&r1=1664934&r2=1664935&view=diff
==============================================================================
--- poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/model/TestTextRun.java
(original)
+++ poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/model/TestTextRun.java
Sat Mar  7 23:35:40 2015
@@ -477,7 +477,7 @@ public final class TestTextRun extends T
 		assertSame(run2, runs[1]);
 
 		//as getShapes()
-		Shape[] sh = slide.getShapes();
+		HSLFShape[] sh = slide.getShapes();
 		assertEquals(2, sh.length);
 		assertTrue(sh[0] instanceof TextBox);
 		TextBox box1 = (TextBox)sh[0];
@@ -498,7 +498,7 @@ public final class TestTextRun extends T
     public void test48916() throws IOException {
         SlideShow ppt = new SlideShow(_slTests.openResourceAsStream("SampleShow.ppt"));
         for(Slide slide : ppt.getSlides()){
-            for(Shape sh : slide.getShapes()){
+            for(HSLFShape sh : slide.getShapes()){
                 if(sh instanceof TextShape){
                     TextShape tx = (TextShape)sh;
                     TextRun run = tx.getTextRun();
@@ -519,7 +519,7 @@ public final class TestTextRun extends T
         ppt.write(out);
         ppt = new SlideShow(new ByteArrayInputStream(out.toByteArray()));
         for(Slide slide : ppt.getSlides()){
-            for(Shape sh : slide.getShapes()){
+            for(HSLFShape sh : slide.getShapes()){
                 if(sh instanceof TextShape){
                     TextShape tx = (TextShape)sh;
                     TextRun run = tx.getTextRun();

Modified: poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/model/TestTextShape.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/model/TestTextShape.java?rev=1664935&r1=1664934&r2=1664935&view=diff
==============================================================================
--- poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/model/TestTextShape.java
(original)
+++ poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/model/TestTextShape.java
Sat Mar  7 23:35:40 2015
@@ -89,7 +89,7 @@ public final class TestTextShape {
 
         List<String> lst1 = new ArrayList<String>();
         Slide slide = ppt.getSlides()[0];
-        Shape[] shape = slide.getShapes();
+        HSLFShape[] shape = slide.getShapes();
         for (int i = 0; i < shape.length; i++) {
             assertTrue("Expected TextShape but found " + shape[i].getClass().getName(), shape[i]
instanceof TextShape);
             TextShape tx = (TextShape)shape[i];
@@ -157,7 +157,7 @@ public final class TestTextShape {
 
         ppt = new SlideShow(new ByteArrayInputStream(out.toByteArray()));
         slide = ppt.getSlides()[0];
-        Shape[] shape = slide.getShapes();
+        HSLFShape[] shape = slide.getShapes();
 
         assertTrue(shape[0] instanceof TextShape);
         shape1 = (TextShape)shape[0];
@@ -177,7 +177,7 @@ public final class TestTextShape {
         Slide slide = ppt.getSlides()[0];
 
         Map<String,TextShape> map = new HashMap<String,TextShape>();
-        Shape[] shape = slide.getShapes();
+        HSLFShape[] shape = slide.getShapes();
         for (int i = 0; i < shape.length; i++) {
             if(shape[i] instanceof TextShape){
                 TextShape tx = (TextShape)shape[i];
@@ -188,28 +188,28 @@ public final class TestTextShape {
         TextShape tx;
 
         tx = map.get("TEST1");
-        assertEquals(0.1, tx.getMarginLeft()*Shape.EMU_PER_POINT/Shape.EMU_PER_INCH, 0.01);
-        assertEquals(0.1, tx.getMarginRight()*Shape.EMU_PER_POINT/Shape.EMU_PER_INCH, 0.01);
-        assertEquals(0.39, tx.getMarginTop()*Shape.EMU_PER_POINT/Shape.EMU_PER_INCH, 0.01);
-        assertEquals(0.05, tx.getMarginBottom()*Shape.EMU_PER_POINT/Shape.EMU_PER_INCH, 0.01);
+        assertEquals(0.1, tx.getMarginLeft()*HSLFShape.EMU_PER_POINT/HSLFShape.EMU_PER_INCH,
0.01);
+        assertEquals(0.1, tx.getMarginRight()*HSLFShape.EMU_PER_POINT/HSLFShape.EMU_PER_INCH,
0.01);
+        assertEquals(0.39, tx.getMarginTop()*HSLFShape.EMU_PER_POINT/HSLFShape.EMU_PER_INCH,
0.01);
+        assertEquals(0.05, tx.getMarginBottom()*HSLFShape.EMU_PER_POINT/HSLFShape.EMU_PER_INCH,
0.01);
 
         tx = map.get("TEST2");
-        assertEquals(0.1, tx.getMarginLeft()*Shape.EMU_PER_POINT/Shape.EMU_PER_INCH, 0.01);
-        assertEquals(0.1, tx.getMarginRight()*Shape.EMU_PER_POINT/Shape.EMU_PER_INCH, 0.01);
-        assertEquals(0.05, tx.getMarginTop()*Shape.EMU_PER_POINT/Shape.EMU_PER_INCH, 0.01);
-        assertEquals(0.39, tx.getMarginBottom()*Shape.EMU_PER_POINT/Shape.EMU_PER_INCH, 0.01);
+        assertEquals(0.1, tx.getMarginLeft()*HSLFShape.EMU_PER_POINT/HSLFShape.EMU_PER_INCH,
0.01);
+        assertEquals(0.1, tx.getMarginRight()*HSLFShape.EMU_PER_POINT/HSLFShape.EMU_PER_INCH,
0.01);
+        assertEquals(0.05, tx.getMarginTop()*HSLFShape.EMU_PER_POINT/HSLFShape.EMU_PER_INCH,
0.01);
+        assertEquals(0.39, tx.getMarginBottom()*HSLFShape.EMU_PER_POINT/HSLFShape.EMU_PER_INCH,
0.01);
 
         tx = map.get("TEST3");
-        assertEquals(0.39, tx.getMarginLeft()*Shape.EMU_PER_POINT/Shape.EMU_PER_INCH, 0.01);
-        assertEquals(0.1, tx.getMarginRight()*Shape.EMU_PER_POINT/Shape.EMU_PER_INCH, 0.01);
-        assertEquals(0.05, tx.getMarginTop()*Shape.EMU_PER_POINT/Shape.EMU_PER_INCH, 0.01);
-        assertEquals(0.05, tx.getMarginBottom()*Shape.EMU_PER_POINT/Shape.EMU_PER_INCH, 0.01);
+        assertEquals(0.39, tx.getMarginLeft()*HSLFShape.EMU_PER_POINT/HSLFShape.EMU_PER_INCH,
0.01);
+        assertEquals(0.1, tx.getMarginRight()*HSLFShape.EMU_PER_POINT/HSLFShape.EMU_PER_INCH,
0.01);
+        assertEquals(0.05, tx.getMarginTop()*HSLFShape.EMU_PER_POINT/HSLFShape.EMU_PER_INCH,
0.01);
+        assertEquals(0.05, tx.getMarginBottom()*HSLFShape.EMU_PER_POINT/HSLFShape.EMU_PER_INCH,
0.01);
 
         tx = map.get("TEST4");
-        assertEquals(0.1, tx.getMarginLeft()*Shape.EMU_PER_POINT/Shape.EMU_PER_INCH, 0.01);
-        assertEquals(0.39, tx.getMarginRight()*Shape.EMU_PER_POINT/Shape.EMU_PER_INCH, 0.01);
-        assertEquals(0.05, tx.getMarginTop()*Shape.EMU_PER_POINT/Shape.EMU_PER_INCH, 0.01);
-        assertEquals(0.05, tx.getMarginBottom()*Shape.EMU_PER_POINT/Shape.EMU_PER_INCH, 0.01);
+        assertEquals(0.1, tx.getMarginLeft()*HSLFShape.EMU_PER_POINT/HSLFShape.EMU_PER_INCH,
0.01);
+        assertEquals(0.39, tx.getMarginRight()*HSLFShape.EMU_PER_POINT/HSLFShape.EMU_PER_INCH,
0.01);
+        assertEquals(0.05, tx.getMarginTop()*HSLFShape.EMU_PER_POINT/HSLFShape.EMU_PER_INCH,
0.01);
+        assertEquals(0.05, tx.getMarginBottom()*HSLFShape.EMU_PER_POINT/HSLFShape.EMU_PER_INCH,
0.01);
     }
 
     @Test
@@ -217,7 +217,7 @@ public final class TestTextShape {
         SlideShow ppt = new SlideShow(_slTests.openResourceAsStream("52599.ppt"));
 
         Slide slide = ppt.getSlides()[0];
-        Shape[] sh = slide.getShapes();
+        HSLFShape[] sh = slide.getShapes();
         assertEquals(3, sh.length);
 
         TextShape sh0 = (TextShape)sh[0];

Modified: poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java?rev=1664935&r1=1664934&r2=1664935&view=diff
==============================================================================
--- poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java
(original)
+++ poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java
Sat Mar  7 23:35:40 2015
@@ -51,8 +51,8 @@ import org.apache.poi.hslf.model.Headers
 import org.apache.poi.hslf.model.MasterSheet;
 import org.apache.poi.hslf.model.Notes;
 import org.apache.poi.hslf.model.Picture;
-import org.apache.poi.hslf.model.Shape;
-import org.apache.poi.hslf.model.ShapeGroup;
+import org.apache.poi.hslf.model.HSLFShape;
+import org.apache.poi.hslf.model.HSLFGroupShape;
 import org.apache.poi.hslf.model.Slide;
 import org.apache.poi.hslf.model.SlideMaster;
 import org.apache.poi.hslf.model.TextBox;
@@ -165,11 +165,11 @@ public final class TestBugs {
         HSLFSlideShow hslf = new HSLFSlideShow(_slTests.openResourceAsStream("42485.ppt"));
 
         SlideShow ppt = new SlideShow(hslf);
-        Shape[] shape = ppt.getSlides()[0].getShapes();
+        HSLFShape[] 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();
+            if(shape[i] instanceof HSLFGroupShape){
+                HSLFGroupShape  group = (HSLFGroupShape)shape[i];
+                HSLFShape[] sh = group.getShapes();
                 for (int j = 0; j < sh.length; j++) {
                     if( sh[j] instanceof TextBox){
                         TextBox txt = (TextBox)sh[j];
@@ -188,12 +188,12 @@ public final class TestBugs {
         HSLFSlideShow hslf = new HSLFSlideShow(_slTests.openResourceAsStream("42485.ppt"));
 
         SlideShow ppt = new SlideShow(hslf);
-        Shape[] shape = ppt.getSlides()[0].getShapes();
+        HSLFShape[] shape = ppt.getSlides()[0].getShapes();
         for (int i = 0; i < shape.length; i++) {
-            if(shape[i] instanceof ShapeGroup){
-                ShapeGroup  group = (ShapeGroup)shape[i];
+            if(shape[i] instanceof HSLFGroupShape){
+                HSLFGroupShape  group = (HSLFGroupShape)shape[i];
                 assertNotNull(group.getAnchor());
-                Shape[] sh = group.getShapes();
+                HSLFShape[] sh = group.getShapes();
                 for (int j = 0; j < sh.length; j++) {
                     assertNotNull(sh[j].getAnchor());
                 }
@@ -233,7 +233,7 @@ public final class TestBugs {
         Slide[] slide = ppt.getSlides();
         for (int i = 0; i < slide.length; i++) {
             @SuppressWarnings("unused")
-            Shape[] shape = slide[i].getShapes();
+            HSLFShape[] shape = slide[i].getShapes();
         }
         assertTrue("No Exceptions while reading file", true);
 
@@ -250,12 +250,12 @@ public final class TestBugs {
         //walk down the tree and see if there were no errors while reading
         Slide[] slide = ppt.getSlides();
         for (int i = 0; i < slide.length; i++) {
-            Shape[] shape = slide[i].getShapes();
+            HSLFShape[] shape = slide[i].getShapes();
             for (int j = 0; j < shape.length; j++) {
                 assertNotNull(shape[j].getShapeName());
-                if (shape[j] instanceof ShapeGroup){
-                    ShapeGroup group = (ShapeGroup)shape[j];
-                    Shape[] comps = group.getShapes();
+                if (shape[j] instanceof HSLFGroupShape){
+                    HSLFGroupShape group = (HSLFGroupShape)shape[j];
+                    HSLFShape[] comps = group.getShapes();
                     for (int k = 0; k < comps.length; k++) {
                         assertNotNull(comps[k].getShapeName());
                    }
@@ -277,20 +277,20 @@ public final class TestBugs {
         SlideShow ppt = new SlideShow(hslf);
 
         //test case from the bug report
-        ShapeGroup shapeGroup = (ShapeGroup)ppt.getSlides()[11].getShapes()[10];
+        HSLFGroupShape shapeGroup = (HSLFGroupShape)ppt.getSlides()[11].getShapes()[10];
         Picture picture = (Picture)shapeGroup.getShapes()[0];
         picture.getPictureData();
 
         //walk down the tree and see if there were no errors while reading
         Slide[] slide = ppt.getSlides();
         for (int i = 0; i < slide.length; i++) {
-            Shape[] shape = slide[i].getShapes();
+            HSLFShape[] shape = slide[i].getShapes();
             for (int j = 0; j < shape.length; j++) {
-              if (shape[j] instanceof ShapeGroup){
-                    ShapeGroup group = (ShapeGroup)shape[j];
-                    Shape[] comps = group.getShapes();
+              if (shape[j] instanceof HSLFGroupShape){
+                    HSLFGroupShape group = (HSLFGroupShape)shape[j];
+                    HSLFShape[] comps = group.getShapes();
                     for (int k = 0; k < comps.length; k++) {
-                        Shape comp = comps[k];
+                        HSLFShape comp = comps[k];
                         if (comp instanceof Picture){
                             @SuppressWarnings("unused")
                             PictureData pict = ((Picture)comp).getPictureData();
@@ -355,7 +355,7 @@ public final class TestBugs {
 
         // Check the shape based text runs
         List<TextRun> lst = new ArrayList<TextRun>();
-        Shape[] shape = slide.getShapes();
+        HSLFShape[] shape = slide.getShapes();
         for (int i = 0; i < shape.length; i++) {
             if( shape[i] instanceof TextShape){
                 TextRun textRun = ((TextShape)shape[i]).getTextRun();
@@ -413,7 +413,7 @@ public final class TestBugs {
         SlideShow ppt = new SlideShow(_slTests.openResourceAsStream("41071.ppt"));
 
         Slide slide = ppt.getSlides()[0];
-        Shape[] sh = slide.getShapes();
+        HSLFShape[] sh = slide.getShapes();
         assertEquals(1, sh.length);
         assertTrue(sh[0] instanceof TextShape);
         TextShape tx = (TextShape)sh[0];
@@ -492,7 +492,7 @@ public final class TestBugs {
 
         // get slides
         for (Slide slide : ppt.getSlides()) {
-            for (Shape shape : slide.getShapes()) {
+            for (HSLFShape shape : slide.getShapes()) {
                 if (!(shape instanceof TextBox)) continue;
                 TextBox tb = (TextBox) shape;
                 // work with TextBox
@@ -595,7 +595,7 @@ public final class TestBugs {
         try {
             SlideShow slideShow = new SlideShow(inputStream);
             Slide slide = slideShow.getSlides()[0];
-            ShapeGroup sg = (ShapeGroup)slide.getShapes()[0];
+            HSLFGroupShape sg = (HSLFGroupShape)slide.getShapes()[0];
             TextBox tb = (TextBox)sg.getShapes()[0];
             String text = StringUtil.mapMsCodepointString(tb.getText());
             assertEquals("\u226575 years", text);
@@ -640,7 +640,7 @@ public final class TestBugs {
             SlideShow slideShow = new SlideShow(inputStream);
             AutoShape as = (AutoShape)slideShow.getSlides()[0].getShapes()[0];
             EscherOptRecord opt = as.getEscherOptRecord();
-            EscherArrayProperty ep = Shape.getEscherProperty(opt, EscherProperties.FILL__SHADECOLORS);
+            EscherArrayProperty ep = HSLFShape.getEscherProperty(opt, EscherProperties.FILL__SHADECOLORS);
             double exp[][] = {
                 // r, g, b, position
                 { 94, 158, 255, 0 },

Modified: poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestPictures.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestPictures.java?rev=1664935&r1=1664934&r2=1664935&view=diff
==============================================================================
--- poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestPictures.java
(original)
+++ poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestPictures.java
Sat Mar  7 23:35:40 2015
@@ -34,7 +34,7 @@ import org.apache.poi.hslf.blip.PICT;
 import org.apache.poi.hslf.blip.PNG;
 import org.apache.poi.hslf.blip.WMF;
 import org.apache.poi.hslf.model.Picture;
-import org.apache.poi.hslf.model.Shape;
+import org.apache.poi.hslf.model.HSLFShape;
 import org.apache.poi.hslf.model.Slide;
 
 /**
@@ -68,7 +68,7 @@ public final class TestPictures extends
         ppt = new SlideShow(new HSLFSlideShow(new ByteArrayInputStream(out.toByteArray())));
 
         //make sure we can read this picture shape and it refers to the correct picture data
-        Shape[] sh = ppt.getSlides()[0].getShapes();
+        HSLFShape[] sh = ppt.getSlides()[0].getShapes();
         assertEquals(1, sh.length);
         pict = (Picture)sh[0];
         assertEquals(idx, pict.getPictureIndex());
@@ -113,7 +113,7 @@ public final class TestPictures extends
         ppt = new SlideShow(new HSLFSlideShow(new ByteArrayInputStream(out.toByteArray())));
 
         //make sure we can read this picture shape and it refers to the correct picture data
-        Shape[] sh = ppt.getSlides()[0].getShapes();
+        HSLFShape[] sh = ppt.getSlides()[0].getShapes();
         assertEquals(1, sh.length);
         pict = (Picture)sh[0];
         assertEquals(idx, pict.getPictureIndex());
@@ -159,7 +159,7 @@ public final class TestPictures extends
         ppt = new SlideShow(new HSLFSlideShow(new ByteArrayInputStream(out.toByteArray())));
 
         //make sure we can get this picture shape and it refers to the correct picture data
-        Shape[] sh = ppt.getSlides()[0].getShapes();
+        HSLFShape[] sh = ppt.getSlides()[0].getShapes();
         assertEquals(1, sh.length);
         pict = (Picture)sh[0];
         assertEquals(idx, pict.getPictureIndex());
@@ -198,7 +198,7 @@ public final class TestPictures extends
         ppt = new SlideShow(new HSLFSlideShow(new ByteArrayInputStream(out.toByteArray())));
 
         //make sure we can read this picture shape and it refers to the correct picture data
-        Shape[] sh = ppt.getSlides()[0].getShapes();
+        HSLFShape[] sh = ppt.getSlides()[0].getShapes();
         assertEquals(1, sh.length);
         pict = (Picture)sh[0];
         assertEquals(idx, pict.getPictureIndex());
@@ -238,7 +238,7 @@ public final class TestPictures extends
         ppt = new SlideShow(new HSLFSlideShow(new ByteArrayInputStream(out.toByteArray())));
 
         //make sure we can read this picture shape and it refers to the correct picture data
-        Shape[] sh = ppt.getSlides()[0].getShapes();
+        HSLFShape[] sh = ppt.getSlides()[0].getShapes();
         assertEquals(1, sh.length);
         pict = (Picture)sh[0];
         assertEquals(idx, pict.getPictureIndex());
@@ -277,7 +277,7 @@ public final class TestPictures extends
         ppt = new SlideShow(new HSLFSlideShow(new ByteArrayInputStream(out.toByteArray())));
 
         //make sure we can read this picture shape and it refers to the correct picture data
-        Shape[] sh = ppt.getSlides()[0].getShapes();
+        HSLFShape[] sh = ppt.getSlides()[0].getShapes();
         assertEquals(1, sh.length);
         pict = (Picture)sh[0];
         assertEquals(idx, pict.getPictureIndex());

Modified: poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestTable.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestTable.java?rev=1664935&r1=1664934&r2=1664935&view=diff
==============================================================================
--- poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestTable.java
(original)
+++ poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestTable.java
Sat Mar  7 23:35:40 2015
@@ -21,7 +21,7 @@ package org.apache.poi.hslf.usermodel;
 
 import junit.framework.TestCase;
 
-import org.apache.poi.hslf.model.Shape;
+import org.apache.poi.hslf.model.HSLFShape;
 import org.apache.poi.hslf.model.Slide;
 import org.apache.poi.hslf.model.Table;
 import org.apache.poi.hslf.model.TextRun;
@@ -58,7 +58,7 @@ public final class TestTable extends Tes
 
 		assertEquals("Dummy text", textRuns[1].getRawText());
 		
-		final Shape[] shapes = s.getShapes();
+		final HSLFShape[] shapes = s.getShapes();
 		assertNotNull(shapes);
 		assertEquals(3, shapes.length);
 		assertTrue(shapes[2] instanceof Table);



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message