You are here

private function PHPExcel_Writer_Excel5_Worksheet::_writeGuts 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::_writeGuts()

* Write the GUTS BIFF record. This is used to configure the gutter margins * where Excel outline symbols are displayed. The visibility of the gutters is * controlled by a flag in WSBOOL. * *

See also

_writeWsbool()

1 call to PHPExcel_Writer_Excel5_Worksheet::_writeGuts()
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 2103

Class

PHPExcel_Writer_Excel5_Worksheet
PHPExcel_Writer_Excel5_Worksheet

Code

private function _writeGuts() {
  $record = 0x80;

  // Record identifier
  $length = 0x8;

  // Bytes to follow
  $dxRwGut = 0x0;

  // Size of row gutter
  $dxColGut = 0x0;

  // Size of col gutter
  // determine maximum row outline level
  $maxRowOutlineLevel = 0;
  foreach ($this->_phpSheet
    ->getRowDimensions() as $rowDimension) {
    $maxRowOutlineLevel = max($maxRowOutlineLevel, $rowDimension
      ->getOutlineLevel());
  }
  $col_level = 0;

  // Calculate the maximum column outline level. The equivalent calculation
  // for the row outline level is carried out in _writeRow().
  $colcount = count($this->_colinfo);
  for ($i = 0; $i < $colcount; ++$i) {
    $col_level = max($this->_colinfo[$i][5], $col_level);
  }

  // Set the limits for the outline levels (0 <= x <= 7).
  $col_level = max(0, min($col_level, 7));

  // The displayed level is one greater than the max outline levels
  if ($maxRowOutlineLevel) {
    ++$maxRowOutlineLevel;
  }
  if ($col_level) {
    ++$col_level;
  }
  $header = pack("vv", $record, $length);
  $data = pack("vvvv", $dxRwGut, $dxColGut, $maxRowOutlineLevel, $col_level);
  $this
    ->_append($header . $data);
}