You are here

public function PHPExcel_Writer_Excel5_Workbook::__construct in Loft Data Grids 7.2

Same name and namespace in other branches
  1. 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel5/Workbook.php \PHPExcel_Writer_Excel5_Workbook::__construct()

* Class constructor * *

Parameters

PHPExcel $phpExcel The Workbook: * @param int &$str_total Total number of strings * @param int &$str_unique Total number of unique strings * @param array &$str_table String Table * @param array &$colors Colour Table * @param mixed $parser The formula parser created for the Workbook

Overrides PHPExcel_Writer_Excel5_BIFFwriter::__construct

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel5/Workbook.php, line 203

Class

PHPExcel_Writer_Excel5_Workbook
PHPExcel_Writer_Excel5_Workbook

Code

public function __construct(PHPExcel $phpExcel = null, &$str_total, &$str_unique, &$str_table, &$colors, $parser) {

  // It needs to call its parent's constructor explicitly
  parent::__construct();
  $this->_parser = $parser;
  $this->_biffsize = 0;
  $this->_palette = array();
  $this->_country_code = -1;
  $this->_str_total =& $str_total;
  $this->_str_unique =& $str_unique;
  $this->_str_table =& $str_table;
  $this->_colors =& $colors;
  $this
    ->_setPaletteXl97();
  $this->_phpExcel = $phpExcel;

  // set BIFFwriter limit for CONTINUE records
  //		$this->_limit = 8224;
  $this->_codepage = 0x4b0;

  // Add empty sheets and Build color cache
  $countSheets = $phpExcel
    ->getSheetCount();
  for ($i = 0; $i < $countSheets; ++$i) {
    $phpSheet = $phpExcel
      ->getSheet($i);
    $this->_parser
      ->setExtSheet($phpSheet
      ->getTitle(), $i);

    // Register worksheet name with parser
    $supbook_index = 0x0;
    $ref = pack('vvv', $supbook_index, $i, $i);
    $this->_parser->_references[] = $ref;

    // Register reference with parser
    // Sheet tab colors?
    if ($phpSheet
      ->isTabColorSet()) {
      $this
        ->_addColor($phpSheet
        ->getTabColor()
        ->getRGB());
    }
  }
}