poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ber...@apache.org
Subject svn commit: r1368670 - in /poi/branches/gsoc2012/src: java/org/apache/poi/hssf/record/EscherAggregate.java java/org/apache/poi/hssf/usermodel/HSSFShapeGroup.java testcases/org/apache/poi/hssf/model/TestDrawingShapes.java
Date Thu, 02 Aug 2012 19:52:47 GMT
Author: berlog
Date: Thu Aug  2 19:52:47 2012
New Revision: 1368670

URL: http://svn.apache.org/viewvc?rev=1368670&view=rev
Log:
fixed compilation for jdk 1.5

Modified:
    poi/branches/gsoc2012/src/java/org/apache/poi/hssf/record/EscherAggregate.java
    poi/branches/gsoc2012/src/java/org/apache/poi/hssf/usermodel/HSSFShapeGroup.java
    poi/branches/gsoc2012/src/testcases/org/apache/poi/hssf/model/TestDrawingShapes.java

Modified: poi/branches/gsoc2012/src/java/org/apache/poi/hssf/record/EscherAggregate.java
URL: http://svn.apache.org/viewvc/poi/branches/gsoc2012/src/java/org/apache/poi/hssf/record/EscherAggregate.java?rev=1368670&r1=1368669&r2=1368670&view=diff
==============================================================================
--- poi/branches/gsoc2012/src/java/org/apache/poi/hssf/record/EscherAggregate.java (original)
+++ poi/branches/gsoc2012/src/java/org/apache/poi/hssf/record/EscherAggregate.java Thu Aug
 2 19:52:47 2012
@@ -553,7 +553,9 @@ public final class EscherAggregate exten
                     drawing.setData(buf);
                     temp += drawing.serialize(pos + temp, data);
                 } else {
-                    ContinueRecord drawing = new ContinueRecord(Arrays.copyOfRange(drawingData,
j, Math.min(j + RecordInputStream.MAX_RECORD_DATA_SIZE, drawingData.length)));
+                    byte[] buf = new byte[Math.min(RecordInputStream.MAX_RECORD_DATA_SIZE,
drawingData.length - j)];
+                    System.arraycopy(drawingData, j, buf, 0, Math.min(RecordInputStream.MAX_RECORD_DATA_SIZE,
drawingData.length - j));
+                    ContinueRecord drawing = new ContinueRecord(buf);
                     temp += drawing.serialize(pos + temp, data);
                 }
             }
@@ -708,7 +710,8 @@ public final class EscherAggregate exten
 
     public void setMainSpRecordId(int shapeId) {
         EscherContainerRecord dgContainer = getEscherContainer();
-        EscherContainerRecord spContainer = (EscherContainerRecord) dgContainer.getChildById(EscherContainerRecord.SPGR_CONTAINER).getChild(0);
+        EscherContainerRecord spgrConatiner = (EscherContainerRecord) dgContainer.getChildById(EscherContainerRecord.SPGR_CONTAINER);
+        EscherContainerRecord spContainer = (EscherContainerRecord) spgrConatiner.getChild(0);
         EscherSpRecord sp = (EscherSpRecord) spContainer.getChildById(EscherSpRecord.RECORD_ID);
         sp.setShapeId(shapeId);
     }

Modified: poi/branches/gsoc2012/src/java/org/apache/poi/hssf/usermodel/HSSFShapeGroup.java
URL: http://svn.apache.org/viewvc/poi/branches/gsoc2012/src/java/org/apache/poi/hssf/usermodel/HSSFShapeGroup.java?rev=1368670&r1=1368669&r2=1368670&view=diff
==============================================================================
--- poi/branches/gsoc2012/src/java/org/apache/poi/hssf/usermodel/HSSFShapeGroup.java (original)
+++ poi/branches/gsoc2012/src/java/org/apache/poi/hssf/usermodel/HSSFShapeGroup.java Thu Aug
 2 19:52:47 2012
@@ -346,7 +346,8 @@ public class HSSFShapeGroup extends HSSF
         spgrContainer.setRecordId(EscherContainerRecord.SPGR_CONTAINER);
         spgrContainer.setOptions((short) 0x000F);
         EscherContainerRecord spContainer = new EscherContainerRecord();
-        byte [] inSp = getEscherContainer().getChildById(EscherContainerRecord.SP_CONTAINER).serialize();
+        EscherContainerRecord cont = getEscherContainer().getChildById(EscherContainerRecord.SP_CONTAINER);
+        byte [] inSp = cont.serialize();
         spContainer.fillFields(inSp, 0, new DefaultEscherRecordFactory());
 
         spgrContainer.addChildRecord(spContainer);

Modified: poi/branches/gsoc2012/src/testcases/org/apache/poi/hssf/model/TestDrawingShapes.java
URL: http://svn.apache.org/viewvc/poi/branches/gsoc2012/src/testcases/org/apache/poi/hssf/model/TestDrawingShapes.java?rev=1368670&r1=1368669&r2=1368670&view=diff
==============================================================================
--- poi/branches/gsoc2012/src/testcases/org/apache/poi/hssf/model/TestDrawingShapes.java (original)
+++ poi/branches/gsoc2012/src/testcases/org/apache/poi/hssf/model/TestDrawingShapes.java Thu
Aug  2 19:52:47 2012
@@ -351,13 +351,15 @@ public class TestDrawingShapes extends T
         String opt1Str = opt.toXml();
 
         textbox.setFillColor(textbox.getFillColor());
-        assertEquals(opt1Str, HSSFTestHelper.getEscherContainer(textbox).getChildById(EscherOptRecord.RECORD_ID).toXml());
+        EscherContainerRecord container = HSSFTestHelper.getEscherContainer(textbox);
+        EscherOptRecord optRecord = container.getChildById(EscherOptRecord.RECORD_ID);
+        assertEquals(opt1Str, optRecord.toXml());
         textbox.setLineStyle(textbox.getLineStyle());
-        assertEquals(opt1Str, HSSFTestHelper.getEscherContainer(textbox).getChildById(EscherOptRecord.RECORD_ID).toXml());
+        assertEquals(opt1Str, optRecord.toXml());
         textbox.setLineWidth(textbox.getLineWidth());
-        assertEquals(opt1Str, HSSFTestHelper.getEscherContainer(textbox).getChildById(EscherOptRecord.RECORD_ID).toXml());
+        assertEquals(opt1Str, optRecord.toXml());
         textbox.setLineStyleColor(textbox.getLineStyleColor());
-        assertEquals(opt1Str, HSSFTestHelper.getEscherContainer(textbox).getChildById(EscherOptRecord.RECORD_ID).toXml());
+        assertEquals(opt1Str, optRecord.toXml());
     }
 
     public void testDgRecordNumShapes(){



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


Mime
View raw message