private function readRecordOfficeArtSpgrContainer($stream, $pos, $bInGroup = false)
{
$arrayReturn = array('length' => 0);
$data = $this->loadRecordHeader($stream, $pos);
if ($data['recVer'] == 0xf && $data['recInstance'] == 0x0 && $data['recType'] == 0xf003) {
$arrayReturn['length'] += 8;
do {
$rhFileBlock = $this->loadRecordHeader($stream, $pos + $arrayReturn['length']);
if (!($rhFileBlock['recVer'] == 0xf && $rhFileBlock['recInstance'] == 0x0 && ($rhFileBlock['recType'] == 0xf003 || $rhFileBlock['recType'] == 0xf004))) {
throw new \Exception('PowerPoint97 Reader : readRecordOfficeArtSpgrContainer.');
}
switch ($rhFileBlock['recType']) {
case 0xf003:
// Core
$this->oCurrentGroup = $this->oPhpPresentation->getActiveSlide()->createGroup();
$this->bFirstShapeGroup = false;
// OfficeArtSpgrContainer
$fileBlock = $this->readRecordOfficeArtSpgrContainer($stream, $pos + $arrayReturn['length'], true);
$arrayReturn['length'] += $fileBlock['length'];
$data['recLen'] -= $fileBlock['length'];
break;
case 0xf004:
// Core
if (!$bInGroup) {
$this->oCurrentGroup = null;
}
// OfficeArtSpContainer
$fileBlock = $this->readRecordOfficeArtSpContainer($stream, $pos + $arrayReturn['length']);
$arrayReturn['length'] += $fileBlock['length'];
$data['recLen'] -= $fileBlock['length'];
// Core
//@todo
if (!is_null($fileBlock['shape'])) {
if ($bInGroup) {
$this->oCurrentGroup->addShape($fileBlock['shape']);
} else {
$this->oPhpPresentation->getActiveSlide()->addShape($fileBlock['shape']);
}
}
break;
}
} while ($data['recLen'] > 0);
}
return $arrayReturn;
}