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);
}
}
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);
}
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);
String opt1Str = opt.toXml();\r
\r
textbox.setFillColor(textbox.getFillColor());\r
- assertEquals(opt1Str, HSSFTestHelper.getEscherContainer(textbox).getChildById(EscherOptRecord.RECORD_ID).toXml());\r
+ EscherContainerRecord container = HSSFTestHelper.getEscherContainer(textbox);\r
+ EscherOptRecord optRecord = container.getChildById(EscherOptRecord.RECORD_ID);\r
+ assertEquals(opt1Str, optRecord.toXml());\r
textbox.setLineStyle(textbox.getLineStyle());\r
- assertEquals(opt1Str, HSSFTestHelper.getEscherContainer(textbox).getChildById(EscherOptRecord.RECORD_ID).toXml());\r
+ assertEquals(opt1Str, optRecord.toXml());\r
textbox.setLineWidth(textbox.getLineWidth());\r
- assertEquals(opt1Str, HSSFTestHelper.getEscherContainer(textbox).getChildById(EscherOptRecord.RECORD_ID).toXml());\r
+ assertEquals(opt1Str, optRecord.toXml());\r
textbox.setLineStyleColor(textbox.getLineStyleColor());\r
- assertEquals(opt1Str, HSSFTestHelper.getEscherContainer(textbox).getChildById(EscherOptRecord.RECORD_ID).toXml());\r
+ assertEquals(opt1Str, optRecord.toXml());\r
}\r
\r
public void testDgRecordNumShapes(){\r