poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r746085 [2/2] - in /poi/trunk/src: java/org/apache/poi/hssf/model/ java/org/apache/poi/hssf/record/ scratchpad/src/org/apache/poi/hslf/dev/ scratchpad/src/org/apache/poi/hslf/model/ scratchpad/src/org/apache/poi/hslf/record/ scratchpad/src/...
Date Fri, 20 Feb 2009 01:55:49 GMT
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/ShapeGroup.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/ShapeGroup.java?rev=746085&r1=746084&r2=746085&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/ShapeGroup.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/ShapeGroup.java Fri Feb 20 01:55:47
2009
@@ -14,18 +14,24 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 ==================================================================== */
-package org.apache.poi.hslf.model;
 
-import org.apache.poi.ddf.*;
-import org.apache.poi.util.LittleEndian;
-import org.apache.poi.util.POILogger;
-import org.apache.poi.hslf.record.EscherTextboxWrapper;
+package org.apache.poi.hslf.model;
 
+import java.awt.Graphics2D;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Rectangle2D;
 import java.util.ArrayList;
+import java.util.Iterator;
 import java.util.List;
-import java.awt.geom.Rectangle2D;
-import java.awt.geom.AffineTransform;
-import java.awt.*;
+
+import org.apache.poi.ddf.EscherChildAnchorRecord;
+import org.apache.poi.ddf.EscherClientAnchorRecord;
+import org.apache.poi.ddf.EscherContainerRecord;
+import org.apache.poi.ddf.EscherRecord;
+import org.apache.poi.ddf.EscherSpRecord;
+import org.apache.poi.ddf.EscherSpgrRecord;
+import org.apache.poi.util.LittleEndian;
+import org.apache.poi.util.POILogger;
 
 /**
  *  Represents a group of shapes.
@@ -57,14 +63,17 @@
      * @return the shapes contained in this group container
      */
     public Shape[] getShapes() {
-    	// Out escher container record should contain serveral
+    	// Out escher container record should contain several
         //  SpContainers, the first of which is the group shape itself
-        List lst = _escherContainer.getChildRecords();
+        Iterator<EscherRecord> iter = _escherContainer.getChildIterator();
 
-        ArrayList shapeList = new ArrayList();
         // Don't include the first SpContainer, it is always NotPrimitive
-        for (int i = 1; i < lst.size(); i++){
-        	EscherRecord r = (EscherRecord)lst.get(i);
+        if (iter.hasNext()) {
+        	iter.next();
+        }
+        List<Shape> shapeList = new ArrayList<Shape>();
+        while (iter.hasNext()) {
+        	EscherRecord r = iter.next();
         	if(r instanceof EscherContainerRecord) {
         		// Create the Shape for it
         		EscherContainerRecord container = (EscherContainerRecord)r;
@@ -79,7 +88,7 @@
         }
         
         // Put the shapes into an array, and return
-        Shape[] shapes = (Shape[])shapeList.toArray(new Shape[shapeList.size()]);
+        Shape[] shapes = shapeList.toArray(new Shape[shapeList.size()]);
         return shapes;
     }
 
@@ -91,7 +100,7 @@
      */
     public void setAnchor(java.awt.Rectangle anchor){
 
-        EscherContainerRecord spContainer = (EscherContainerRecord)_escherContainer.getChildRecords().get(0);
+        EscherContainerRecord spContainer = (EscherContainerRecord)_escherContainer.getChild(0);
 
         EscherClientAnchorRecord clientAnchor = (EscherClientAnchorRecord)getEscherChild(spContainer,
EscherClientAnchorRecord.RECORD_ID);
         //hack. internal variable EscherClientAnchorRecord.shortRecord can be
@@ -122,7 +131,7 @@
      * @param anchor the coordinate space of this group
      */
     public void setCoordinates(Rectangle2D anchor){
-        EscherContainerRecord spContainer = (EscherContainerRecord)_escherContainer.getChildRecords().get(0);
+        EscherContainerRecord spContainer = (EscherContainerRecord)_escherContainer.getChild(0);
         EscherSpgrRecord spgr = (EscherSpgrRecord)getEscherChild(spContainer, EscherSpgrRecord.RECORD_ID);
 
         int x1 = (int)Math.round(anchor.getX()*MASTER_DPI/POINT_DPI);
@@ -144,7 +153,7 @@
      * @return the coordinate space of this group
      */
     public Rectangle2D getCoordinates(){
-        EscherContainerRecord spContainer = (EscherContainerRecord)_escherContainer.getChildRecords().get(0);
+        EscherContainerRecord spContainer = (EscherContainerRecord)_escherContainer.getChild(0);
         EscherSpgrRecord spgr = (EscherSpgrRecord)getEscherChild(spContainer, EscherSpgrRecord.RECORD_ID);
 
         Rectangle2D.Float anchor = new Rectangle2D.Float();
@@ -228,7 +237,7 @@
      * @return the anchor of this shape group
      */
     public Rectangle2D getAnchor2D(){
-        EscherContainerRecord spContainer = (EscherContainerRecord)_escherContainer.getChildRecords().get(0);
+        EscherContainerRecord spContainer = (EscherContainerRecord)_escherContainer.getChild(0);
         EscherClientAnchorRecord clientAnchor = (EscherClientAnchorRecord)getEscherChild(spContainer,
EscherClientAnchorRecord.RECORD_ID);
         Rectangle2D.Float anchor = new Rectangle2D.Float();
         if(clientAnchor == null){

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Sheet.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Sheet.java?rev=746085&r1=746084&r2=746085&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Sheet.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Sheet.java Fri Feb 20 01:55:47
2009
@@ -211,26 +211,32 @@
 
         EscherContainerRecord dg = (EscherContainerRecord) ppdrawing.getEscherRecords()[0];
         EscherContainerRecord spgr = null;
-        List ch = dg.getChildRecords();
 
-        for (Iterator it = ch.iterator(); it.hasNext();) {
-            EscherRecord rec = (EscherRecord) it.next();
+        for (Iterator<EscherRecord> it = dg.getChildIterator(); it.hasNext();) {
+            EscherRecord rec = it.next();
             if (rec.getRecordId() == EscherContainerRecord.SPGR_CONTAINER) {
                 spgr = (EscherContainerRecord) rec;
                 break;
             }
         }
-        ch = spgr.getChildRecords();
+        if (spgr == null) {
+            throw new IllegalStateException("spgr not found");
+        }
 
-        ArrayList shapes = new ArrayList();
-        for (int i = 1; i < ch.size(); i++) {
-            EscherContainerRecord sp = (EscherContainerRecord) ch.get(i);
+        List<Shape> shapes = new ArrayList<Shape>();
+        Iterator<EscherRecord> it = spgr.getChildIterator();
+        if (it.hasNext()) {
+            // skip first item
+            it.next();
+        }
+        for (; it.hasNext();) {
+            EscherContainerRecord sp = (EscherContainerRecord) it.next();
             Shape sh = ShapeFactory.createShape(sp, null);
             sh.setSheet(this);
             shapes.add(sh);
         }
 
-        return (Shape[]) shapes.toArray(new Shape[shapes.size()]);
+        return shapes.toArray(new Shape[shapes.size()]);
     }
 
     /**
@@ -301,17 +307,21 @@
         EscherContainerRecord dg = (EscherContainerRecord) ppdrawing.getEscherRecords()[0];
         EscherContainerRecord spgr = null;
 
-        for (Iterator it = dg.getChildRecords().iterator(); it.hasNext();) {
-            EscherRecord rec = (EscherRecord) it.next();
+        for (Iterator<EscherRecord> it = dg.getChildIterator(); it.hasNext();) {
+            EscherRecord rec = it.next();
             if (rec.getRecordId() == EscherContainerRecord.SPGR_CONTAINER) {
                 spgr = (EscherContainerRecord) rec;
                 break;
             }
         }
-        if(spgr == null) return false;
+        if(spgr == null) {
+            return false;
+        }
 
-        List lst = spgr.getChildRecords();
-        return lst.remove(shape.getSpContainer());
+        List<EscherRecord> lst = spgr.getChildRecords();
+        boolean result = lst.remove(shape.getSpContainer());
+        spgr.setChildRecords(lst);
+        return result;
     }
 
     /**
@@ -344,10 +354,9 @@
 
             EscherContainerRecord dg = (EscherContainerRecord) ppdrawing.getEscherRecords()[0];
             EscherContainerRecord spContainer = null;
-            List ch = dg.getChildRecords();
 
-            for (Iterator it = ch.iterator(); it.hasNext();) {
-                EscherRecord rec = (EscherRecord) it.next();
+            for (Iterator<EscherRecord> it = dg.getChildIterator(); it.hasNext();)
{
+                EscherRecord rec = it.next();
                 if (rec.getRecordId() == EscherContainerRecord.SP_CONTAINER) {
                     spContainer = (EscherContainerRecord) rec;
                     break;

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/SimpleShape.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/SimpleShape.java?rev=746085&r1=746084&r2=746085&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/SimpleShape.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/SimpleShape.java Fri Feb 20 01:55:47
2009
@@ -17,19 +17,20 @@
 
 package org.apache.poi.hslf.model;
 
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Rectangle2D;
+import java.io.ByteArrayOutputStream;
+
 import org.apache.poi.ddf.*;
-import org.apache.poi.util.LittleEndian;
+import org.apache.poi.ddf.EscherSpRecord;
+import org.apache.poi.hslf.exceptions.HSLFException;
 import org.apache.poi.hslf.record.ColorSchemeAtom;
-import org.apache.poi.hslf.record.Record;
 import org.apache.poi.hslf.record.InteractiveInfo;
 import org.apache.poi.hslf.record.InteractiveInfoAtom;
-import org.apache.poi.hslf.exceptions.HSLFException;
-
-import java.awt.*;
-import java.awt.geom.AffineTransform;
-import java.awt.geom.Rectangle2D;
-import java.util.Iterator;
-import java.io.ByteArrayOutputStream;
+import org.apache.poi.hslf.record.Record;
+import org.apache.poi.util.LittleEndian;
 
 /**
  *  An abstract simple (non-group) shape.
@@ -256,8 +257,8 @@
             Rectangle2D clientAnchor = top.getAnchor2D();
             Rectangle2D spgrAnchor = ((ShapeGroup)top).getCoordinates();
 
-            double scalex = (double)spgrAnchor.getWidth()/clientAnchor.getWidth();
-            double scaley = (double)spgrAnchor.getHeight()/clientAnchor.getHeight();
+            double scalex = spgrAnchor.getWidth()/clientAnchor.getWidth();
+            double scaley = spgrAnchor.getHeight()/clientAnchor.getHeight();
 
             double x = clientAnchor.getX() + (anchor.getX() - spgrAnchor.getX())/scalex;
             double y = clientAnchor.getY() + (anchor.getY() - spgrAnchor.getY())/scaley;
@@ -353,7 +354,7 @@
 
         EscherClientDataRecord cldata = new EscherClientDataRecord();
         cldata.setOptions((short)0xF);
-        getSpContainer().getChildRecords().add(cldata);
+        getSpContainer().addChildRecord(cldata); // TODO - junit to prove getChildRecords().add
is wrong
 
         InteractiveInfo info = new InteractiveInfo();
         InteractiveInfoAtom infoAtom = info.getInteractiveInfoAtom();

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Slide.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Slide.java?rev=746085&r1=746084&r2=746085&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Slide.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Slide.java Fri Feb 20 01:55:47
2009
@@ -152,7 +152,7 @@
             EscherSpRecord spr = null;
             switch(c.getRecordId()){
                 case EscherContainerRecord.SPGR_CONTAINER:
-                    EscherContainerRecord dc = (EscherContainerRecord)c.getChildRecords().get(0);
+                    EscherContainerRecord dc = (EscherContainerRecord)c.getChild(0);
                     spr = dc.getChildById(EscherSpRecord.RECORD_ID);
                     break;
                 case EscherContainerRecord.SP_CONTAINER:

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Table.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Table.java?rev=746085&r1=746084&r2=746085&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Table.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Table.java Fri Feb 20 01:55:47
2009
@@ -73,7 +73,6 @@
         setAnchor(new Rectangle(0, 0, tblWidth, tblHeight));
 
         EscherContainerRecord spCont = (EscherContainerRecord) getSpContainer().getChild(0);
-        List lst = spCont.getChildRecords();
         EscherOptRecord opt = new EscherOptRecord();
         opt.setRecordId((short)0xF122);
         opt.addEscherProperty(new EscherSimpleProperty((short)0x39F, 1));
@@ -82,8 +81,9 @@
         p.setNumberOfElementsInArray(numrows);
         p.setNumberOfElementsInMemory(numrows);
         opt.addEscherProperty(p);
+        List<EscherRecord> lst = spCont.getChildRecords();
         lst.add(lst.size()-1, opt);
-
+        spCont.setChildRecords(lst);
     }
 
     /**
@@ -118,7 +118,7 @@
         super.afterInsert(sh);
 
         EscherContainerRecord spCont = (EscherContainerRecord) getSpContainer().getChild(0);
-        List lst = spCont.getChildRecords();
+        List<EscherRecord> lst = spCont.getChildRecords();
         EscherOptRecord opt = (EscherOptRecord)lst.get(lst.size()-2);
         EscherArrayProperty p = (EscherArrayProperty)opt.getEscherProperty(1);
         for (int i = 0; i < cells.length; i++) {

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/PPDrawing.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/PPDrawing.java?rev=746085&r1=746084&r2=746085&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/PPDrawing.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/PPDrawing.java Fri Feb 20 01:55:47
2009
@@ -175,11 +175,9 @@
 			} else {
 				// If it has children, walk them
 				if(toSearch[i].isContainerRecord()) {
-					List childrenL = toSearch[i].getChildRecords();
+					List<EscherRecord> childrenL = toSearch[i].getChildRecords();
 					EscherRecord[] children = new EscherRecord[childrenL.size()];
-					for(int j=0; j< children.length; j++) {
-						children[j] = (EscherRecord)childrenL.get(j);
-					}
+					childrenL.toArray(children);
 					findEscherTextboxRecord(children,found);
 				}
 			}
@@ -309,8 +307,8 @@
     public EscherDgRecord getEscherDgRecord(){
         if(dg == null){
             EscherContainerRecord dgContainer = (EscherContainerRecord)childRecords[0];
-            for(Iterator it = dgContainer.getChildRecords().iterator(); it.hasNext();){
-                EscherRecord r = (EscherRecord) it.next();
+            for(Iterator<EscherRecord> it = dgContainer.getChildIterator(); it.hasNext();){
+                EscherRecord r = it.next();
                 if(r instanceof EscherDgRecord){
                     dg = (EscherDgRecord)r;
                     break;

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/PPDrawingGroup.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/PPDrawingGroup.java?rev=746085&r1=746084&r2=746085&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/PPDrawingGroup.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/PPDrawingGroup.java Fri Feb 20
01:55:47 2009
@@ -71,15 +71,14 @@
 
     public void writeOut(OutputStream out) throws IOException {
         ByteArrayOutputStream bout = new ByteArrayOutputStream();
-        List child = dggContainer.getChildRecords();
-        for (int i = 0; i < child.size(); i++) {
-            EscherRecord r = (EscherRecord)child.get(i);
+        Iterator<EscherRecord> iter = dggContainer.getChildIterator();
+        while (iter.hasNext()) {
+        	EscherRecord r = iter.next();
             if (r.getRecordId() == EscherContainerRecord.BSTORE_CONTAINER){
                 EscherContainerRecord bstore = (EscherContainerRecord)r;
 
                 ByteArrayOutputStream b2 = new ByteArrayOutputStream();
-                List blip = bstore.getChildRecords();
-                for (Iterator it=blip.iterator(); it.hasNext();) {
+                for (Iterator<EscherRecord> it= bstore.getChildIterator(); it.hasNext();)
{
                     EscherBSERecord bse = (EscherBSERecord)it.next();
                     byte[] b = new byte[36+8];
                     bse.serialize(0, b);
@@ -121,8 +120,8 @@
 
     public EscherDggRecord getEscherDggRecord(){
         if(dgg == null){
-            for(Iterator it = dggContainer.getChildRecords().iterator(); it.hasNext();){
-                EscherRecord r = (EscherRecord) it.next();
+            for(Iterator<EscherRecord> it = dggContainer.getChildIterator(); it.hasNext();){
+                EscherRecord r = it.next();
                 if(r instanceof EscherDggRecord){
                     dgg = (EscherDggRecord)r;
                     break;

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/SlideShow.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/SlideShow.java?rev=746085&r1=746084&r2=746085&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/SlideShow.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/SlideShow.java Fri Feb 20 01:55:47
2009
@@ -746,19 +746,11 @@
             bstore = new EscherContainerRecord();
             bstore.setRecordId( EscherContainerRecord.BSTORE_CONTAINER);
 
-            List child = dggContainer.getChildRecords();
-            for ( int i = 0; i < child.size(); i++ ) {
-                EscherRecord rec = (EscherRecord)child.get(i);
-                if (rec.getRecordId() == EscherOptRecord.RECORD_ID){
-                    child.add(i, bstore);
-                    i++;
-                }
-            }
-            dggContainer.setChildRecords(child);
+            dggContainer.addChildBefore(bstore, EscherOptRecord.RECORD_ID);
         } else {
-            List lst = bstore.getChildRecords();
-            for ( int i = 0; i < lst.size(); i++ ) {
-                EscherBSERecord bse = (EscherBSERecord) lst.get(i);
+            Iterator<EscherRecord> iter = bstore.getChildIterator();
+            for (int i = 0; iter.hasNext(); i++) {
+                EscherBSERecord bse = (EscherBSERecord) iter.next();
                 if (Arrays.equals(bse.getUid(), uid)){
                     return i + 1;
                 }

Modified: poi/trunk/src/testcases/org/apache/poi/ddf/TestEscherBlipRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ddf/TestEscherBlipRecord.java?rev=746085&r1=746084&r2=746085&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/ddf/TestEscherBlipRecord.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/ddf/TestEscherBlipRecord.java Fri Feb 20 01:55:47
2009
@@ -44,8 +44,8 @@
 
         EscherContainerRecord record = new EscherContainerRecord();
         record.fillFields(data, 0, new DefaultEscherRecordFactory());
-        EscherContainerRecord bstore = (EscherContainerRecord)record.getChildRecords().get(1);
-        EscherBSERecord bse1 = (EscherBSERecord)bstore.getChildRecords().get(0);
+        EscherContainerRecord bstore = (EscherContainerRecord)record.getChild(1);
+        EscherBSERecord bse1 = (EscherBSERecord)bstore.getChild(0);
         assertEquals(EscherBSERecord.BT_PNG, bse1.getBlipTypeWin32());
         assertEquals(EscherBSERecord.BT_PNG, bse1.getBlipTypeMacOS());
         assertTrue(Arrays.equals(new byte[]{
@@ -89,8 +89,8 @@
 
         EscherContainerRecord record = new EscherContainerRecord();
         record.fillFields(data, 0, new DefaultEscherRecordFactory());
-        EscherContainerRecord bstore = (EscherContainerRecord)record.getChildRecords().get(1);
-        EscherBSERecord bse1 = (EscherBSERecord)bstore.getChildRecords().get(1);
+        EscherContainerRecord bstore = (EscherContainerRecord)record.getChild(1);
+        EscherBSERecord bse1 = (EscherBSERecord)bstore.getChild(1);
         //System.out.println(bse1);
         assertEquals(EscherBSERecord.BT_WMF, bse1.getBlipTypeWin32());
         assertEquals(EscherBSERecord.BT_PICT, bse1.getBlipTypeMacOS());

Modified: poi/trunk/src/testcases/org/apache/poi/hssf/record/TestEscherAggregate.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hssf/record/TestEscherAggregate.java?rev=746085&r1=746084&r2=746085&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/hssf/record/TestEscherAggregate.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/hssf/record/TestEscherAggregate.java Fri Feb 20
01:55:47 2009
@@ -34,15 +34,11 @@
  *
  * @author Glen Stampoultzis (glens at apache.org)
  */
-public class TestEscherAggregate extends TestCase
-{
+public final class TestEscherAggregate extends TestCase {
     /**
      * Tests that the create aggregate method correctly rejoins escher records together.
-     *
-     * @throws Exception
      */
-    public void testCreateAggregate() throws Exception
-    {
+    public void testCreateAggregate() {
         String msoDrawingRecord1 =
                 "0F 00 02 F0 20 01 00 00 10 00 08 F0 08 00 00 00 \n" +
                 "03 00 00 00 02 04 00 00 0F 00 03 F0 08 01 00 00 \n" +
@@ -76,7 +72,7 @@
 
         ObjRecord r2 = new ObjRecord();
 
-        List records = new ArrayList();
+        List<Record> records = new ArrayList<Record>();
         records.add( d1 );
         records.add( r1 );
         records.add( d2 );
@@ -92,8 +88,7 @@
 //        System.out.println( "aggregate = " + aggregate );
     }
 
-    public void testSerialize() throws Exception
-    {
+    public void testSerialize() {
 
         EscherContainerRecord container1 = new EscherContainerRecord();
         EscherContainerRecord spContainer1 = new EscherContainerRecord();
@@ -127,8 +122,8 @@
 
         EscherAggregate aggregate = new EscherAggregate(null);
         aggregate.addEscherRecord( container1 );
-        aggregate.assoicateShapeToObjRecord( d2, new ObjRecord() );
-        aggregate.assoicateShapeToObjRecord( d3, new ObjRecord() );
+        aggregate.associateShapeToObjRecord( d2, new ObjRecord() );
+        aggregate.associateShapeToObjRecord( d3, new ObjRecord() );
 
         byte[] data = new byte[112];
         int bytesWritten = aggregate.serialize( 0, data );
@@ -136,5 +131,4 @@
         assertEquals( "[EC, 00, 40, 00, 0F, 00, 00, 00, 58, 00, 00, 00, 0F, 00, 04, F0, 10,
00, 00, 00, 00, 00, 0A, F0, 08, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 0F, 00, 04, F0,
18, 00, 00, 00, 00, 00, 0A, F0, 08, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 11,
F0, 00, 00, 00, 00, 5D, 00, 00, 00, EC, 00, 20, 00, 0F, 00, 04, F0, 18, 00, 00, 00, 00, 00,
0A, F0, 08, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 11, F0, 00, 00, 00, 00, 5D,
00, 00, 00]",
                 HexDump.toHex( data ) );
     }
-
 }



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


Mime
View raw message