63 $this->_object = $object;
74 switch (get_class($this->_object)) {
76 case 'PHPExcel_Shared_Escher':
77 if ($dggContainer = $this->_object->getDggContainer()) {
79 $this->_data = $writer->close();
80 }
else if ($dgContainer = $this->_object->getDgContainer()) {
82 $this->_data = $writer->close();
83 $this->_spOffsets = $writer->getSpOffsets();
87 case 'PHPExcel_Shared_Escher_DggContainer':
95 $recInstance = 0x0000;
98 $recVerInstance = $recVer;
99 $recVerInstance |= $recInstance << 4;
104 , $this->_object->getSpIdMax()
105 , $this->_object->getCDgSaved() + 1
106 , $this->_object->getCSpSaved()
107 , $this->_object->getCDgSaved()
111 $IDCLs = $this->_object->getIDCLs();
113 foreach ($IDCLs as $dgId => $maxReducedSpId) {
114 $dggData .= pack(
'VV', $dgId, $maxReducedSpId + 1);
117 $header = pack(
'vvV', $recVerInstance, $recType, strlen($dggData));
118 $innerData .= $header . $dggData;
121 if ($bstoreContainer = $this->_object->getBstoreContainer()) {
123 $innerData .= $writer->close();
128 $recInstance = 0x0000;
130 $length = strlen($innerData);
132 $recVerInstance = $recVer;
133 $recVerInstance |= $recInstance << 4;
135 $header = pack(
'vvV', $recVerInstance, $recType, $length);
137 $this->_data = $header . $innerData;
140 case 'PHPExcel_Shared_Escher_DggContainer_BstoreContainer':
147 if ($BSECollection = $this->_object->getBSECollection()) {
148 foreach ($BSECollection as $BSE) {
150 $innerData .= $writer->close();
156 $recInstance = count($this->_object->getBSECollection());
158 $length = strlen($innerData);
160 $recVerInstance = $recVer;
161 $recVerInstance |= $recInstance << 4;
163 $header = pack(
'vvV', $recVerInstance, $recType, $length);
165 $this->_data = $header . $innerData;
168 case 'PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE':
175 if ($blip = $this->_object->getBlip()) {
177 $innerData .= $writer->close();
183 $btWin32 = $this->_object->getBlipType();
184 $btMacOS = $this->_object->getBlipType();
185 $data .= pack(
'CC', $btWin32, $btMacOS);
187 $rgbUid = pack(
'VVVV', 0,0,0,0);
191 $size = strlen($innerData);
198 $data .= pack(
'vVVVCCCC', $tag, $size, $cRef, $foDelay, $unused1, $cbName, $unused2, $unused3);
204 $recInstance = $this->_object->getBlipType();
206 $length = strlen(
$data);
208 $recVerInstance = $recVer;
209 $recVerInstance |= $recInstance << 4;
211 $header = pack(
'vvV', $recVerInstance, $recType, $length);
213 $this->_data = $header;
215 $this->_data .=
$data;
218 case 'PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip':
222 switch ($this->_object->getParent()->getBlipType()) {
228 $rgbUid1 = pack(
'VVVV', 0,0,0,0);
229 $innerData .= $rgbUid1;
232 $innerData .= pack(
'C', $tag);
234 $innerData .= $this->_object->getData();
237 $recInstance = 0x46A;
239 $length = strlen($innerData);
241 $recVerInstance = $recVer;
242 $recVerInstance |= $recInstance << 4;
244 $header = pack(
'vvV', $recVerInstance, $recType, $length);
246 $this->_data = $header;
248 $this->_data .= $innerData;
255 $rgbUid1 = pack(
'VVVV', 0,0,0,0);
256 $innerData .= $rgbUid1;
259 $innerData .= pack(
'C', $tag);
261 $innerData .= $this->_object->getData();
264 $recInstance = 0x6E0;
266 $length = strlen($innerData);
268 $recVerInstance = $recVer;
269 $recVerInstance |= $recInstance << 4;
271 $header = pack(
'vvV', $recVerInstance, $recType, $length);
273 $this->_data = $header;
275 $this->_data .= $innerData;
281 case 'PHPExcel_Shared_Escher_DgContainer':
289 $recInstance = $this->_object->getDgId();
293 $recVerInstance = $recVer;
294 $recVerInstance |= $recInstance << 4;
296 $header = pack(
'vvV', $recVerInstance, $recType, $length);
299 $countShapes = count($this->_object->getSpgrContainer()->getChildren());
300 $innerData .= $header . pack(
'VV', $countShapes, $this->_object->getLastSpId());
304 if ($spgrContainer = $this->_object->getSpgrContainer()) {
306 $innerData .= $writer->close();
309 $spOffsets = $writer->getSpOffsets();
312 foreach ($spOffsets as & $spOffset) {
316 $this->_spOffsets = $spOffsets;
321 $recInstance = 0x0000;
323 $length = strlen($innerData);
325 $recVerInstance = $recVer;
326 $recVerInstance |= $recInstance << 4;
328 $header = pack(
'vvV', $recVerInstance, $recType, $length);
330 $this->_data = $header . $innerData;
333 case 'PHPExcel_Shared_Escher_DgContainer_SpgrContainer':
341 $spOffsets = array();
344 foreach ($this->_object->getChildren() as $spContainer) {
346 $spData = $writer->close();
347 $innerData .= $spData;
350 $totalSize += strlen($spData);
351 $spOffsets[] = $totalSize;
356 $recInstance = 0x0000;
358 $length = strlen($innerData);
360 $recVerInstance = $recVer;
361 $recVerInstance |= $recInstance << 4;
363 $header = pack(
'vvV', $recVerInstance, $recType, $length);
365 $this->_data = $header . $innerData;
366 $this->_spOffsets = $spOffsets;
369 case 'PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer':
376 if ($this->_object->getSpgr()) {
378 $recInstance = 0x0000;
380 $length = 0x00000010;
382 $recVerInstance = $recVer;
383 $recVerInstance |= $recInstance << 4;
385 $header = pack(
'vvV', $recVerInstance, $recType, $length);
387 $data .= $header . pack(
'VVVV', 0,0,0,0);
392 $recInstance = $this->_object->getSpType();
394 $length = 0x00000008;
396 $recVerInstance = $recVer;
397 $recVerInstance |= $recInstance << 4;
399 $header = pack(
'vvV', $recVerInstance, $recType, $length);
401 $data .= $header . pack(
'VV', $this->_object->getSpId(), $this->_object->getSpgr() ? 0x0005 : 0x0A00);
405 if ($this->_object->getOPTCollection()) {
409 $recInstance = count($this->_object->getOPTCollection());
411 foreach ($this->_object->getOPTCollection() as $property => $value) {
412 $optData .= pack(
'vV', $property, $value);
414 $length = strlen($optData);
416 $recVerInstance = $recVer;
417 $recVerInstance |= $recInstance << 4;
419 $header = pack(
'vvV', $recVerInstance, $recType, $length);
420 $data .= $header . $optData;
424 if ($this->_object->getStartCoordinates()) {
425 $clientAnchorData =
'';
437 $startOffsetX = $this->_object->getStartOffsetX();
440 $startOffsetY = $this->_object->getStartOffsetY();
448 $endOffsetX = $this->_object->getEndOffsetX();
451 $endOffsetY = $this->_object->getEndOffsetY();
453 $clientAnchorData = pack(
'vvvvvvvvv', 0x02,
454 $c1, $startOffsetX, $r1, $startOffsetY,
455 $c2, $endOffsetX, $r2, $endOffsetY);
457 $length = strlen($clientAnchorData);
459 $recVerInstance = $recVer;
460 $recVerInstance |= $recInstance << 4;
462 $header = pack(
'vvV', $recVerInstance, $recType, $length);
463 $data .= $header . $clientAnchorData;
467 if (!$this->_object->getSpgr()) {
468 $clientDataData =
'';
474 $length = strlen($clientDataData);
476 $recVerInstance = $recVer;
477 $recVerInstance |= $recInstance << 4;
479 $header = pack(
'vvV', $recVerInstance, $recType, $length);
480 $data .= $header . $clientDataData;
485 $recInstance = 0x0000;
487 $length = strlen(
$data);
489 $recVerInstance = $recVer;
490 $recVerInstance |= $recInstance << 4;
492 $header = pack(
'vvV', $recVerInstance, $recType, $length);
494 $this->_data = $header .
$data;