don't increment the number of shapes when cloning a sheet with drawings
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@693383 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
bcaf3fdcd4
commit
78101afee8
@ -243,10 +243,11 @@ public class EscherContainerRecord extends EscherRecord
|
|||||||
public void getRecordsById(short recordId, List out){
|
public void getRecordsById(short recordId, List out){
|
||||||
for(Iterator it = childRecords.iterator(); it.hasNext();) {
|
for(Iterator it = childRecords.iterator(); it.hasNext();) {
|
||||||
Object er = it.next();
|
Object er = it.next();
|
||||||
if(er instanceof EscherContainerRecord) {
|
EscherRecord r = (EscherRecord)er;
|
||||||
EscherContainerRecord c = (EscherContainerRecord)er;
|
if(r instanceof EscherContainerRecord) {
|
||||||
|
EscherContainerRecord c = (EscherContainerRecord)r;
|
||||||
c.getRecordsById(recordId, out );
|
c.getRecordsById(recordId, out );
|
||||||
} else if (er instanceof EscherSpRecord){
|
} else if (r.getRecordId() == recordId){
|
||||||
out.add(er);
|
out.add(er);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2493,6 +2493,8 @@ public final class Workbook implements Model {
|
|||||||
for(Iterator spIt = spRecords.iterator(); spIt.hasNext();) {
|
for(Iterator spIt = spRecords.iterator(); spIt.hasNext();) {
|
||||||
EscherSpRecord sp = (EscherSpRecord)spIt.next();
|
EscherSpRecord sp = (EscherSpRecord)spIt.next();
|
||||||
int shapeId = drawingManager.allocateShapeId((short)dgId, dg);
|
int shapeId = drawingManager.allocateShapeId((short)dgId, dg);
|
||||||
|
//allocateShapeId increments the number of shapes. roll back to the previous value
|
||||||
|
dg.setNumShapes(dg.getNumShapes()-1);
|
||||||
sp.setShapeId(shapeId);
|
sp.setShapeId(shapeId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user