You are here

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

* Write the worksheet PASSWORD record.

1 call to PHPExcel_Writer_Excel5_Worksheet::_writePassword()
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 2336

Class

PHPExcel_Writer_Excel5_Worksheet
PHPExcel_Writer_Excel5_Worksheet

Code

private function _writePassword() {

  // Exit unless sheet protection and password have been specified
  if (!$this->_phpSheet
    ->getProtection()
    ->getSheet() || !$this->_phpSheet
    ->getProtection()
    ->getPassword()) {
    return;
  }
  $record = 0x13;

  // Record identifier
  $length = 0x2;

  // Bytes to follow
  $wPassword = hexdec($this->_phpSheet
    ->getProtection()
    ->getPassword());

  // Encoded password
  $header = pack("vv", $record, $length);
  $data = pack("v", $wPassword);
  $this
    ->_append($header . $data);
}