continue;
}
if (rb instanceof EscherAggregate){
- // EscherAggregate is used only as a container for SODRAWING and OBJ record combinations
- // So, if the container is empty, there is no reason to clone this record
- // See https://issues.apache.org/bugzilla/show_bug.cgi?id=49529
-// if (0 == rb.getRecordSize()){
- continue;
-// }
+ rb = new DrawingRecord();
}
Record rec = (Record) ((Record) rb).clone();
clonedRecords.add(rec);
HSSFSheet cloneSheet(HSSFWorkbook workbook) {
this.getDrawingPatriarch();/**Aggregate drawing records**/
HSSFSheet sheet = new HSSFSheet(workbook, _sheet.cloneSheet());
+ int pos = sheet._sheet.findFirstRecordLocBySid(DrawingRecord.sid);
+ DrawingRecord dr = (DrawingRecord) sheet._sheet.findFirstRecordBySid(DrawingRecord.sid);
+ if (null != dr){
+ sheet._sheet.getRecords().remove(dr);
+ }
if (getDrawingPatriarch() != null){
- int insertPos = sheet._sheet.findFirstRecordLocBySid(WindowTwoRecord.sid);
HSSFPatriarch patr = HSSFPatriarch.createPatriarch(this.getDrawingPatriarch(), sheet);
- sheet._sheet.getRecords().add(insertPos, patr._getBoundAggregate());
+ sheet._sheet.getRecords().add(pos, patr._getBoundAggregate());
sheet._patriarch = patr;
}
return sheet;