You are here

private function PHPExcel_Writer_Excel5_Worksheet::_writeCFHeader in Loft Data Grids 7.2

Same name and namespace in other branches
  1. 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel5/Worksheet.php \PHPExcel_Writer_Excel5_Worksheet::_writeCFHeader()

* Write CFHeader record

1 call to PHPExcel_Writer_Excel5_Worksheet::_writeCFHeader()
PHPExcel_Writer_Excel5_Worksheet::close in vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel5/Worksheet.php
* Add data to the beginning of the workbook (note the reverse order) * and to the end of the workbook. * * @access public *

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel5/Worksheet.php, line 3635

Class

PHPExcel_Writer_Excel5_Worksheet
PHPExcel_Writer_Excel5_Worksheet

Code

private function _writeCFHeader() {
  $record = 0x1b0;

  // Record identifier
  $length = 0x16;

  // Bytes to follow
  $numColumnMin = null;
  $numColumnMax = null;
  $numRowMin = null;
  $numRowMax = null;
  $arrConditional = array();
  foreach ($this->_phpSheet
    ->getConditionalStylesCollection() as $cellCoordinate => $conditionalStyles) {
    foreach ($conditionalStyles as $conditional) {
      if ($conditional
        ->getConditionType() == PHPExcel_Style_Conditional::CONDITION_EXPRESSION || $conditional
        ->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CELLIS) {
        if (!in_array($conditional
          ->getHashCode(), $arrConditional)) {
          $arrConditional[] = $conditional
            ->getHashCode();
        }

        // Cells
        $arrCoord = PHPExcel_Cell::coordinateFromString($cellCoordinate);
        if (!is_numeric($arrCoord[0])) {
          $arrCoord[0] = PHPExcel_Cell::columnIndexFromString($arrCoord[0]);
        }
        if (is_null($numColumnMin) || $numColumnMin > $arrCoord[0]) {
          $numColumnMin = $arrCoord[0];
        }
        if (is_null($numColumnMax) || $numColumnMax < $arrCoord[0]) {
          $numColumnMax = $arrCoord[0];
        }
        if (is_null($numRowMin) || $numRowMin > $arrCoord[1]) {
          $numRowMin = $arrCoord[1];
        }
        if (is_null($numRowMax) || $numRowMax < $arrCoord[1]) {
          $numRowMax = $arrCoord[1];
        }
      }
    }
  }
  $needRedraw = 1;
  $cellRange = pack('vvvv', $numRowMin - 1, $numRowMax - 1, $numColumnMin - 1, $numColumnMax - 1);
  $header = pack('vv', $record, $length);
  $data = pack('vv', count($arrConditional), $needRedraw);
  $data .= $cellRange;
  $data .= pack('v', 0x1);
  $data .= $cellRange;
  $this
    ->_append($header . $data);
}