possible ArrayIndexOutOfBounds error which we can avoid to make cloning
fail a bit less.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@
1730274 13f79535-47bb-0310-9956-
ffa450edef68
void afterInsert(HSSFPatriarch patriarch) {
EscherAggregate agg = patriarch.getBoundAggregate();
agg.associateShapeToObjRecord(getEscherContainer().getChildById(EscherClientDataRecord.RECORD_ID), getObjRecord());
- EscherBSERecord bse =
- patriarch.getSheet().getWorkbook().getWorkbook().getBSERecord(getPictureIndex());
- bse.setRef(bse.getRef() + 1);
+ if(getPictureIndex() != -1) {
+ EscherBSERecord bse =
+ patriarch.getSheet().getWorkbook().getWorkbook().getBSERecord(getPictureIndex());
+ bse.setRef(bse.getRef() + 1);
+ }
}
/**