Пример #1
0
 /**
  * Read OfficeArtRGFOPTE table of property-value pairs
  *
  * @param string $data Binary data
  * @param int $n Number of properties
  */
 private function readOfficeArtRGFOPTE($data, $n)
 {
     $splicedComplexData = substr($data, 6 * $n);
     // loop through property-value pairs
     for ($i = 0; $i < $n; ++$i) {
         // read 6 bytes at a time
         $fopte = substr($data, 6 * $i, 6);
         // offset: 0; size: 2; opid
         $opid = PHPExcel_Reader_Excel5::getInt2d($fopte, 0);
         // bit: 0-13; mask: 0x3FFF; opid.opid
         $opidOpid = (0x3fff & $opid) >> 0;
         // bit: 14; mask 0x4000; 1 = value in op field is BLIP identifier
         $opidFBid = (0x4000 & $opid) >> 14;
         // bit: 15; mask 0x8000; 1 = this is a complex property, op field specifies size of complex data
         $opidFComplex = (0x8000 & $opid) >> 15;
         // offset: 2; size: 4; the value for this property
         $op = PHPExcel_Reader_Excel5::getInt4d($fopte, 2);
         if ($opidFComplex) {
             $complexData = substr($splicedComplexData, 0, $op);
             $splicedComplexData = substr($splicedComplexData, $op);
             // we store string value with complex data
             $value = $complexData;
         } else {
             // we store integer value
             $value = $op;
         }
         $this->object->setOPT($opidOpid, $value);
     }
 }