You are here

private function PHPExcel_Reader_Excel5_Escher::_readOfficeArtRGFOPTE in Loft Data Grids 7.2

Same name and namespace in other branches
  1. 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Reader/Excel5/Escher.php \PHPExcel_Reader_Excel5_Escher::_readOfficeArtRGFOPTE()

* Read OfficeArtRGFOPTE table of property-value pairs * *

Parameters

string $data Binary data: * @param int $n Number of properties

1 call to PHPExcel_Reader_Excel5_Escher::_readOfficeArtRGFOPTE()
PHPExcel_Reader_Excel5_Escher::_readOPT in vendor/phpoffice/phpexcel/Classes/PHPExcel/Reader/Excel5/Escher.php
* Read OPT record. This record may occur within DggContainer record or SpContainer

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Reader/Excel5/Escher.php, line 601

Class

PHPExcel_Reader_Excel5_Escher
PHPExcel_Reader_Excel5_Escher

Code

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);
  }
}