You are here

private function PHPExcel_Writer_Excel5_Worksheet::_writePanes in Loft Data Grids 6.2

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

* Writes the Excel BIFF PANE record. * The panes can either be frozen or thawed (unfrozen). * Frozen panes are specified in terms of an integer number of rows and columns. * Thawed panes are specified in terms of Excel's units for rows and columns.

1 call to PHPExcel_Writer_Excel5_Worksheet::_writePanes()
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 1732

Class

PHPExcel_Writer_Excel5_Worksheet
PHPExcel_Writer_Excel5_Worksheet

Code

private function _writePanes() {
  $panes = array();
  if ($freezePane = $this->_phpSheet
    ->getFreezePane()) {
    list($column, $row) = PHPExcel_Cell::coordinateFromString($freezePane);
    $panes[0] = $row - 1;
    $panes[1] = PHPExcel_Cell::columnIndexFromString($column) - 1;
  }
  else {

    // thaw panes
    return;
  }
  $y = isset($panes[0]) ? $panes[0] : null;
  $x = isset($panes[1]) ? $panes[1] : null;
  $rwTop = isset($panes[2]) ? $panes[2] : null;
  $colLeft = isset($panes[3]) ? $panes[3] : null;
  if (count($panes) > 4) {

    // if Active pane was received
    $pnnAct = $panes[4];
  }
  else {
    $pnnAct = null;
  }
  $record = 0x41;

  // Record identifier
  $length = 0xa;

  // Number of bytes to follow
  // Code specific to frozen or thawed panes.
  if ($this->_phpSheet
    ->getFreezePane()) {

    // Set default values for $rwTop and $colLeft
    if (!isset($rwTop)) {
      $rwTop = $y;
    }
    if (!isset($colLeft)) {
      $colLeft = $x;
    }
  }
  else {

    // Set default values for $rwTop and $colLeft
    if (!isset($rwTop)) {
      $rwTop = 0;
    }
    if (!isset($colLeft)) {
      $colLeft = 0;
    }

    // Convert Excel's row and column units to the internal units.
    // The default row height is 12.75
    // The default column width is 8.43
    // The following slope and intersection values were interpolated.
    //
    $y = 20 * $y + 255;
    $x = 113.879 * $x + 390;
  }

  // Determine which pane should be active. There is also the undocumented
  // option to override this should it be necessary: may be removed later.
  //
  if (!isset($pnnAct)) {
    if ($x != 0 && $y != 0) {
      $pnnAct = 0;

      // Bottom right
    }
    if ($x != 0 && $y == 0) {
      $pnnAct = 1;

      // Top right
    }
    if ($x == 0 && $y != 0) {
      $pnnAct = 2;

      // Bottom left
    }
    if ($x == 0 && $y == 0) {
      $pnnAct = 3;

      // Top left
    }
  }
  $this->_active_pane = $pnnAct;

  // Used in _writeSelection
  $header = pack("vv", $record, $length);
  $data = pack("vvvvv", $x, $y, $rwTop, $colLeft, $pnnAct);
  $this
    ->_append($header . $data);
}