Example #1
0
	 * Read PALETTE record
	 */
    private function _readPalette()
    {
        $length = self::_GetInt2d($this->_data, $this->_pos + 2);
        $recordData = substr($this->_data, $this->_pos + 4, $length);
        // move stream pointer to next record
        $this->_pos += 4 + $length;
        if (!$this->_readDataOnly) {
            // offset: 0; size: 2; number of following colors
            $nm = self::_GetInt2d($recordData, 0);
            // list of RGB colors
            for ($i = 0; $i < $nm; ++$i) {
Example #2
0
 /**
  * Constructs one Moodle Worksheet.
  *
  * @param string $name The name of the file
  * @param PHPExcel $workbook The internal Workbook object we are creating.
  */
 public function __construct($name, PHPExcel $workbook)
 {
     // Replace any characters in the name that Excel cannot cope with.
     $name = strtr($name, '[]*/\\?:', '       ');
     // Shorten the title if necessary.
     $name = core_text::substr($name, 0, 31);
     if ($name === '') {
         // Name is required!
         $name = 'Sheet' . ($workbook->getSheetCount() + 1);
     }
     $this->worksheet = new PHPExcel_Worksheet($workbook, $name);
     $this->worksheet->setPrintGridlines(false);
     $workbook->addSheet($this->worksheet);
 }