{
$blipIndex = 0;
foreach ($this->_phpExcel->getAllsheets() as $sheet) {
$sheetIndex = $sheet->getParent()->getIndex($sheet);
$escher = null;
if (count($sheet->getDrawingCollection()) == 0) {
continue;
}
$dgId = $sheet->getParent()->getIndex($sheet) + 1;
$dgContainer->setDgId($dgId);
$escher->setDgContainer($dgContainer);
$dgContainer->setSpgrContainer($spgrContainer);
$spContainer->setSpgr(true);
$spContainer->setSpType(0);
$spContainer->setSpId(($sheet->getParent()->getIndex($sheet) + 1) << 10);
$spgrContainer->addChild($spContainer);
$countShapes[$sheetIndex] = 0;
foreach ($sheet->getDrawingCollection() as $drawing) {
++$blipIndex;
++$countShapes[$sheetIndex];
$spContainer->setSpType(0x004B);
$reducedSpId = $countShapes[$sheetIndex];
$spId = $reducedSpId
| ($sheet->getParent()->getIndex($sheet) + 1) << 10;
$spContainer->setSpId($spId);
$lastReducedSpId = $reducedSpId;
$lastSpId = $spId;
$spContainer->setOPT(0x4104, $blipIndex);
$coordinates = $drawing->getCoordinates();
$offsetX = $drawing->getOffsetX();
$offsetY = $drawing->getOffsetY();
$width = $drawing->getWidth();
$height = $drawing->getHeight();
$spContainer->setStartCoordinates($twoAnchor['startCoordinates']);
$spContainer->setStartOffsetX($twoAnchor['startOffsetX']);
$spContainer->setStartOffsetY($twoAnchor['startOffsetY']);
$spContainer->setEndCoordinates($twoAnchor['endCoordinates']);
$spContainer->setEndOffsetX($twoAnchor['endOffsetX']);
$spContainer->setEndOffsetY($twoAnchor['endOffsetY']);
$spgrContainer->addChild($spContainer);
}
$this->_IDCLs[$dgId] = $lastReducedSpId;
$dgContainer->setLastSpId($lastSpId);
$this->_writerWorksheets[$sheetIndex]->setEscher($escher);
}
}