You are here

private function PHPExcel_Reader_Excel5::_readContinue in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Reader/Excel5.php \PHPExcel_Reader_Excel5::_readContinue()

* Read a free CONTINUE record. Free CONTINUE record may be a camouflaged MSODRAWING record * When MSODRAWING data on a sheet exceeds 8224 bytes, CONTINUE records are used instead. Undocumented. * In this case, we must treat the CONTINUE record as a MSODRAWING record

1 call to PHPExcel_Reader_Excel5::_readContinue()
PHPExcel_Reader_Excel5::load in vendor/phpoffice/phpexcel/Classes/PHPExcel/Reader/Excel5.php
* Loads PHPExcel from file * *

File

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

Class

PHPExcel_Reader_Excel5
PHPExcel_Reader_Excel5

Code

private function _readContinue() {
  $length = self::_GetInt2d($this->_data, $this->_pos + 2);
  $recordData = $this
    ->_readRecordData($this->_data, $this->_pos + 4, $length);

  // check if we are reading drawing data
  // this is in case a free CONTINUE record occurs in other circumstances we are unaware of
  if ($this->_drawingData == '') {

    // move stream pointer to next record
    $this->_pos += 4 + $length;
    return;
  }

  // check if record data is at least 4 bytes long, otherwise there is no chance this is MSODRAWING data
  if ($length < 4) {

    // move stream pointer to next record
    $this->_pos += 4 + $length;
    return;
  }

  // dirty check to see if CONTINUE record could be a camouflaged MSODRAWING record
  // look inside CONTINUE record to see if it looks like a part of an Escher stream
  // we know that Escher stream may be split at least at
  //		0xF003 MsofbtSpgrContainer
  //		0xF004 MsofbtSpContainer
  //		0xF00D MsofbtClientTextbox
  $validSplitPoints = array(
    0xf003,
    0xf004,
    0xf00d,
  );

  // add identifiers if we find more
  $splitPoint = self::_GetInt2d($recordData, 2);
  if (in_array($splitPoint, $validSplitPoints)) {

    // get spliced record data (and move pointer to next record)
    $splicedRecordData = $this
      ->_getSplicedRecordData();
    $this->_drawingData .= $splicedRecordData['recordData'];
    return;
  }

  // move stream pointer to next record
  $this->_pos += 4 + $length;
}