| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | <?php | 
					
						
							|  |  |  | /** | 
					
						
							|  |  |  |  * PHPExcel | 
					
						
							|  |  |  |  * | 
					
						
							| 
									
										
										
										
											2015-05-02 22:50:37 +00:00
										 |  |  |  * Copyright (c) 2006 - 2015 PHPExcel | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  |  * | 
					
						
							|  |  |  |  * This library is free software; you can redistribute it and/or | 
					
						
							|  |  |  |  * modify it under the terms of the GNU Lesser General Public | 
					
						
							|  |  |  |  * License as published by the Free Software Foundation; either | 
					
						
							|  |  |  |  * version 2.1 of the License, or (at your option) any later version. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * This library is distributed in the hope that it will be useful, | 
					
						
							|  |  |  |  * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
					
						
							|  |  |  |  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU | 
					
						
							|  |  |  |  * Lesser General Public License for more details. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * You should have received a copy of the GNU Lesser General Public | 
					
						
							|  |  |  |  * License along with this library; if not, write to the Free Software | 
					
						
							|  |  |  |  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * @category   PHPExcel | 
					
						
							|  |  |  |  * @package    PHPExcel_Writer_Excel5 | 
					
						
							| 
									
										
										
										
											2015-05-02 22:50:37 +00:00
										 |  |  |  * @copyright  Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) | 
					
						
							| 
									
										
										
										
											2015-05-11 21:38:52 +00:00
										 |  |  |  * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt    LGPL | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  |  * @version    ##VERSION##, ##DATE##
 | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-03 21:08:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | /** | 
					
						
							|  |  |  |  * PHPExcel_Shared_Escher_DggContainer_BstoreContainer | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * @category   PHPExcel | 
					
						
							|  |  |  |  * @package    PHPExcel_Writer_Excel5 | 
					
						
							| 
									
										
										
										
											2015-05-02 22:50:37 +00:00
										 |  |  |  * @copyright  Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  |  */ | 
					
						
							|  |  |  | class PHPExcel_Writer_Excel5_Escher | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2015-05-11 21:38:52 +00:00
										 |  |  |     /** | 
					
						
							|  |  |  |      * The object we are writing | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |     private $object; | 
					
						
							| 
									
										
										
										
											2015-05-11 21:38:52 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * The written binary data | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |     private $data; | 
					
						
							| 
									
										
										
										
											2015-05-11 21:38:52 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * Shape offsets. Positions in binary stream where a new shape record begins | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * @var array | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |     private $spOffsets; | 
					
						
							| 
									
										
										
										
											2015-05-11 21:38:52 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * Shape types. | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * @var array | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |     private $spTypes; | 
					
						
							| 
									
										
										
										
											2015-05-11 21:38:52 +00:00
										 |  |  |      | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * Constructor | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * @param mixed | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  |     public function __construct($object) | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |         $this->object = $object; | 
					
						
							| 
									
										
										
										
											2015-05-11 21:38:52 +00:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * Process the object to be written | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  |     public function close() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         // initialize
 | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |         $this->data = ''; | 
					
						
							| 
									
										
										
										
											2015-05-11 21:38:52 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |         switch (get_class($this->object)) { | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |             case 'PHPExcel_Shared_Escher': | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |                 if ($dggContainer = $this->object->getDggContainer()) { | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                     $writer = new PHPExcel_Writer_Excel5_Escher($dggContainer); | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |                     $this->data = $writer->close(); | 
					
						
							|  |  |  |                 } elseif ($dgContainer = $this->object->getDgContainer()) { | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                     $writer = new PHPExcel_Writer_Excel5_Escher($dgContainer); | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |                     $this->data = $writer->close(); | 
					
						
							|  |  |  |                     $this->spOffsets = $writer->getSpOffsets(); | 
					
						
							|  |  |  |                     $this->spTypes = $writer->getSpTypes(); | 
					
						
							| 
									
										
										
										
											2015-05-11 21:38:52 +00:00
										 |  |  |                 } | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                 break; | 
					
						
							|  |  |  |             case 'PHPExcel_Shared_Escher_DggContainer': | 
					
						
							|  |  |  |                 // this is a container record
 | 
					
						
							| 
									
										
										
										
											2012-03-03 21:08:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                 // initialize
 | 
					
						
							|  |  |  |                 $innerData = ''; | 
					
						
							| 
									
										
										
										
											2012-03-03 21:08:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                 // write the dgg
 | 
					
						
							|  |  |  |                 $recVer            = 0x0; | 
					
						
							|  |  |  |                 $recInstance    = 0x0000; | 
					
						
							|  |  |  |                 $recType        = 0xF006; | 
					
						
							| 
									
										
										
										
											2012-03-03 21:08:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                 $recVerInstance  = $recVer; | 
					
						
							|  |  |  |                 $recVerInstance |= $recInstance << 4; | 
					
						
							| 
									
										
										
										
											2012-03-03 21:08:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                 // dgg data
 | 
					
						
							|  |  |  |                 $dggData = | 
					
						
							| 
									
										
										
										
											2015-05-13 11:15:55 +00:00
										 |  |  |                     pack( | 
					
						
							|  |  |  |                         'VVVV', | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |                         $this->object->getSpIdMax(), // maximum shape identifier increased by one
 | 
					
						
							|  |  |  |                         $this->object->getCDgSaved() + 1, // number of file identifier clusters increased by one
 | 
					
						
							|  |  |  |                         $this->object->getCSpSaved(), | 
					
						
							|  |  |  |                         $this->object->getCDgSaved() // count total number of drawings saved
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                     ); | 
					
						
							| 
									
										
										
										
											2012-03-03 21:08:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                 // add file identifier clusters (one per drawing)
 | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |                 $IDCLs = $this->object->getIDCLs(); | 
					
						
							| 
									
										
										
										
											2012-03-03 21:08:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                 foreach ($IDCLs as $dgId => $maxReducedSpId) { | 
					
						
							|  |  |  |                     $dggData .= pack('VV', $dgId, $maxReducedSpId + 1); | 
					
						
							|  |  |  |                 } | 
					
						
							| 
									
										
										
										
											2012-03-03 21:08:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                 $header = pack('vvV', $recVerInstance, $recType, strlen($dggData)); | 
					
						
							|  |  |  |                 $innerData .= $header . $dggData; | 
					
						
							| 
									
										
										
										
											2012-03-03 21:08:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                 // write the bstoreContainer
 | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |                 if ($bstoreContainer = $this->object->getBstoreContainer()) { | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                     $writer = new PHPExcel_Writer_Excel5_Escher($bstoreContainer); | 
					
						
							|  |  |  |                     $innerData .= $writer->close(); | 
					
						
							|  |  |  |                 } | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                 // write the record
 | 
					
						
							|  |  |  |                 $recVer            = 0xF; | 
					
						
							|  |  |  |                 $recInstance    = 0x0000; | 
					
						
							|  |  |  |                 $recType        = 0xF000; | 
					
						
							|  |  |  |                 $length            = strlen($innerData); | 
					
						
							| 
									
										
										
										
											2012-03-03 21:08:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                 $recVerInstance  = $recVer; | 
					
						
							|  |  |  |                 $recVerInstance |= $recInstance << 4; | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                 $header = pack('vvV', $recVerInstance, $recType, $length); | 
					
						
							| 
									
										
										
										
											2012-03-03 21:08:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |                 $this->data = $header . $innerData; | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                 break; | 
					
						
							|  |  |  |             case 'PHPExcel_Shared_Escher_DggContainer_BstoreContainer': | 
					
						
							|  |  |  |                 // this is a container record
 | 
					
						
							| 
									
										
										
										
											2012-03-03 21:08:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-11 21:38:52 +00:00
										 |  |  |                 // initialize
 | 
					
						
							|  |  |  |                 $innerData = ''; | 
					
						
							| 
									
										
										
										
											2012-03-03 21:08:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                 // treat the inner data
 | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |                 if ($BSECollection = $this->object->getBSECollection()) { | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                     foreach ($BSECollection as $BSE) { | 
					
						
							|  |  |  |                         $writer = new PHPExcel_Writer_Excel5_Escher($BSE); | 
					
						
							|  |  |  |                         $innerData .= $writer->close(); | 
					
						
							|  |  |  |                     } | 
					
						
							|  |  |  |                 } | 
					
						
							| 
									
										
										
										
											2012-03-03 21:08:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                 // write the record
 | 
					
						
							|  |  |  |                 $recVer            = 0xF; | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |                 $recInstance    = count($this->object->getBSECollection()); | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                 $recType        = 0xF001; | 
					
						
							| 
									
										
										
										
											2015-05-11 21:38:52 +00:00
										 |  |  |                 $length            = strlen($innerData); | 
					
						
							| 
									
										
										
										
											2012-03-03 21:08:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-11 21:38:52 +00:00
										 |  |  |                 $recVerInstance  = $recVer; | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                 $recVerInstance |= $recInstance << 4; | 
					
						
							| 
									
										
										
										
											2012-03-03 21:08:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-11 21:38:52 +00:00
										 |  |  |                 $header = pack('vvV', $recVerInstance, $recType, $length); | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |                 $this->data = $header . $innerData; | 
					
						
							| 
									
										
										
										
											2015-05-11 21:38:52 +00:00
										 |  |  |                 break; | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |             case 'PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE': | 
					
						
							|  |  |  |                 // this is a semi-container record
 | 
					
						
							| 
									
										
										
										
											2012-03-03 21:08:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-11 21:38:52 +00:00
										 |  |  |                 // initialize
 | 
					
						
							|  |  |  |                 $innerData = ''; | 
					
						
							| 
									
										
										
										
											2012-03-03 21:08:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                 // here we treat the inner data
 | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |                 if ($blip = $this->object->getBlip()) { | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                     $writer = new PHPExcel_Writer_Excel5_Escher($blip); | 
					
						
							|  |  |  |                     $innerData .= $writer->close(); | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                 // initialize
 | 
					
						
							|  |  |  |                 $data = ''; | 
					
						
							| 
									
										
										
										
											2012-03-03 21:08:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |                 $btWin32 = $this->object->getBlipType(); | 
					
						
							|  |  |  |                 $btMacOS = $this->object->getBlipType(); | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                 $data .= pack('CC', $btWin32, $btMacOS); | 
					
						
							| 
									
										
										
										
											2012-03-03 21:08:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-13 11:15:55 +00:00
										 |  |  |                 $rgbUid = pack('VVVV', 0, 0, 0, 0); // todo
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                 $data .= $rgbUid; | 
					
						
							| 
									
										
										
										
											2012-03-03 21:08:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                 $tag = 0; | 
					
						
							|  |  |  |                 $size = strlen($innerData); | 
					
						
							|  |  |  |                 $cRef = 1; | 
					
						
							|  |  |  |                 $foDelay = 0; //todo
 | 
					
						
							|  |  |  |                 $unused1 = 0x0; | 
					
						
							|  |  |  |                 $cbName = 0x0; | 
					
						
							|  |  |  |                 $unused2 = 0x0; | 
					
						
							|  |  |  |                 $unused3 = 0x0; | 
					
						
							|  |  |  |                 $data .= pack('vVVVCCCC', $tag, $size, $cRef, $foDelay, $unused1, $cbName, $unused2, $unused3); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                 $data .= $innerData; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                 // write the record
 | 
					
						
							|  |  |  |                 $recVer            = 0x2; | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |                 $recInstance    = $this->object->getBlipType(); | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                 $recType        = 0xF007; | 
					
						
							|  |  |  |                 $length            = strlen($data); | 
					
						
							| 
									
										
										
										
											2012-03-03 21:08:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-11 21:38:52 +00:00
										 |  |  |                 $recVerInstance  = $recVer; | 
					
						
							|  |  |  |                 $recVerInstance |=    $recInstance << 4; | 
					
						
							| 
									
										
										
										
											2012-03-03 21:08:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-11 21:38:52 +00:00
										 |  |  |                 $header = pack('vvV', $recVerInstance, $recType, $length); | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |                 $this->data = $header; | 
					
						
							| 
									
										
										
										
											2012-03-03 21:08:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |                 $this->data .= $data; | 
					
						
							| 
									
										
										
										
											2015-05-11 21:38:52 +00:00
										 |  |  |                 break; | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |             case 'PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip': | 
					
						
							|  |  |  |                 // this is an atom record
 | 
					
						
							| 
									
										
										
										
											2012-03-03 21:08:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                 // write the record
 | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |                 switch ($this->object->getParent()->getBlipType()) { | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                     case PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE::BLIPTYPE_JPEG: | 
					
						
							|  |  |  |                         // initialize
 | 
					
						
							|  |  |  |                         $innerData = ''; | 
					
						
							| 
									
										
										
										
											2012-03-03 21:08:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-13 11:15:55 +00:00
										 |  |  |                         $rgbUid1 = pack('VVVV', 0, 0, 0, 0); // todo
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                         $innerData .= $rgbUid1; | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                         $tag = 0xFF; // todo
 | 
					
						
							|  |  |  |                         $innerData .= pack('C', $tag); | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |                         $innerData .= $this->object->getData(); | 
					
						
							| 
									
										
										
										
											2012-03-03 21:08:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                         $recVer            = 0x0; | 
					
						
							|  |  |  |                         $recInstance    = 0x46A; | 
					
						
							|  |  |  |                         $recType        = 0xF01D; | 
					
						
							|  |  |  |                         $length            = strlen($innerData); | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                         $recVerInstance  = $recVer; | 
					
						
							|  |  |  |                         $recVerInstance |=    $recInstance << 4; | 
					
						
							| 
									
										
										
										
											2012-03-03 21:08:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                         $header = pack('vvV', $recVerInstance, $recType, $length); | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |                         $this->data = $header; | 
					
						
							| 
									
										
										
										
											2012-03-03 21:08:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |                         $this->data .= $innerData; | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                         break; | 
					
						
							| 
									
										
										
										
											2012-03-03 21:08:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                     case PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE::BLIPTYPE_PNG: | 
					
						
							|  |  |  |                         // initialize
 | 
					
						
							|  |  |  |                         $innerData = ''; | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-13 11:15:55 +00:00
										 |  |  |                         $rgbUid1 = pack('VVVV', 0, 0, 0, 0); // todo
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                         $innerData .= $rgbUid1; | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                         $tag = 0xFF; // todo
 | 
					
						
							|  |  |  |                         $innerData .= pack('C', $tag); | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |                         $innerData .= $this->object->getData(); | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                         $recVer            = 0x0; | 
					
						
							|  |  |  |                         $recInstance    = 0x6E0; | 
					
						
							|  |  |  |                         $recType        = 0xF01E; | 
					
						
							|  |  |  |                         $length            = strlen($innerData); | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                         $recVerInstance  = $recVer; | 
					
						
							|  |  |  |                         $recVerInstance |=    $recInstance << 4; | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                         $header = pack('vvV', $recVerInstance, $recType, $length); | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |                         $this->data = $header; | 
					
						
							| 
									
										
										
										
											2012-03-03 21:08:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |                         $this->data .= $innerData; | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                         break; | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |                 break; | 
					
						
							|  |  |  |             case 'PHPExcel_Shared_Escher_DgContainer': | 
					
						
							|  |  |  |                 // this is a container record
 | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                 // initialize
 | 
					
						
							|  |  |  |                 $innerData = ''; | 
					
						
							| 
									
										
										
										
											2012-03-03 21:08:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                 // write the dg
 | 
					
						
							|  |  |  |                 $recVer            = 0x0; | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |                 $recInstance    = $this->object->getDgId(); | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                 $recType        = 0xF008; | 
					
						
							|  |  |  |                 $length            = 8; | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                 $recVerInstance  = $recVer; | 
					
						
							|  |  |  |                 $recVerInstance |= $recInstance << 4; | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                 $header = pack('vvV', $recVerInstance, $recType, $length); | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                 // number of shapes in this drawing (including group shape)
 | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |                 $countShapes = count($this->object->getSpgrContainer()->getChildren()); | 
					
						
							|  |  |  |                 $innerData .= $header . pack('VV', $countShapes, $this->object->getLastSpId()); | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                 //$innerData .= $header . pack('VV', 0, 0);
 | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                 // write the spgrContainer
 | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |                 if ($spgrContainer = $this->object->getSpgrContainer()) { | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                     $writer = new PHPExcel_Writer_Excel5_Escher($spgrContainer); | 
					
						
							|  |  |  |                     $innerData .= $writer->close(); | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                     // get the shape offsets relative to the spgrContainer record
 | 
					
						
							|  |  |  |                     $spOffsets = $writer->getSpOffsets(); | 
					
						
							|  |  |  |                     $spTypes   = $writer->getSpTypes(); | 
					
						
							|  |  |  |                      | 
					
						
							|  |  |  |                     // save the shape offsets relative to dgContainer
 | 
					
						
							|  |  |  |                     foreach ($spOffsets as & $spOffset) { | 
					
						
							|  |  |  |                         $spOffset += 24; // add length of dgContainer header data (8 bytes) plus dg data (16 bytes)
 | 
					
						
							|  |  |  |                     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |                     $this->spOffsets = $spOffsets; | 
					
						
							|  |  |  |                     $this->spTypes = $spTypes; | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                 } | 
					
						
							| 
									
										
										
										
											2012-03-03 21:08:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                 // write the record
 | 
					
						
							|  |  |  |                 $recVer            = 0xF; | 
					
						
							| 
									
										
										
										
											2015-05-11 21:38:52 +00:00
										 |  |  |                 $recInstance    = 0x0000; | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                 $recType        = 0xF002; | 
					
						
							|  |  |  |                 $length            = strlen($innerData); | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-11 21:38:52 +00:00
										 |  |  |                 $recVerInstance  = $recVer; | 
					
						
							|  |  |  |                 $recVerInstance |= $recInstance << 4; | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-11 21:38:52 +00:00
										 |  |  |                 $header = pack('vvV', $recVerInstance, $recType, $length); | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |                 $this->data = $header . $innerData; | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                 break; | 
					
						
							|  |  |  |             case 'PHPExcel_Shared_Escher_DgContainer_SpgrContainer': | 
					
						
							|  |  |  |                 // this is a container record
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                 // initialize
 | 
					
						
							|  |  |  |                 $innerData = ''; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                 // initialize spape offsets
 | 
					
						
							|  |  |  |                 $totalSize = 8; | 
					
						
							|  |  |  |                 $spOffsets = array(); | 
					
						
							|  |  |  |                 $spTypes   = array(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                 // treat the inner data
 | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |                 foreach ($this->object->getChildren() as $spContainer) { | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                     $writer = new PHPExcel_Writer_Excel5_Escher($spContainer); | 
					
						
							|  |  |  |                     $spData = $writer->close(); | 
					
						
							|  |  |  |                     $innerData .= $spData; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                     // save the shape offsets (where new shape records begin)
 | 
					
						
							|  |  |  |                     $totalSize += strlen($spData); | 
					
						
							|  |  |  |                     $spOffsets[] = $totalSize; | 
					
						
							|  |  |  |                      | 
					
						
							|  |  |  |                     $spTypes = array_merge($spTypes, $writer->getSpTypes()); | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                 // write the record
 | 
					
						
							|  |  |  |                 $recVer            = 0xF; | 
					
						
							|  |  |  |                 $recInstance    = 0x0000; | 
					
						
							|  |  |  |                 $recType        = 0xF003; | 
					
						
							|  |  |  |                 $length            = strlen($innerData); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                 $recVerInstance  = $recVer; | 
					
						
							|  |  |  |                 $recVerInstance |= $recInstance << 4; | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                 $header = pack('vvV', $recVerInstance, $recType, $length); | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |                 $this->data = $header . $innerData; | 
					
						
							|  |  |  |                 $this->spOffsets = $spOffsets; | 
					
						
							|  |  |  |                 $this->spTypes = $spTypes; | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                 break; | 
					
						
							|  |  |  |             case 'PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer': | 
					
						
							|  |  |  |                 // initialize
 | 
					
						
							|  |  |  |                 $data = ''; | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                 // build the data
 | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                 // write group shape record, if necessary?
 | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |                 if ($this->object->getSpgr()) { | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                     $recVer            = 0x1; | 
					
						
							|  |  |  |                     $recInstance    = 0x0000; | 
					
						
							|  |  |  |                     $recType        = 0xF009; | 
					
						
							|  |  |  |                     $length            = 0x00000010; | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                     $recVerInstance  = $recVer; | 
					
						
							|  |  |  |                     $recVerInstance |= $recInstance << 4; | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                     $header = pack('vvV', $recVerInstance, $recType, $length); | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-13 11:15:55 +00:00
										 |  |  |                     $data .= $header . pack('VVVV', 0, 0, 0, 0); | 
					
						
							| 
									
										
										
										
											2015-05-11 21:38:52 +00:00
										 |  |  |                 } | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |                 $this->spTypes[] = ($this->object->getSpType()); | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |                 // write the shape record
 | 
					
						
							|  |  |  |                 $recVer            = 0x2; | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |                 $recInstance    = $this->object->getSpType(); // shape type
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                 $recType        = 0xF00A; | 
					
						
							|  |  |  |                 $length            = 0x00000008; | 
					
						
							| 
									
										
										
										
											2012-03-03 21:08:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-11 21:38:52 +00:00
										 |  |  |                 $recVerInstance  = $recVer; | 
					
						
							|  |  |  |                 $recVerInstance |= $recInstance << 4; | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-11 21:38:52 +00:00
										 |  |  |                 $header = pack('vvV', $recVerInstance, $recType, $length); | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |                 $data .= $header . pack('VV', $this->object->getSpId(), $this->object->getSpgr() ? 0x0005 : 0x0A00); | 
					
						
							| 
									
										
										
										
											2015-05-11 21:38:52 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                 // the options
 | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |                 if ($this->object->getOPTCollection()) { | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                     $optData = ''; | 
					
						
							| 
									
										
										
										
											2015-05-11 21:38:52 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                     $recVer            = 0x3; | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |                     $recInstance    = count($this->object->getOPTCollection()); | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                     $recType        = 0xF00B; | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |                     foreach ($this->object->getOPTCollection() as $property => $value) { | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                         $optData .= pack('vV', $property, $value); | 
					
						
							|  |  |  |                     } | 
					
						
							|  |  |  |                     $length            = strlen($optData); | 
					
						
							| 
									
										
										
										
											2015-05-11 21:38:52 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                     $recVerInstance  = $recVer; | 
					
						
							|  |  |  |                     $recVerInstance |= $recInstance << 4; | 
					
						
							| 
									
										
										
										
											2015-05-11 21:38:52 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                     $header = pack('vvV', $recVerInstance, $recType, $length); | 
					
						
							|  |  |  |                     $data .= $header . $optData; | 
					
						
							|  |  |  |                 } | 
					
						
							| 
									
										
										
										
											2015-05-11 21:38:52 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                 // the client anchor
 | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |                 if ($this->object->getStartCoordinates()) { | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                     $clientAnchorData = ''; | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                     $recVer            = 0x0; | 
					
						
							|  |  |  |                     $recInstance    = 0x0; | 
					
						
							|  |  |  |                     $recType        = 0xF010; | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                     // start coordinates
 | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |                     list($column, $row) = PHPExcel_Cell::coordinateFromString($this->object->getStartCoordinates()); | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                     $c1 = PHPExcel_Cell::columnIndexFromString($column) - 1; | 
					
						
							|  |  |  |                     $r1 = $row - 1; | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                     // start offsetX
 | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |                     $startOffsetX = $this->object->getStartOffsetX(); | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                     // start offsetY
 | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |                     $startOffsetY = $this->object->getStartOffsetY(); | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                     // end coordinates
 | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |                     list($column, $row) = PHPExcel_Cell::coordinateFromString($this->object->getEndCoordinates()); | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                     $c2 = PHPExcel_Cell::columnIndexFromString($column) - 1; | 
					
						
							|  |  |  |                     $r2 = $row - 1; | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                     // end offsetX
 | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |                     $endOffsetX = $this->object->getEndOffsetX(); | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                     // end offsetY
 | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |                     $endOffsetY = $this->object->getEndOffsetY(); | 
					
						
							| 
									
										
										
										
											2015-05-11 21:38:52 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |                     $clientAnchorData = pack('vvvvvvvvv', $this->object->getSpFlag(), $c1, $startOffsetX, $r1, $startOffsetY, $c2, $endOffsetX, $r2, $endOffsetY); | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                      | 
					
						
							|  |  |  |                     $length            = strlen($clientAnchorData); | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                     $recVerInstance  = $recVer; | 
					
						
							|  |  |  |                     $recVerInstance |= $recInstance << 4; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                     $header = pack('vvV', $recVerInstance, $recType, $length); | 
					
						
							|  |  |  |                     $data .= $header . $clientAnchorData; | 
					
						
							|  |  |  |                 } | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                 // the client data, just empty for now
 | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |                 if (!$this->object->getSpgr()) { | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                     $clientDataData = ''; | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                     $recVer            = 0x0; | 
					
						
							|  |  |  |                     $recInstance    = 0x0; | 
					
						
							|  |  |  |                     $recType        = 0xF011; | 
					
						
							| 
									
										
										
										
											2015-05-11 21:38:52 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                     $length = strlen($clientDataData); | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                     $recVerInstance  = $recVer; | 
					
						
							|  |  |  |                     $recVerInstance |= $recInstance << 4; | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                     $header = pack('vvV', $recVerInstance, $recType, $length); | 
					
						
							|  |  |  |                     $data .= $header . $clientDataData; | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                 // write the record
 | 
					
						
							|  |  |  |                 $recVer            = 0xF; | 
					
						
							|  |  |  |                 $recInstance    = 0x0000; | 
					
						
							|  |  |  |                 $recType        = 0xF004; | 
					
						
							|  |  |  |                 $length            = strlen($data); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                 $recVerInstance  = $recVer; | 
					
						
							|  |  |  |                 $recVerInstance |= $recInstance << 4; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                 $header = pack('vvV', $recVerInstance, $recType, $length); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |                 $this->data = $header . $data; | 
					
						
							| 
									
										
										
										
											2015-05-12 15:57:29 +00:00
										 |  |  |                 break; | 
					
						
							| 
									
										
										
										
											2015-05-11 21:38:52 +00:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |         return $this->data; | 
					
						
							| 
									
										
										
										
											2015-05-11 21:38:52 +00:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * Gets the shape offsets | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * @return array | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  |     public function getSpOffsets() | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |         return $this->spOffsets; | 
					
						
							| 
									
										
										
										
											2015-05-11 21:38:52 +00:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * Gets the shape types | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * @return array | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  |     public function getSpTypes() | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2015-05-22 22:31:23 +00:00
										 |  |  |         return $this->spTypes; | 
					
						
							| 
									
										
										
										
											2015-05-11 21:38:52 +00:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | } |