Hi All,
I really need your help guys to solve an issue related to GroupShapeEx object. I am refactoring some existing code that couse quite often an OutOfMemory error . The Code is suppose to split a PPTX in slides and create a single PPTX with every slides having the same shapes and layouts.
At the moment i have this code that consume most of the memory :
private ShapeEx copyRecursivePropertiesToShape(final ShapeEx shape) {
ShapeEx result = null;
if(shape instanceof GroupShapeEx){
GroupShapeEx grpShape = (GroupShapeEx)shape;
Iterator shapes = grpShape.getShapes().iterator();
while (shapes.hasNext()){
ShapeEx childShape = shapes.next();
result = copyRecursivePropertiesToShape(childShape);
}
}else
{
result = shape;
}
return result;
}
The question is about , if there is an alternative to navigate trough GroupShapeEx and discover all the leaves avoiding recursion.
Thanks
Angelo.