mirror of
https://github.com/retailcrm/PHPExcel.git
synced 2024-11-22 05:16:06 +03:00
Merge branch 'psr2' into develop
This commit is contained in:
commit
17c644bef6
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* PHPExcel
|
||||
* PHPExcel_Reader_Abstract
|
||||
*
|
||||
* Copyright (c) 2006 - 2015 PHPExcel
|
||||
*
|
||||
@ -24,15 +25,6 @@
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* PHPExcel_Reader_Abstract
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_Reader
|
||||
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
abstract class PHPExcel_Reader_Abstract implements PHPExcel_Reader_IReader
|
||||
{
|
||||
/**
|
||||
@ -42,7 +34,7 @@ abstract class PHPExcel_Reader_Abstract implements PHPExcel_Reader_IReader
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
protected $_readDataOnly = false;
|
||||
protected $readDataOnly = false;
|
||||
|
||||
/**
|
||||
* Read charts that are defined in the workbook?
|
||||
@ -50,7 +42,7 @@ abstract class PHPExcel_Reader_Abstract implements PHPExcel_Reader_IReader
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
protected $_includeCharts = false;
|
||||
protected $includeCharts = false;
|
||||
|
||||
/**
|
||||
* Restrict which sheets should be loaded?
|
||||
@ -58,16 +50,16 @@ abstract class PHPExcel_Reader_Abstract implements PHPExcel_Reader_IReader
|
||||
*
|
||||
* @var array of string
|
||||
*/
|
||||
protected $_loadSheetsOnly = null;
|
||||
protected $loadSheetsOnly;
|
||||
|
||||
/**
|
||||
* PHPExcel_Reader_IReadFilter instance
|
||||
*
|
||||
* @var PHPExcel_Reader_IReadFilter
|
||||
*/
|
||||
protected $_readFilter = null;
|
||||
protected $readFilter;
|
||||
|
||||
protected $_fileHandle = null;
|
||||
protected $fileHandle = null;
|
||||
|
||||
|
||||
/**
|
||||
@ -79,7 +71,7 @@ abstract class PHPExcel_Reader_Abstract implements PHPExcel_Reader_IReader
|
||||
*/
|
||||
public function getReadDataOnly()
|
||||
{
|
||||
return $this->_readDataOnly;
|
||||
return $this->readDataOnly;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -93,7 +85,7 @@ abstract class PHPExcel_Reader_Abstract implements PHPExcel_Reader_IReader
|
||||
*/
|
||||
public function setReadDataOnly($pValue = false)
|
||||
{
|
||||
$this->_readDataOnly = $pValue;
|
||||
$this->readDataOnly = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -107,7 +99,7 @@ abstract class PHPExcel_Reader_Abstract implements PHPExcel_Reader_IReader
|
||||
*/
|
||||
public function getIncludeCharts()
|
||||
{
|
||||
return $this->_includeCharts;
|
||||
return $this->includeCharts;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -122,7 +114,7 @@ abstract class PHPExcel_Reader_Abstract implements PHPExcel_Reader_IReader
|
||||
*/
|
||||
public function setIncludeCharts($pValue = false)
|
||||
{
|
||||
$this->_includeCharts = (boolean) $pValue;
|
||||
$this->includeCharts = (boolean) $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -135,7 +127,7 @@ abstract class PHPExcel_Reader_Abstract implements PHPExcel_Reader_IReader
|
||||
*/
|
||||
public function getLoadSheetsOnly()
|
||||
{
|
||||
return $this->_loadSheetsOnly;
|
||||
return $this->loadSheetsOnly;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -153,7 +145,7 @@ abstract class PHPExcel_Reader_Abstract implements PHPExcel_Reader_IReader
|
||||
return $this->setLoadAllSheets();
|
||||
}
|
||||
|
||||
$this->_loadSheetsOnly = is_array($value) ? $value : array($value);
|
||||
$this->loadSheetsOnly = is_array($value) ? $value : array($value);
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -165,7 +157,7 @@ abstract class PHPExcel_Reader_Abstract implements PHPExcel_Reader_IReader
|
||||
*/
|
||||
public function setLoadAllSheets()
|
||||
{
|
||||
$this->_loadSheetsOnly = null;
|
||||
$this->loadSheetsOnly = null;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -176,7 +168,7 @@ abstract class PHPExcel_Reader_Abstract implements PHPExcel_Reader_IReader
|
||||
*/
|
||||
public function getReadFilter()
|
||||
{
|
||||
return $this->_readFilter;
|
||||
return $this->readFilter;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -187,7 +179,7 @@ abstract class PHPExcel_Reader_Abstract implements PHPExcel_Reader_IReader
|
||||
*/
|
||||
public function setReadFilter(PHPExcel_Reader_IReadFilter $pValue)
|
||||
{
|
||||
$this->_readFilter = $pValue;
|
||||
$this->readFilter = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -198,7 +190,7 @@ abstract class PHPExcel_Reader_Abstract implements PHPExcel_Reader_IReader
|
||||
* @throws PHPExcel_Reader_Exception
|
||||
* @return resource
|
||||
*/
|
||||
protected function _openFile($pFilename)
|
||||
protected function openFile($pFilename)
|
||||
{
|
||||
// Check if file exists
|
||||
if (!file_exists($pFilename) || !is_readable($pFilename)) {
|
||||
@ -206,8 +198,8 @@ abstract class PHPExcel_Reader_Abstract implements PHPExcel_Reader_IReader
|
||||
}
|
||||
|
||||
// Open file
|
||||
$this->_fileHandle = fopen($pFilename, 'r');
|
||||
if ($this->_fileHandle === false) {
|
||||
$this->fileHandle = fopen($pFilename, 'r');
|
||||
if ($this->fileHandle === false) {
|
||||
throw new PHPExcel_Reader_Exception("Could not open file " . $pFilename . " for reading.");
|
||||
}
|
||||
}
|
||||
@ -223,13 +215,13 @@ abstract class PHPExcel_Reader_Abstract implements PHPExcel_Reader_IReader
|
||||
{
|
||||
// Check if file exists
|
||||
try {
|
||||
$this->_openFile($pFilename);
|
||||
$this->openFile($pFilename);
|
||||
} catch (Exception $e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$readable = $this->_isValidFormat();
|
||||
fclose($this->_fileHandle);
|
||||
$readable = $this->isValidFormat();
|
||||
fclose($this->fileHandle);
|
||||
return $readable;
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,16 @@
|
||||
<?php
|
||||
|
||||
/** PHPExcel root directory */
|
||||
if (!defined('PHPEXCEL_ROOT')) {
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
|
||||
require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||
}
|
||||
|
||||
/**
|
||||
* PHPExcel
|
||||
* PHPExcel_Reader_CSV
|
||||
*
|
||||
* Copyright (c) 2006 - 2015 PHPExcel
|
||||
*
|
||||
@ -24,24 +34,6 @@
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
|
||||
/** PHPExcel root directory */
|
||||
if (!defined('PHPEXCEL_ROOT')) {
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
|
||||
require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||
}
|
||||
|
||||
/**
|
||||
* PHPExcel_Reader_CSV
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_Reader
|
||||
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_Reader_IReader
|
||||
{
|
||||
/**
|
||||
@ -97,7 +89,7 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->_readFilter = new PHPExcel_Reader_DefaultReadFilter();
|
||||
$this->readFilter = new PHPExcel_Reader_DefaultReadFilter();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -105,7 +97,7 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
protected function _isValidFormat()
|
||||
protected function isValidFormat()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@ -135,30 +127,30 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
|
||||
* Move filepointer past any BOM marker
|
||||
*
|
||||
*/
|
||||
protected function _skipBOM()
|
||||
protected function skipBOM()
|
||||
{
|
||||
rewind($this->_fileHandle);
|
||||
rewind($this->fileHandle);
|
||||
|
||||
switch ($this->inputEncoding) {
|
||||
case 'UTF-8':
|
||||
fgets($this->_fileHandle, 4) == "\xEF\xBB\xBF" ?
|
||||
fseek($this->_fileHandle, 3) : fseek($this->_fileHandle, 0);
|
||||
fgets($this->fileHandle, 4) == "\xEF\xBB\xBF" ?
|
||||
fseek($this->fileHandle, 3) : fseek($this->fileHandle, 0);
|
||||
break;
|
||||
case 'UTF-16LE':
|
||||
fgets($this->_fileHandle, 3) == "\xFF\xFE" ?
|
||||
fseek($this->_fileHandle, 2) : fseek($this->_fileHandle, 0);
|
||||
fgets($this->fileHandle, 3) == "\xFF\xFE" ?
|
||||
fseek($this->fileHandle, 2) : fseek($this->fileHandle, 0);
|
||||
break;
|
||||
case 'UTF-16BE':
|
||||
fgets($this->_fileHandle, 3) == "\xFE\xFF" ?
|
||||
fseek($this->_fileHandle, 2) : fseek($this->_fileHandle, 0);
|
||||
fgets($this->fileHandle, 3) == "\xFE\xFF" ?
|
||||
fseek($this->fileHandle, 2) : fseek($this->fileHandle, 0);
|
||||
break;
|
||||
case 'UTF-32LE':
|
||||
fgets($this->_fileHandle, 5) == "\xFF\xFE\x00\x00" ?
|
||||
fseek($this->_fileHandle, 4) : fseek($this->_fileHandle, 0);
|
||||
fgets($this->fileHandle, 5) == "\xFF\xFE\x00\x00" ?
|
||||
fseek($this->fileHandle, 4) : fseek($this->fileHandle, 0);
|
||||
break;
|
||||
case 'UTF-32BE':
|
||||
fgets($this->_fileHandle, 5) == "\x00\x00\xFE\xFF" ?
|
||||
fseek($this->_fileHandle, 4) : fseek($this->_fileHandle, 0);
|
||||
fgets($this->fileHandle, 5) == "\x00\x00\xFE\xFF" ?
|
||||
fseek($this->fileHandle, 4) : fseek($this->fileHandle, 0);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@ -174,15 +166,15 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
|
||||
public function listWorksheetInfo($pFilename)
|
||||
{
|
||||
// Open file
|
||||
$this->_openFile($pFilename);
|
||||
if (!$this->_isValidFormat()) {
|
||||
fclose($this->_fileHandle);
|
||||
$this->openFile($pFilename);
|
||||
if (!$this->isValidFormat()) {
|
||||
fclose($this->fileHandle);
|
||||
throw new PHPExcel_Reader_Exception($pFilename . " is an Invalid Spreadsheet file.");
|
||||
}
|
||||
$fileHandle = $this->_fileHandle;
|
||||
$fileHandle = $this->fileHandle;
|
||||
|
||||
// Skip BOM, if any
|
||||
$this->_skipBOM();
|
||||
$this->skipBOM();
|
||||
|
||||
$escapeEnclosures = array( "\\" . $this->enclosure, $this->enclosure . $this->enclosure );
|
||||
|
||||
@ -238,15 +230,15 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
|
||||
ini_set('auto_detect_line_endings', true);
|
||||
|
||||
// Open file
|
||||
$this->_openFile($pFilename);
|
||||
if (!$this->_isValidFormat()) {
|
||||
fclose($this->_fileHandle);
|
||||
$this->openFile($pFilename);
|
||||
if (!$this->isValidFormat()) {
|
||||
fclose($this->fileHandle);
|
||||
throw new PHPExcel_Reader_Exception($pFilename . " is an Invalid Spreadsheet file.");
|
||||
}
|
||||
$fileHandle = $this->_fileHandle;
|
||||
$fileHandle = $this->fileHandle;
|
||||
|
||||
// Skip BOM, if any
|
||||
$this->_skipBOM();
|
||||
$this->skipBOM();
|
||||
|
||||
// Create new PHPExcel object
|
||||
while ($objPHPExcel->getSheetCount() <= $this->sheetIndex) {
|
||||
@ -268,7 +260,7 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
|
||||
while (($rowData = fgetcsv($fileHandle, 0, $this->delimiter, $this->enclosure)) !== false) {
|
||||
$columnLetter = 'A';
|
||||
foreach ($rowData as $rowDatum) {
|
||||
if ($rowDatum != '' && $this->_readFilter->readCell($columnLetter, $currentRow)) {
|
||||
if ($rowDatum != '' && $this->readFilter->readCell($columnLetter, $currentRow)) {
|
||||
// Unescape enclosures
|
||||
$rowDatum = str_replace($escapeEnclosures, $this->enclosure, $rowDatum);
|
||||
|
||||
|
@ -1,6 +1,16 @@
|
||||
<?php
|
||||
|
||||
/** PHPExcel root directory */
|
||||
if (!defined('PHPEXCEL_ROOT')) {
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
|
||||
require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||
}
|
||||
|
||||
/**
|
||||
* PHPExcel
|
||||
* PHPExcel_Reader_DefaultReadFilter
|
||||
*
|
||||
* Copyright (c) 2006 - 2015 PHPExcel
|
||||
*
|
||||
@ -24,33 +34,15 @@
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
|
||||
/** PHPExcel root directory */
|
||||
if (!defined('PHPEXCEL_ROOT')) {
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
|
||||
require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||
}
|
||||
|
||||
/**
|
||||
* PHPExcel_Reader_DefaultReadFilter
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_Reader
|
||||
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
class PHPExcel_Reader_DefaultReadFilter implements PHPExcel_Reader_IReadFilter
|
||||
{
|
||||
/**
|
||||
* Should this cell be read?
|
||||
*
|
||||
* @param $column String column index
|
||||
* @param $row Row index
|
||||
* @param $column Column address (as a string value like "A", or "IV")
|
||||
* @param $row Row number
|
||||
* @param $worksheetName Optional worksheet name
|
||||
* @return boolean
|
||||
* @return boolean
|
||||
*/
|
||||
public function readCell($column, $row, $worksheetName = '')
|
||||
{
|
||||
|
@ -55,7 +55,7 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->_readFilter = new PHPExcel_Reader_DefaultReadFilter();
|
||||
$this->readFilter = new PHPExcel_Reader_DefaultReadFilter();
|
||||
}
|
||||
|
||||
|
||||
@ -85,8 +85,8 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
|
||||
);
|
||||
|
||||
// Open file
|
||||
$this->_openFile($pFilename);
|
||||
$fileHandle = $this->_fileHandle;
|
||||
$this->openFile($pFilename);
|
||||
$fileHandle = $this->fileHandle;
|
||||
|
||||
// Read sample data (first 2 KB will do)
|
||||
$data = fread($fileHandle, 2048);
|
||||
@ -135,7 +135,7 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
|
||||
$xml_ss = $xml->children($namespaces['ss']);
|
||||
foreach ($xml_ss->Worksheet as $worksheet) {
|
||||
$worksheet_ss = $worksheet->attributes($namespaces['ss']);
|
||||
$worksheetNames[] = self::_convertStringEncoding((string) $worksheet_ss['Name'], $this->charSet);
|
||||
$worksheetNames[] = self::convertStringEncoding((string) $worksheet_ss['Name'], $this->charSet);
|
||||
}
|
||||
|
||||
return $worksheetNames;
|
||||
@ -247,7 +247,7 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
|
||||
* @param pxs
|
||||
* @return
|
||||
*/
|
||||
protected static function _pixel2WidthUnits($pxs)
|
||||
protected static function pixel2WidthUnits($pxs)
|
||||
{
|
||||
$UNIT_OFFSET_MAP = array(0, 36, 73, 109, 146, 182, 219);
|
||||
|
||||
@ -261,7 +261,7 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
|
||||
* @param widthUnits
|
||||
* @return
|
||||
*/
|
||||
protected static function _widthUnits2Pixel($widthUnits)
|
||||
protected static function widthUnits2Pixel($widthUnits)
|
||||
{
|
||||
$pixels = ($widthUnits / 256) * 7;
|
||||
$offsetWidthUnits = $widthUnits % 256;
|
||||
@ -269,7 +269,7 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
|
||||
return $pixels;
|
||||
}
|
||||
|
||||
protected static function _hex2str($hex)
|
||||
protected static function hex2str($hex)
|
||||
{
|
||||
return chr(hexdec($hex[1]));
|
||||
}
|
||||
@ -329,39 +329,39 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
|
||||
foreach ($xml->DocumentProperties[0] as $propertyName => $propertyValue) {
|
||||
switch ($propertyName) {
|
||||
case 'Title':
|
||||
$docProps->setTitle(self::_convertStringEncoding($propertyValue, $this->charSet));
|
||||
$docProps->setTitle(self::convertStringEncoding($propertyValue, $this->charSet));
|
||||
break;
|
||||
case 'Subject':
|
||||
$docProps->setSubject(self::_convertStringEncoding($propertyValue, $this->charSet));
|
||||
$docProps->setSubject(self::convertStringEncoding($propertyValue, $this->charSet));
|
||||
break;
|
||||
case 'Author':
|
||||
$docProps->setCreator(self::_convertStringEncoding($propertyValue, $this->charSet));
|
||||
$docProps->setCreator(self::convertStringEncoding($propertyValue, $this->charSet));
|
||||
break;
|
||||
case 'Created':
|
||||
$creationDate = strtotime($propertyValue);
|
||||
$docProps->setCreated($creationDate);
|
||||
break;
|
||||
case 'LastAuthor':
|
||||
$docProps->setLastModifiedBy(self::_convertStringEncoding($propertyValue, $this->charSet));
|
||||
$docProps->setLastModifiedBy(self::convertStringEncoding($propertyValue, $this->charSet));
|
||||
break;
|
||||
case 'LastSaved':
|
||||
$lastSaveDate = strtotime($propertyValue);
|
||||
$docProps->setModified($lastSaveDate);
|
||||
break;
|
||||
case 'Company':
|
||||
$docProps->setCompany(self::_convertStringEncoding($propertyValue, $this->charSet));
|
||||
$docProps->setCompany(self::convertStringEncoding($propertyValue, $this->charSet));
|
||||
break;
|
||||
case 'Category':
|
||||
$docProps->setCategory(self::_convertStringEncoding($propertyValue, $this->charSet));
|
||||
$docProps->setCategory(self::convertStringEncoding($propertyValue, $this->charSet));
|
||||
break;
|
||||
case 'Manager':
|
||||
$docProps->setManager(self::_convertStringEncoding($propertyValue, $this->charSet));
|
||||
$docProps->setManager(self::convertStringEncoding($propertyValue, $this->charSet));
|
||||
break;
|
||||
case 'Keywords':
|
||||
$docProps->setKeywords(self::_convertStringEncoding($propertyValue, $this->charSet));
|
||||
$docProps->setKeywords(self::convertStringEncoding($propertyValue, $this->charSet));
|
||||
break;
|
||||
case 'Description':
|
||||
$docProps->setDescription(self::_convertStringEncoding($propertyValue, $this->charSet));
|
||||
$docProps->setDescription(self::convertStringEncoding($propertyValue, $this->charSet));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -369,7 +369,7 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
|
||||
if (isset($xml->CustomDocumentProperties)) {
|
||||
foreach ($xml->CustomDocumentProperties[0] as $propertyName => $propertyValue) {
|
||||
$propertyAttributes = $propertyValue->attributes($namespaces['dt']);
|
||||
$propertyName = preg_replace_callback('/_x([0-9a-z]{4})_/', 'PHPExcel_Reader_Excel2003XML::_hex2str', $propertyName);
|
||||
$propertyName = preg_replace_callback('/_x([0-9a-z]{4})_/', 'PHPExcel_Reader_Excel2003XML::hex2str', $propertyName);
|
||||
$propertyType = PHPExcel_DocumentProperties::PROPERTY_TYPE_UNKNOWN;
|
||||
switch ((string) $propertyAttributes) {
|
||||
case 'string':
|
||||
@ -531,8 +531,8 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
|
||||
foreach ($xml_ss->Worksheet as $worksheet) {
|
||||
$worksheet_ss = $worksheet->attributes($namespaces['ss']);
|
||||
|
||||
if ((isset($this->_loadSheetsOnly)) && (isset($worksheet_ss['Name'])) &&
|
||||
(!in_array($worksheet_ss['Name'], $this->_loadSheetsOnly))) {
|
||||
if ((isset($this->loadSheetsOnly)) && (isset($worksheet_ss['Name'])) &&
|
||||
(!in_array($worksheet_ss['Name'], $this->loadSheetsOnly))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -542,7 +542,7 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
|
||||
$objPHPExcel->createSheet();
|
||||
$objPHPExcel->setActiveSheetIndex($worksheetID);
|
||||
if (isset($worksheet_ss['Name'])) {
|
||||
$worksheetName = self::_convertStringEncoding((string) $worksheet_ss['Name'], $this->charSet);
|
||||
$worksheetName = self::convertStringEncoding((string) $worksheet_ss['Name'], $this->charSet);
|
||||
// Use false for $updateFormulaCellReferences to prevent adjustment of worksheet references in
|
||||
// formula cells... during the load, all formulae should be correct, and we're simply bringing
|
||||
// the worksheet name in line with the formula, not the reverse
|
||||
@ -632,7 +632,7 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
|
||||
const TYPE_ERROR = 'e';
|
||||
*/
|
||||
case 'String':
|
||||
$cellValue = self::_convertStringEncoding($cellValue, $this->charSet);
|
||||
$cellValue = self::convertStringEncoding($cellValue, $this->charSet);
|
||||
$type = PHPExcel_Cell_DataType::TYPE_STRING;
|
||||
break;
|
||||
case 'Number':
|
||||
@ -740,7 +740,7 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
|
||||
// echo $annotation,'<br />';
|
||||
$annotation = strip_tags($node);
|
||||
// echo 'Annotation: ', $annotation,'<br />';
|
||||
$objPHPExcel->getActiveSheet()->getComment($columnID.$rowID)->setAuthor(self::_convertStringEncoding($author, $this->charSet))->setText($this->_parseRichText($annotation));
|
||||
$objPHPExcel->getActiveSheet()->getComment($columnID.$rowID)->setAuthor(self::convertStringEncoding($author, $this->charSet))->setText($this->parseRichText($annotation));
|
||||
}
|
||||
|
||||
if (($cellIsSet) && (isset($cell_ss['StyleID']))) {
|
||||
@ -785,7 +785,7 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
|
||||
}
|
||||
|
||||
|
||||
protected static function _convertStringEncoding($string, $charset)
|
||||
protected static function convertStringEncoding($string, $charset)
|
||||
{
|
||||
if ($charset != 'UTF-8') {
|
||||
return PHPExcel_Shared_String::ConvertEncoding($string, 'UTF-8', $charset);
|
||||
@ -794,11 +794,11 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
|
||||
}
|
||||
|
||||
|
||||
protected function _parseRichText($is = '')
|
||||
protected function parseRichText($is = '')
|
||||
{
|
||||
$value = new PHPExcel_RichText();
|
||||
|
||||
$value->createText(self::_convertStringEncoding($is, $this->charSet));
|
||||
$value->createText(self::convertStringEncoding($is, $this->charSet));
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->_readFilter = new PHPExcel_Reader_DefaultReadFilter();
|
||||
$this->readFilter = new PHPExcel_Reader_DefaultReadFilter();
|
||||
$this->referenceHelper = PHPExcel_ReferenceHelper::getInstance();
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
$zip = new $zipClass;
|
||||
if ($zip->open($pFilename) === true) {
|
||||
// check if it is an OOXML archive
|
||||
$rels = simplexml_load_string($this->securityScan($this->_getFromZipArchive($zip, "_rels/.rels")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());
|
||||
$rels = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, "_rels/.rels")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());
|
||||
if ($rels !== false) {
|
||||
foreach ($rels->Relationship as $rel) {
|
||||
switch ($rel["Type"]) {
|
||||
@ -127,13 +127,13 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
|
||||
// The files we're looking at here are small enough that simpleXML is more efficient than XMLReader
|
||||
$rels = simplexml_load_string(
|
||||
$this->securityScan($this->_getFromZipArchive($zip, "_rels/.rels"), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions())
|
||||
$this->securityScan($this->getFromZipArchive($zip, "_rels/.rels"), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions())
|
||||
); //~ http://schemas.openxmlformats.org/package/2006/relationships");
|
||||
foreach ($rels->Relationship as $rel) {
|
||||
switch ($rel["Type"]) {
|
||||
case "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument":
|
||||
$xmlWorkbook = simplexml_load_string(
|
||||
$this->securityScan($this->_getFromZipArchive($zip, "{$rel['Target']}"), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions())
|
||||
$this->securityScan($this->getFromZipArchive($zip, "{$rel['Target']}"), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions())
|
||||
); //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main");
|
||||
|
||||
if ($xmlWorkbook->sheets) {
|
||||
@ -171,11 +171,11 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
$zip = new $zipClass;
|
||||
$zip->open($pFilename);
|
||||
|
||||
$rels = simplexml_load_string($this->securityScan($this->_getFromZipArchive($zip, "_rels/.rels")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/package/2006/relationships");
|
||||
$rels = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, "_rels/.rels")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/package/2006/relationships");
|
||||
foreach ($rels->Relationship as $rel) {
|
||||
if ($rel["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument") {
|
||||
$dir = dirname($rel["Target"]);
|
||||
$relsWorkbook = simplexml_load_string($this->securityScan($this->_getFromZipArchive($zip, "$dir/_rels/" . basename($rel["Target"]) . ".rels")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/package/2006/relationships");
|
||||
$relsWorkbook = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, "$dir/_rels/" . basename($rel["Target"]) . ".rels")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/package/2006/relationships");
|
||||
$relsWorkbook->registerXPathNamespace("rel", "http://schemas.openxmlformats.org/package/2006/relationships");
|
||||
|
||||
$worksheets = array();
|
||||
@ -185,7 +185,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
}
|
||||
}
|
||||
|
||||
$xmlWorkbook = simplexml_load_string($this->securityScan($this->_getFromZipArchive($zip, "{$rel['Target']}")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main");
|
||||
$xmlWorkbook = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, "{$rel['Target']}")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main");
|
||||
if ($xmlWorkbook->sheets) {
|
||||
$dir = dirname($rel["Target"]);
|
||||
foreach ($xmlWorkbook->sheets->sheet as $eleSheet) {
|
||||
@ -197,7 +197,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
'totalColumns' => 0,
|
||||
);
|
||||
|
||||
$fileWorksheet = $worksheets[(string) self::array_item($eleSheet->attributes("http://schemas.openxmlformats.org/officeDocument/2006/relationships"), "id")];
|
||||
$fileWorksheet = $worksheets[(string) self::getArrayItem($eleSheet->attributes("http://schemas.openxmlformats.org/officeDocument/2006/relationships"), "id")];
|
||||
|
||||
$xml = new XMLReader();
|
||||
$res = $xml->xml($this->securityScanFile('zip://'.PHPExcel_Shared_File::realpath($pFilename).'#'."$dir/$fileWorksheet"), null, PHPExcel_Settings::getLibXmlLoaderOptions());
|
||||
@ -299,7 +299,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
}
|
||||
|
||||
|
||||
public function _getFromZipArchive($archive, $fileName = '')
|
||||
private function getFromZipArchive($archive, $fileName = '')
|
||||
{
|
||||
// Root-relative paths
|
||||
if (strpos($fileName, '//') !== false) {
|
||||
@ -334,7 +334,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
// Initialisations
|
||||
$excel = new PHPExcel;
|
||||
$excel->removeSheetByIndex(0);
|
||||
if (!$this->_readDataOnly) {
|
||||
if (!$this->readDataOnly) {
|
||||
$excel->removeCellStyleXfByIndex(0); // remove the default style
|
||||
$excel->removeCellXfByIndex(0); // remove the default style
|
||||
}
|
||||
@ -345,14 +345,14 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
$zip->open($pFilename);
|
||||
|
||||
// Read the theme first, because we need the colour scheme when reading the styles
|
||||
$wbRels = simplexml_load_string($this->securityScan($this->_getFromZipArchive($zip, "xl/_rels/workbook.xml.rels")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/package/2006/relationships");
|
||||
$wbRels = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, "xl/_rels/workbook.xml.rels")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/package/2006/relationships");
|
||||
foreach ($wbRels->Relationship as $rel) {
|
||||
switch ($rel["Type"]) {
|
||||
case "http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme":
|
||||
$themeOrderArray = array('lt1', 'dk1', 'lt2', 'dk2');
|
||||
$themeOrderAdditional = count($themeOrderArray);
|
||||
|
||||
$xmlTheme = simplexml_load_string($this->securityScan($this->_getFromZipArchive($zip, "xl/{$rel['Target']}")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());
|
||||
$xmlTheme = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, "xl/{$rel['Target']}")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());
|
||||
if (is_object($xmlTheme)) {
|
||||
$xmlThemeName = $xmlTheme->attributes();
|
||||
$xmlTheme = $xmlTheme->children("http://schemas.openxmlformats.org/drawingml/2006/main");
|
||||
@ -382,29 +382,29 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
}
|
||||
}
|
||||
|
||||
$rels = simplexml_load_string($this->securityScan($this->_getFromZipArchive($zip, "_rels/.rels")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/package/2006/relationships");
|
||||
$rels = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, "_rels/.rels")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/package/2006/relationships");
|
||||
foreach ($rels->Relationship as $rel) {
|
||||
switch ($rel["Type"]) {
|
||||
case "http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties":
|
||||
$xmlCore = simplexml_load_string($this->securityScan($this->_getFromZipArchive($zip, "{$rel['Target']}")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());
|
||||
$xmlCore = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, "{$rel['Target']}")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());
|
||||
if (is_object($xmlCore)) {
|
||||
$xmlCore->registerXPathNamespace("dc", "http://purl.org/dc/elements/1.1/");
|
||||
$xmlCore->registerXPathNamespace("dcterms", "http://purl.org/dc/terms/");
|
||||
$xmlCore->registerXPathNamespace("cp", "http://schemas.openxmlformats.org/package/2006/metadata/core-properties");
|
||||
$docProps = $excel->getProperties();
|
||||
$docProps->setCreator((string) self::array_item($xmlCore->xpath("dc:creator")));
|
||||
$docProps->setLastModifiedBy((string) self::array_item($xmlCore->xpath("cp:lastModifiedBy")));
|
||||
$docProps->setCreated(strtotime(self::array_item($xmlCore->xpath("dcterms:created")))); //! respect xsi:type
|
||||
$docProps->setModified(strtotime(self::array_item($xmlCore->xpath("dcterms:modified")))); //! respect xsi:type
|
||||
$docProps->setTitle((string) self::array_item($xmlCore->xpath("dc:title")));
|
||||
$docProps->setDescription((string) self::array_item($xmlCore->xpath("dc:description")));
|
||||
$docProps->setSubject((string) self::array_item($xmlCore->xpath("dc:subject")));
|
||||
$docProps->setKeywords((string) self::array_item($xmlCore->xpath("cp:keywords")));
|
||||
$docProps->setCategory((string) self::array_item($xmlCore->xpath("cp:category")));
|
||||
$docProps->setCreator((string) self::getArrayItem($xmlCore->xpath("dc:creator")));
|
||||
$docProps->setLastModifiedBy((string) self::getArrayItem($xmlCore->xpath("cp:lastModifiedBy")));
|
||||
$docProps->setCreated(strtotime(self::getArrayItem($xmlCore->xpath("dcterms:created")))); //! respect xsi:type
|
||||
$docProps->setModified(strtotime(self::getArrayItem($xmlCore->xpath("dcterms:modified")))); //! respect xsi:type
|
||||
$docProps->setTitle((string) self::getArrayItem($xmlCore->xpath("dc:title")));
|
||||
$docProps->setDescription((string) self::getArrayItem($xmlCore->xpath("dc:description")));
|
||||
$docProps->setSubject((string) self::getArrayItem($xmlCore->xpath("dc:subject")));
|
||||
$docProps->setKeywords((string) self::getArrayItem($xmlCore->xpath("cp:keywords")));
|
||||
$docProps->setCategory((string) self::getArrayItem($xmlCore->xpath("cp:category")));
|
||||
}
|
||||
break;
|
||||
case "http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties":
|
||||
$xmlCore = simplexml_load_string($this->securityScan($this->_getFromZipArchive($zip, "{$rel['Target']}")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());
|
||||
$xmlCore = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, "{$rel['Target']}")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());
|
||||
if (is_object($xmlCore)) {
|
||||
$docProps = $excel->getProperties();
|
||||
if (isset($xmlCore->Company)) {
|
||||
@ -416,7 +416,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
}
|
||||
break;
|
||||
case "http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties":
|
||||
$xmlCore = simplexml_load_string($this->securityScan($this->_getFromZipArchive($zip, "{$rel['Target']}")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());
|
||||
$xmlCore = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, "{$rel['Target']}")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());
|
||||
if (is_object($xmlCore)) {
|
||||
$docProps = $excel->getProperties();
|
||||
foreach ($xmlCore as $xmlProperty) {
|
||||
@ -442,12 +442,12 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
break;
|
||||
case "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument":
|
||||
$dir = dirname($rel["Target"]);
|
||||
$relsWorkbook = simplexml_load_string($this->securityScan($this->_getFromZipArchive($zip, "$dir/_rels/" . basename($rel["Target"]) . ".rels")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/package/2006/relationships");
|
||||
$relsWorkbook = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, "$dir/_rels/" . basename($rel["Target"]) . ".rels")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/package/2006/relationships");
|
||||
$relsWorkbook->registerXPathNamespace("rel", "http://schemas.openxmlformats.org/package/2006/relationships");
|
||||
|
||||
$sharedStrings = array();
|
||||
$xpath = self::array_item($relsWorkbook->xpath("rel:Relationship[@Type='http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings']"));
|
||||
$xmlStrings = simplexml_load_string($this->securityScan($this->_getFromZipArchive($zip, "$dir/$xpath[Target]")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main");
|
||||
$xpath = self::getArrayItem($relsWorkbook->xpath("rel:Relationship[@Type='http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings']"));
|
||||
$xmlStrings = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, "$dir/$xpath[Target]")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main");
|
||||
if (isset($xmlStrings) && isset($xmlStrings->si)) {
|
||||
foreach ($xmlStrings->si as $val) {
|
||||
if (isset($val->t)) {
|
||||
@ -473,12 +473,12 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
}
|
||||
|
||||
if (!is_null($macros)) {
|
||||
$macrosCode = $this->_getFromZipArchive($zip, 'xl/vbaProject.bin');//vbaProject.bin always in 'xl' dir and always named vbaProject.bin
|
||||
$macrosCode = $this->getFromZipArchive($zip, 'xl/vbaProject.bin');//vbaProject.bin always in 'xl' dir and always named vbaProject.bin
|
||||
if ($macrosCode !== false) {
|
||||
$excel->setMacrosCode($macrosCode);
|
||||
$excel->setHasMacros(true);
|
||||
//short-circuit : not reading vbaProject.bin.rel to get Signature =>allways vbaProjectSignature.bin in 'xl' dir
|
||||
$Certificate = $this->_getFromZipArchive($zip, 'xl/vbaProjectSignature.bin');
|
||||
$Certificate = $this->getFromZipArchive($zip, 'xl/vbaProjectSignature.bin');
|
||||
if ($Certificate !== false) {
|
||||
$excel->setMacrosCertificate($Certificate);
|
||||
}
|
||||
@ -486,8 +486,8 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
}
|
||||
$styles = array();
|
||||
$cellStyles = array();
|
||||
$xpath = self::array_item($relsWorkbook->xpath("rel:Relationship[@Type='http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles']"));
|
||||
$xmlStyles = simplexml_load_string($this->securityScan($this->_getFromZipArchive($zip, "$dir/$xpath[Target]")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main");
|
||||
$xpath = self::getArrayItem($relsWorkbook->xpath("rel:Relationship[@Type='http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles']"));
|
||||
$xmlStyles = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, "$dir/$xpath[Target]")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main");
|
||||
$numFmts = null;
|
||||
if ($xmlStyles && $xmlStyles->numFmts[0]) {
|
||||
$numFmts = $xmlStyles->numFmts[0];
|
||||
@ -495,13 +495,13 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
if (isset($numFmts) && ($numFmts !== null)) {
|
||||
$numFmts->registerXPathNamespace("sml", "http://schemas.openxmlformats.org/spreadsheetml/2006/main");
|
||||
}
|
||||
if (!$this->_readDataOnly && $xmlStyles) {
|
||||
if (!$this->readDataOnly && $xmlStyles) {
|
||||
foreach ($xmlStyles->cellXfs->xf as $xf) {
|
||||
$numFmt = PHPExcel_Style_NumberFormat::FORMAT_GENERAL;
|
||||
|
||||
if ($xf["numFmtId"]) {
|
||||
if (isset($numFmts)) {
|
||||
$tmpNumFmt = self::array_item($numFmts->xpath("sml:numFmt[@numFmtId=$xf[numFmtId]]"));
|
||||
$tmpNumFmt = self::getArrayItem($numFmts->xpath("sml:numFmt[@numFmtId=$xf[numFmtId]]"));
|
||||
|
||||
if (isset($tmpNumFmt["formatCode"])) {
|
||||
$numFmt = (string) $tmpNumFmt["formatCode"];
|
||||
@ -539,7 +539,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
foreach ($xmlStyles->cellStyleXfs->xf as $xf) {
|
||||
$numFmt = PHPExcel_Style_NumberFormat::FORMAT_GENERAL;
|
||||
if ($numFmts && $xf["numFmtId"]) {
|
||||
$tmpNumFmt = self::array_item($numFmts->xpath("sml:numFmt[@numFmtId=$xf[numFmtId]]"));
|
||||
$tmpNumFmt = self::getArrayItem($numFmts->xpath("sml:numFmt[@numFmtId=$xf[numFmtId]]"));
|
||||
if (isset($tmpNumFmt["formatCode"])) {
|
||||
$numFmt = (string) $tmpNumFmt["formatCode"];
|
||||
} elseif ((int)$xf["numFmtId"] < 165) {
|
||||
@ -566,7 +566,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
}
|
||||
|
||||
$dxfs = array();
|
||||
if (!$this->_readDataOnly && $xmlStyles) {
|
||||
if (!$this->readDataOnly && $xmlStyles) {
|
||||
// Conditional Styles
|
||||
if ($xmlStyles->dxfs) {
|
||||
foreach ($xmlStyles->dxfs->dxf as $dxf) {
|
||||
@ -591,7 +591,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
}
|
||||
}
|
||||
|
||||
$xmlWorkbook = simplexml_load_string($this->securityScan($this->_getFromZipArchive($zip, "{$rel['Target']}")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main");
|
||||
$xmlWorkbook = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, "{$rel['Target']}")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main");
|
||||
|
||||
// Set base date
|
||||
if ($xmlWorkbook->workbookPr) {
|
||||
@ -615,7 +615,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
++$oldSheetId;
|
||||
|
||||
// Check if sheet should be skipped
|
||||
if (isset($this->_loadSheetsOnly) && !in_array((string) $eleSheet["name"], $this->_loadSheetsOnly)) {
|
||||
if (isset($this->loadSheetsOnly) && !in_array((string) $eleSheet["name"], $this->loadSheetsOnly)) {
|
||||
++$countSkippedSheets;
|
||||
$mapSheetId[$oldSheetId] = null;
|
||||
continue;
|
||||
@ -632,8 +632,8 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
// and we're simply bringing the worksheet name in line with the formula, not the
|
||||
// reverse
|
||||
$docSheet->setTitle((string) $eleSheet["name"], false);
|
||||
$fileWorksheet = $worksheets[(string) self::array_item($eleSheet->attributes("http://schemas.openxmlformats.org/officeDocument/2006/relationships"), "id")];
|
||||
$xmlSheet = simplexml_load_string($this->securityScan($this->_getFromZipArchive($zip, "$dir/$fileWorksheet")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main");
|
||||
$fileWorksheet = $worksheets[(string) self::getArrayItem($eleSheet->attributes("http://schemas.openxmlformats.org/officeDocument/2006/relationships"), "id")];
|
||||
$xmlSheet = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, "$dir/$fileWorksheet")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main");
|
||||
|
||||
$sharedFormulas = array();
|
||||
|
||||
@ -737,10 +737,10 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($xmlSheet->cols) && !$this->_readDataOnly) {
|
||||
if (isset($xmlSheet->cols) && !$this->readDataOnly) {
|
||||
foreach ($xmlSheet->cols->col as $col) {
|
||||
for ($i = intval($col["min"]) - 1; $i < intval($col["max"]); ++$i) {
|
||||
if ($col["style"] && !$this->_readDataOnly) {
|
||||
if ($col["style"] && !$this->readDataOnly) {
|
||||
$docSheet->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($i))->setXfIndex(intval($col["style"]));
|
||||
}
|
||||
if (self::boolean($col["bestFit"])) {
|
||||
@ -765,7 +765,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($xmlSheet->printOptions) && !$this->_readDataOnly) {
|
||||
if (isset($xmlSheet->printOptions) && !$this->readDataOnly) {
|
||||
if (self::boolean((string) $xmlSheet->printOptions['gridLinesSet'])) {
|
||||
$docSheet->setShowGridlines(true);
|
||||
}
|
||||
@ -782,10 +782,10 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
|
||||
if ($xmlSheet && $xmlSheet->sheetData && $xmlSheet->sheetData->row) {
|
||||
foreach ($xmlSheet->sheetData->row as $row) {
|
||||
if ($row["ht"] && !$this->_readDataOnly) {
|
||||
if ($row["ht"] && !$this->readDataOnly) {
|
||||
$docSheet->getRowDimension(intval($row["r"]))->setRowHeight(floatval($row["ht"]));
|
||||
}
|
||||
if (self::boolean($row["hidden"]) && !$this->_readDataOnly) {
|
||||
if (self::boolean($row["hidden"]) && !$this->readDataOnly) {
|
||||
$docSheet->getRowDimension(intval($row["r"]))->setVisible(false);
|
||||
}
|
||||
if (self::boolean($row["collapsed"])) {
|
||||
@ -794,7 +794,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
if ($row["outlineLevel"] > 0) {
|
||||
$docSheet->getRowDimension(intval($row["r"]))->setOutlineLevel(intval($row["outlineLevel"]));
|
||||
}
|
||||
if ($row["s"] && !$this->_readDataOnly) {
|
||||
if ($row["s"] && !$this->readDataOnly) {
|
||||
$docSheet->getRowDimension(intval($row["r"]))->setXfIndex(intval($row["s"]));
|
||||
}
|
||||
|
||||
@ -888,7 +888,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
}
|
||||
|
||||
// Rich text?
|
||||
if ($value instanceof PHPExcel_RichText && $this->_readDataOnly) {
|
||||
if ($value instanceof PHPExcel_RichText && $this->readDataOnly) {
|
||||
$value = $value->getPlainText();
|
||||
}
|
||||
|
||||
@ -904,7 +904,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
}
|
||||
|
||||
// Style information?
|
||||
if ($c["s"] && !$this->_readDataOnly) {
|
||||
if ($c["s"] && !$this->readDataOnly) {
|
||||
// no style index means 0, it seems
|
||||
$cell->setXfIndex(isset($styles[intval($c["s"])]) ?
|
||||
intval($c["s"]) : 0);
|
||||
@ -914,7 +914,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
}
|
||||
|
||||
$conditionals = array();
|
||||
if (!$this->_readDataOnly && $xmlSheet && $xmlSheet->conditionalFormatting) {
|
||||
if (!$this->readDataOnly && $xmlSheet && $xmlSheet->conditionalFormatting) {
|
||||
foreach ($xmlSheet->conditionalFormatting as $conditional) {
|
||||
foreach ($conditional->cfRule as $cfRule) {
|
||||
if (((string)$cfRule["type"] == PHPExcel_Style_Conditional::CONDITION_NONE || (string)$cfRule["type"] == PHPExcel_Style_Conditional::CONDITION_CELLIS || (string)$cfRule["type"] == PHPExcel_Style_Conditional::CONDITION_CONTAINSTEXT || (string)$cfRule["type"] == PHPExcel_Style_Conditional::CONDITION_EXPRESSION) && isset($dxfs[intval($cfRule["dxfId"])])) {
|
||||
@ -955,14 +955,14 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
}
|
||||
|
||||
$aKeys = array("sheet", "objects", "scenarios", "formatCells", "formatColumns", "formatRows", "insertColumns", "insertRows", "insertHyperlinks", "deleteColumns", "deleteRows", "selectLockedCells", "sort", "autoFilter", "pivotTables", "selectUnlockedCells");
|
||||
if (!$this->_readDataOnly && $xmlSheet && $xmlSheet->sheetProtection) {
|
||||
if (!$this->readDataOnly && $xmlSheet && $xmlSheet->sheetProtection) {
|
||||
foreach ($aKeys as $key) {
|
||||
$method = "set" . ucfirst($key);
|
||||
$docSheet->getProtection()->$method(self::boolean((string) $xmlSheet->sheetProtection[$key]));
|
||||
}
|
||||
}
|
||||
|
||||
if (!$this->_readDataOnly && $xmlSheet && $xmlSheet->sheetProtection) {
|
||||
if (!$this->readDataOnly && $xmlSheet && $xmlSheet->sheetProtection) {
|
||||
$docSheet->getProtection()->setPassword((string) $xmlSheet->sheetProtection["password"], true);
|
||||
if ($xmlSheet->protectedRanges->protectedRange) {
|
||||
foreach ($xmlSheet->protectedRanges->protectedRange as $protectedRange) {
|
||||
@ -971,7 +971,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
}
|
||||
}
|
||||
|
||||
if ($xmlSheet && $xmlSheet->autoFilter && !$this->_readDataOnly) {
|
||||
if ($xmlSheet && $xmlSheet->autoFilter && !$this->readDataOnly) {
|
||||
$autoFilterRange = (string) $xmlSheet->autoFilter["ref"];
|
||||
if (strpos($autoFilterRange, ':') !== false) {
|
||||
$autoFilter = $docSheet->getAutoFilter();
|
||||
@ -1071,7 +1071,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
}
|
||||
}
|
||||
|
||||
if ($xmlSheet && $xmlSheet->mergeCells && $xmlSheet->mergeCells->mergeCell && !$this->_readDataOnly) {
|
||||
if ($xmlSheet && $xmlSheet->mergeCells && $xmlSheet->mergeCells->mergeCell && !$this->readDataOnly) {
|
||||
foreach ($xmlSheet->mergeCells->mergeCell as $mergeCell) {
|
||||
$mergeRef = (string) $mergeCell["ref"];
|
||||
if (strpos($mergeRef, ':') !== false) {
|
||||
@ -1080,7 +1080,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
}
|
||||
}
|
||||
|
||||
if ($xmlSheet && $xmlSheet->pageMargins && !$this->_readDataOnly) {
|
||||
if ($xmlSheet && $xmlSheet->pageMargins && !$this->readDataOnly) {
|
||||
$docPageMargins = $docSheet->getPageMargins();
|
||||
$docPageMargins->setLeft(floatval($xmlSheet->pageMargins["left"]));
|
||||
$docPageMargins->setRight(floatval($xmlSheet->pageMargins["right"]));
|
||||
@ -1090,7 +1090,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
$docPageMargins->setFooter(floatval($xmlSheet->pageMargins["footer"]));
|
||||
}
|
||||
|
||||
if ($xmlSheet && $xmlSheet->pageSetup && !$this->_readDataOnly) {
|
||||
if ($xmlSheet && $xmlSheet->pageSetup && !$this->readDataOnly) {
|
||||
$docPageSetup = $docSheet->getPageSetup();
|
||||
|
||||
if (isset($xmlSheet->pageSetup["orientation"])) {
|
||||
@ -1114,7 +1114,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
}
|
||||
}
|
||||
|
||||
if ($xmlSheet && $xmlSheet->headerFooter && !$this->_readDataOnly) {
|
||||
if ($xmlSheet && $xmlSheet->headerFooter && !$this->readDataOnly) {
|
||||
$docHeaderFooter = $docSheet->getHeaderFooter();
|
||||
|
||||
if (isset($xmlSheet->headerFooter["differentOddEven"]) &&
|
||||
@ -1150,14 +1150,14 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
$docHeaderFooter->setFirstFooter((string) $xmlSheet->headerFooter->firstFooter);
|
||||
}
|
||||
|
||||
if ($xmlSheet && $xmlSheet->rowBreaks && $xmlSheet->rowBreaks->brk && !$this->_readDataOnly) {
|
||||
if ($xmlSheet && $xmlSheet->rowBreaks && $xmlSheet->rowBreaks->brk && !$this->readDataOnly) {
|
||||
foreach ($xmlSheet->rowBreaks->brk as $brk) {
|
||||
if ($brk["man"]) {
|
||||
$docSheet->setBreak("A$brk[id]", PHPExcel_Worksheet::BREAK_ROW);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($xmlSheet && $xmlSheet->colBreaks && $xmlSheet->colBreaks->brk && !$this->_readDataOnly) {
|
||||
if ($xmlSheet && $xmlSheet->colBreaks && $xmlSheet->colBreaks->brk && !$this->readDataOnly) {
|
||||
foreach ($xmlSheet->colBreaks->brk as $brk) {
|
||||
if ($brk["man"]) {
|
||||
$docSheet->setBreak(PHPExcel_Cell::stringFromColumnIndex((string) $brk["id"]) . "1", PHPExcel_Worksheet::BREAK_COLUMN);
|
||||
@ -1165,7 +1165,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
}
|
||||
}
|
||||
|
||||
if ($xmlSheet && $xmlSheet->dataValidations && !$this->_readDataOnly) {
|
||||
if ($xmlSheet && $xmlSheet->dataValidations && !$this->readDataOnly) {
|
||||
foreach ($xmlSheet->dataValidations->dataValidation as $dataValidation) {
|
||||
// Uppercase coordinate
|
||||
$range = strtoupper($dataValidation["sqref"]);
|
||||
@ -1198,10 +1198,10 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
|
||||
// Add hyperlinks
|
||||
$hyperlinks = array();
|
||||
if (!$this->_readDataOnly) {
|
||||
if (!$this->readDataOnly) {
|
||||
// Locate hyperlink relations
|
||||
if ($zip->locateName(dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels")) {
|
||||
$relsWorksheet = simplexml_load_string($this->securityScan($this->_getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/package/2006/relationships");
|
||||
$relsWorksheet = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/package/2006/relationships");
|
||||
foreach ($relsWorksheet->Relationship as $ele) {
|
||||
if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink") {
|
||||
$hyperlinks[(string)$ele["Id"]] = (string)$ele["Target"];
|
||||
@ -1239,10 +1239,10 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
// Add comments
|
||||
$comments = array();
|
||||
$vmlComments = array();
|
||||
if (!$this->_readDataOnly) {
|
||||
if (!$this->readDataOnly) {
|
||||
// Locate comment relations
|
||||
if ($zip->locateName(dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels")) {
|
||||
$relsWorksheet = simplexml_load_string($this->securityScan($this->_getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/package/2006/relationships");
|
||||
$relsWorksheet = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/package/2006/relationships");
|
||||
foreach ($relsWorksheet->Relationship as $ele) {
|
||||
if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments") {
|
||||
$comments[(string)$ele["Id"]] = (string)$ele["Target"];
|
||||
@ -1257,7 +1257,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
foreach ($comments as $relName => $relPath) {
|
||||
// Load comments file
|
||||
$relPath = PHPExcel_Shared_File::realpath(dirname("$dir/$fileWorksheet") . "/" . $relPath);
|
||||
$commentsFile = simplexml_load_string($this->securityScan($this->_getFromZipArchive($zip, $relPath)), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());
|
||||
$commentsFile = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, $relPath)), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());
|
||||
|
||||
// Utility variables
|
||||
$authors = array();
|
||||
@ -1280,7 +1280,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
foreach ($vmlComments as $relName => $relPath) {
|
||||
// Load VML comments file
|
||||
$relPath = PHPExcel_Shared_File::realpath(dirname("$dir/$fileWorksheet") . "/" . $relPath);
|
||||
$vmlCommentsFile = simplexml_load_string($this->securityScan($this->_getFromZipArchive($zip, $relPath)), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());
|
||||
$vmlCommentsFile = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, $relPath)), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());
|
||||
$vmlCommentsFile->registerXPathNamespace('v', 'urn:schemas-microsoft-com:vml');
|
||||
|
||||
$shapes = $vmlCommentsFile->xpath('//v:shape');
|
||||
@ -1342,29 +1342,29 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
}
|
||||
|
||||
// Header/footer images
|
||||
if ($xmlSheet && $xmlSheet->legacyDrawingHF && !$this->_readDataOnly) {
|
||||
if ($xmlSheet && $xmlSheet->legacyDrawingHF && !$this->readDataOnly) {
|
||||
if ($zip->locateName(dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels")) {
|
||||
$relsWorksheet = simplexml_load_string($this->securityScan($this->_getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/package/2006/relationships");
|
||||
$relsWorksheet = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/package/2006/relationships");
|
||||
$vmlRelationship = '';
|
||||
|
||||
foreach ($relsWorksheet->Relationship as $ele) {
|
||||
if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing") {
|
||||
$vmlRelationship = self::dir_add("$dir/$fileWorksheet", $ele["Target"]);
|
||||
$vmlRelationship = self::dirAdd("$dir/$fileWorksheet", $ele["Target"]);
|
||||
}
|
||||
}
|
||||
|
||||
if ($vmlRelationship != '') {
|
||||
// Fetch linked images
|
||||
$relsVML = simplexml_load_string($this->securityScan($this->_getFromZipArchive($zip, dirname($vmlRelationship) . '/_rels/' . basename($vmlRelationship) . '.rels')), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/package/2006/relationships");
|
||||
$relsVML = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, dirname($vmlRelationship) . '/_rels/' . basename($vmlRelationship) . '.rels')), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/package/2006/relationships");
|
||||
$drawings = array();
|
||||
foreach ($relsVML->Relationship as $ele) {
|
||||
if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image") {
|
||||
$drawings[(string) $ele["Id"]] = self::dir_add($vmlRelationship, $ele["Target"]);
|
||||
$drawings[(string) $ele["Id"]] = self::dirAdd($vmlRelationship, $ele["Target"]);
|
||||
}
|
||||
}
|
||||
|
||||
// Fetch VML document
|
||||
$vmlDrawing = simplexml_load_string($this->securityScan($this->_getFromZipArchive($zip, $vmlRelationship)), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());
|
||||
$vmlDrawing = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, $vmlRelationship)), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());
|
||||
$vmlDrawing->registerXPathNamespace('v', 'urn:schemas-microsoft-com:vml');
|
||||
|
||||
$hfImages = array();
|
||||
@ -1403,26 +1403,26 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
|
||||
// TODO: Autoshapes from twoCellAnchors!
|
||||
if ($zip->locateName(dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels")) {
|
||||
$relsWorksheet = simplexml_load_string($this->securityScan($this->_getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/package/2006/relationships");
|
||||
$relsWorksheet = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/package/2006/relationships");
|
||||
$drawings = array();
|
||||
foreach ($relsWorksheet->Relationship as $ele) {
|
||||
if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing") {
|
||||
$drawings[(string) $ele["Id"]] = self::dir_add("$dir/$fileWorksheet", $ele["Target"]);
|
||||
$drawings[(string) $ele["Id"]] = self::dirAdd("$dir/$fileWorksheet", $ele["Target"]);
|
||||
}
|
||||
}
|
||||
if ($xmlSheet->drawing && !$this->_readDataOnly) {
|
||||
if ($xmlSheet->drawing && !$this->readDataOnly) {
|
||||
foreach ($xmlSheet->drawing as $drawing) {
|
||||
$fileDrawing = $drawings[(string) self::array_item($drawing->attributes("http://schemas.openxmlformats.org/officeDocument/2006/relationships"), "id")];
|
||||
$relsDrawing = simplexml_load_string($this->securityScan($this->_getFromZipArchive($zip, dirname($fileDrawing) . "/_rels/" . basename($fileDrawing) . ".rels")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/package/2006/relationships");
|
||||
$fileDrawing = $drawings[(string) self::getArrayItem($drawing->attributes("http://schemas.openxmlformats.org/officeDocument/2006/relationships"), "id")];
|
||||
$relsDrawing = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, dirname($fileDrawing) . "/_rels/" . basename($fileDrawing) . ".rels")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/package/2006/relationships");
|
||||
$images = array();
|
||||
|
||||
if ($relsDrawing && $relsDrawing->Relationship) {
|
||||
foreach ($relsDrawing->Relationship as $ele) {
|
||||
if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image") {
|
||||
$images[(string) $ele["Id"]] = self::dir_add($fileDrawing, $ele["Target"]);
|
||||
$images[(string) $ele["Id"]] = self::dirAdd($fileDrawing, $ele["Target"]);
|
||||
} elseif ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart") {
|
||||
if ($this->_includeCharts) {
|
||||
$charts[self::dir_add($fileDrawing, $ele["Target"])] = array(
|
||||
if ($this->includeCharts) {
|
||||
$charts[self::dirAdd($fileDrawing, $ele["Target"])] = array(
|
||||
'id' => (string) $ele["Id"],
|
||||
'sheet' => $docSheet->getTitle()
|
||||
);
|
||||
@ -1430,7 +1430,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
}
|
||||
}
|
||||
}
|
||||
$xmlDrawing = simplexml_load_string($this->securityScan($this->_getFromZipArchive($zip, $fileDrawing)), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions())->children("http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing");
|
||||
$xmlDrawing = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, $fileDrawing)), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions())->children("http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing");
|
||||
|
||||
if ($xmlDrawing->oneCellAnchor) {
|
||||
foreach ($xmlDrawing->oneCellAnchor as $oneCellAnchor) {
|
||||
@ -1439,27 +1439,27 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
$xfrm = $oneCellAnchor->pic->spPr->children("http://schemas.openxmlformats.org/drawingml/2006/main")->xfrm;
|
||||
$outerShdw = $oneCellAnchor->pic->spPr->children("http://schemas.openxmlformats.org/drawingml/2006/main")->effectLst->outerShdw;
|
||||
$objDrawing = new PHPExcel_Worksheet_Drawing;
|
||||
$objDrawing->setName((string) self::array_item($oneCellAnchor->pic->nvPicPr->cNvPr->attributes(), "name"));
|
||||
$objDrawing->setDescription((string) self::array_item($oneCellAnchor->pic->nvPicPr->cNvPr->attributes(), "descr"));
|
||||
$objDrawing->setPath("zip://".PHPExcel_Shared_File::realpath($pFilename)."#" . $images[(string) self::array_item($blip->attributes("http://schemas.openxmlformats.org/officeDocument/2006/relationships"), "embed")], false);
|
||||
$objDrawing->setName((string) self::getArrayItem($oneCellAnchor->pic->nvPicPr->cNvPr->attributes(), "name"));
|
||||
$objDrawing->setDescription((string) self::getArrayItem($oneCellAnchor->pic->nvPicPr->cNvPr->attributes(), "descr"));
|
||||
$objDrawing->setPath("zip://".PHPExcel_Shared_File::realpath($pFilename)."#" . $images[(string) self::getArrayItem($blip->attributes("http://schemas.openxmlformats.org/officeDocument/2006/relationships"), "embed")], false);
|
||||
$objDrawing->setCoordinates(PHPExcel_Cell::stringFromColumnIndex((string) $oneCellAnchor->from->col) . ($oneCellAnchor->from->row + 1));
|
||||
$objDrawing->setOffsetX(PHPExcel_Shared_Drawing::EMUToPixels($oneCellAnchor->from->colOff));
|
||||
$objDrawing->setOffsetY(PHPExcel_Shared_Drawing::EMUToPixels($oneCellAnchor->from->rowOff));
|
||||
$objDrawing->setResizeProportional(false);
|
||||
$objDrawing->setWidth(PHPExcel_Shared_Drawing::EMUToPixels(self::array_item($oneCellAnchor->ext->attributes(), "cx")));
|
||||
$objDrawing->setHeight(PHPExcel_Shared_Drawing::EMUToPixels(self::array_item($oneCellAnchor->ext->attributes(), "cy")));
|
||||
$objDrawing->setWidth(PHPExcel_Shared_Drawing::EMUToPixels(self::getArrayItem($oneCellAnchor->ext->attributes(), "cx")));
|
||||
$objDrawing->setHeight(PHPExcel_Shared_Drawing::EMUToPixels(self::getArrayItem($oneCellAnchor->ext->attributes(), "cy")));
|
||||
if ($xfrm) {
|
||||
$objDrawing->setRotation(PHPExcel_Shared_Drawing::angleToDegrees(self::array_item($xfrm->attributes(), "rot")));
|
||||
$objDrawing->setRotation(PHPExcel_Shared_Drawing::angleToDegrees(self::getArrayItem($xfrm->attributes(), "rot")));
|
||||
}
|
||||
if ($outerShdw) {
|
||||
$shadow = $objDrawing->getShadow();
|
||||
$shadow->setVisible(true);
|
||||
$shadow->setBlurRadius(PHPExcel_Shared_Drawing::EMUTopixels(self::array_item($outerShdw->attributes(), "blurRad")));
|
||||
$shadow->setDistance(PHPExcel_Shared_Drawing::EMUTopixels(self::array_item($outerShdw->attributes(), "dist")));
|
||||
$shadow->setDirection(PHPExcel_Shared_Drawing::angleToDegrees(self::array_item($outerShdw->attributes(), "dir")));
|
||||
$shadow->setAlignment((string) self::array_item($outerShdw->attributes(), "algn"));
|
||||
$shadow->getColor()->setRGB(self::array_item($outerShdw->srgbClr->attributes(), "val"));
|
||||
$shadow->setAlpha(self::array_item($outerShdw->srgbClr->alpha->attributes(), "val") / 1000);
|
||||
$shadow->setBlurRadius(PHPExcel_Shared_Drawing::EMUTopixels(self::getArrayItem($outerShdw->attributes(), "blurRad")));
|
||||
$shadow->setDistance(PHPExcel_Shared_Drawing::EMUTopixels(self::getArrayItem($outerShdw->attributes(), "dist")));
|
||||
$shadow->setDirection(PHPExcel_Shared_Drawing::angleToDegrees(self::getArrayItem($outerShdw->attributes(), "dir")));
|
||||
$shadow->setAlignment((string) self::getArrayItem($outerShdw->attributes(), "algn"));
|
||||
$shadow->getColor()->setRGB(self::getArrayItem($outerShdw->srgbClr->attributes(), "val"));
|
||||
$shadow->setAlpha(self::getArrayItem($outerShdw->srgbClr->alpha->attributes(), "val") / 1000);
|
||||
}
|
||||
$objDrawing->setWorksheet($docSheet);
|
||||
} else {
|
||||
@ -1467,8 +1467,8 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
$coordinates = PHPExcel_Cell::stringFromColumnIndex((string) $oneCellAnchor->from->col) . ($oneCellAnchor->from->row + 1);
|
||||
$offsetX = PHPExcel_Shared_Drawing::EMUToPixels($oneCellAnchor->from->colOff);
|
||||
$offsetY = PHPExcel_Shared_Drawing::EMUToPixels($oneCellAnchor->from->rowOff);
|
||||
$width = PHPExcel_Shared_Drawing::EMUToPixels(self::array_item($oneCellAnchor->ext->attributes(), "cx"));
|
||||
$height = PHPExcel_Shared_Drawing::EMUToPixels(self::array_item($oneCellAnchor->ext->attributes(), "cy"));
|
||||
$width = PHPExcel_Shared_Drawing::EMUToPixels(self::getArrayItem($oneCellAnchor->ext->attributes(), "cx"));
|
||||
$height = PHPExcel_Shared_Drawing::EMUToPixels(self::getArrayItem($oneCellAnchor->ext->attributes(), "cy"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1479,31 +1479,31 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
$xfrm = $twoCellAnchor->pic->spPr->children("http://schemas.openxmlformats.org/drawingml/2006/main")->xfrm;
|
||||
$outerShdw = $twoCellAnchor->pic->spPr->children("http://schemas.openxmlformats.org/drawingml/2006/main")->effectLst->outerShdw;
|
||||
$objDrawing = new PHPExcel_Worksheet_Drawing;
|
||||
$objDrawing->setName((string) self::array_item($twoCellAnchor->pic->nvPicPr->cNvPr->attributes(), "name"));
|
||||
$objDrawing->setDescription((string) self::array_item($twoCellAnchor->pic->nvPicPr->cNvPr->attributes(), "descr"));
|
||||
$objDrawing->setPath("zip://".PHPExcel_Shared_File::realpath($pFilename)."#" . $images[(string) self::array_item($blip->attributes("http://schemas.openxmlformats.org/officeDocument/2006/relationships"), "embed")], false);
|
||||
$objDrawing->setName((string) self::getArrayItem($twoCellAnchor->pic->nvPicPr->cNvPr->attributes(), "name"));
|
||||
$objDrawing->setDescription((string) self::getArrayItem($twoCellAnchor->pic->nvPicPr->cNvPr->attributes(), "descr"));
|
||||
$objDrawing->setPath("zip://".PHPExcel_Shared_File::realpath($pFilename)."#" . $images[(string) self::getArrayItem($blip->attributes("http://schemas.openxmlformats.org/officeDocument/2006/relationships"), "embed")], false);
|
||||
$objDrawing->setCoordinates(PHPExcel_Cell::stringFromColumnIndex((string) $twoCellAnchor->from->col) . ($twoCellAnchor->from->row + 1));
|
||||
$objDrawing->setOffsetX(PHPExcel_Shared_Drawing::EMUToPixels($twoCellAnchor->from->colOff));
|
||||
$objDrawing->setOffsetY(PHPExcel_Shared_Drawing::EMUToPixels($twoCellAnchor->from->rowOff));
|
||||
$objDrawing->setResizeProportional(false);
|
||||
|
||||
if ($xfrm) {
|
||||
$objDrawing->setWidth(PHPExcel_Shared_Drawing::EMUToPixels(self::array_item($xfrm->ext->attributes(), "cx")));
|
||||
$objDrawing->setHeight(PHPExcel_Shared_Drawing::EMUToPixels(self::array_item($xfrm->ext->attributes(), "cy")));
|
||||
$objDrawing->setRotation(PHPExcel_Shared_Drawing::angleToDegrees(self::array_item($xfrm->attributes(), "rot")));
|
||||
$objDrawing->setWidth(PHPExcel_Shared_Drawing::EMUToPixels(self::getArrayItem($xfrm->ext->attributes(), "cx")));
|
||||
$objDrawing->setHeight(PHPExcel_Shared_Drawing::EMUToPixels(self::getArrayItem($xfrm->ext->attributes(), "cy")));
|
||||
$objDrawing->setRotation(PHPExcel_Shared_Drawing::angleToDegrees(self::getArrayItem($xfrm->attributes(), "rot")));
|
||||
}
|
||||
if ($outerShdw) {
|
||||
$shadow = $objDrawing->getShadow();
|
||||
$shadow->setVisible(true);
|
||||
$shadow->setBlurRadius(PHPExcel_Shared_Drawing::EMUTopixels(self::array_item($outerShdw->attributes(), "blurRad")));
|
||||
$shadow->setDistance(PHPExcel_Shared_Drawing::EMUTopixels(self::array_item($outerShdw->attributes(), "dist")));
|
||||
$shadow->setDirection(PHPExcel_Shared_Drawing::angleToDegrees(self::array_item($outerShdw->attributes(), "dir")));
|
||||
$shadow->setAlignment((string) self::array_item($outerShdw->attributes(), "algn"));
|
||||
$shadow->getColor()->setRGB(self::array_item($outerShdw->srgbClr->attributes(), "val"));
|
||||
$shadow->setAlpha(self::array_item($outerShdw->srgbClr->alpha->attributes(), "val") / 1000);
|
||||
$shadow->setBlurRadius(PHPExcel_Shared_Drawing::EMUTopixels(self::getArrayItem($outerShdw->attributes(), "blurRad")));
|
||||
$shadow->setDistance(PHPExcel_Shared_Drawing::EMUTopixels(self::getArrayItem($outerShdw->attributes(), "dist")));
|
||||
$shadow->setDirection(PHPExcel_Shared_Drawing::angleToDegrees(self::getArrayItem($outerShdw->attributes(), "dir")));
|
||||
$shadow->setAlignment((string) self::getArrayItem($outerShdw->attributes(), "algn"));
|
||||
$shadow->getColor()->setRGB(self::getArrayItem($outerShdw->srgbClr->attributes(), "val"));
|
||||
$shadow->setAlpha(self::getArrayItem($outerShdw->srgbClr->alpha->attributes(), "val") / 1000);
|
||||
}
|
||||
$objDrawing->setWorksheet($docSheet);
|
||||
} elseif (($this->_includeCharts) && ($twoCellAnchor->graphicFrame)) {
|
||||
} elseif (($this->includeCharts) && ($twoCellAnchor->graphicFrame)) {
|
||||
$fromCoordinate = PHPExcel_Cell::stringFromColumnIndex((string) $twoCellAnchor->from->col) . ($twoCellAnchor->from->row + 1);
|
||||
$fromOffsetX = PHPExcel_Shared_Drawing::EMUToPixels($twoCellAnchor->from->colOff);
|
||||
$fromOffsetY = PHPExcel_Shared_Drawing::EMUToPixels($twoCellAnchor->from->rowOff);
|
||||
@ -1671,7 +1671,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
}
|
||||
}
|
||||
|
||||
if ((!$this->_readDataOnly) || (!empty($this->_loadSheetsOnly))) {
|
||||
if ((!$this->readDataOnly) || (!empty($this->loadSheetsOnly))) {
|
||||
// active sheet index
|
||||
$activeTab = intval($xmlWorkbook->bookViews->workbookView["activeTab"]); // refers to old sheet index
|
||||
|
||||
@ -1689,14 +1689,14 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
}
|
||||
}
|
||||
|
||||
if (!$this->_readDataOnly) {
|
||||
$contentTypes = simplexml_load_string($this->securityScan($this->_getFromZipArchive($zip, "[Content_Types].xml")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());
|
||||
if (!$this->readDataOnly) {
|
||||
$contentTypes = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, "[Content_Types].xml")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());
|
||||
foreach ($contentTypes->Override as $contentType) {
|
||||
switch ($contentType["ContentType"]) {
|
||||
case "application/vnd.openxmlformats-officedocument.drawingml.chart+xml":
|
||||
if ($this->_includeCharts) {
|
||||
if ($this->includeCharts) {
|
||||
$chartEntryRef = ltrim($contentType['PartName'], '/');
|
||||
$chartElements = simplexml_load_string($this->securityScan($this->_getFromZipArchive($zip, $chartEntryRef)), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());
|
||||
$chartElements = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, $chartEntryRef)), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());
|
||||
$objChart = PHPExcel_Reader_Excel2007_Chart::readChart($chartElements, basename($chartEntryRef, '.xml'));
|
||||
|
||||
// echo 'Chart ', $chartEntryRef, '<br />';
|
||||
@ -1799,8 +1799,8 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
}
|
||||
$docStyle->getFill()->setRotation(floatval($gradientFill["degree"]));
|
||||
$gradientFill->registerXPathNamespace("sml", "http://schemas.openxmlformats.org/spreadsheetml/2006/main");
|
||||
$docStyle->getFill()->getStartColor()->setARGB(self::readColor(self::array_item($gradientFill->xpath("sml:stop[@position=0]"))->color));
|
||||
$docStyle->getFill()->getEndColor()->setARGB(self::readColor(self::array_item($gradientFill->xpath("sml:stop[@position=1]"))->color));
|
||||
$docStyle->getFill()->getStartColor()->setARGB(self::readColor(self::getArrayItem($gradientFill->xpath("sml:stop[@position=0]"))->color));
|
||||
$docStyle->getFill()->getEndColor()->setARGB(self::readColor(self::getArrayItem($gradientFill->xpath("sml:stop[@position=1]"))->color));
|
||||
} elseif ($style->fill->patternFill) {
|
||||
$patternType = (string)$style->fill->patternFill["patternType"] != '' ? (string)$style->fill->patternFill["patternType"] : 'solid';
|
||||
$docStyle->getFill()->setFillType($patternType);
|
||||
@ -1952,12 +1952,12 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
$baseDir = dirname($customUITarget);
|
||||
$nameCustomUI = basename($customUITarget);
|
||||
// get the xml file (ribbon)
|
||||
$localRibbon = $this->_getFromZipArchive($zip, $customUITarget);
|
||||
$localRibbon = $this->getFromZipArchive($zip, $customUITarget);
|
||||
$customUIImagesNames = array();
|
||||
$customUIImagesBinaries = array();
|
||||
// something like customUI/_rels/customUI.xml.rels
|
||||
$pathRels = $baseDir . '/_rels/' . $nameCustomUI . '.rels';
|
||||
$dataRels = $this->_getFromZipArchive($zip, $pathRels);
|
||||
$dataRels = $this->getFromZipArchive($zip, $pathRels);
|
||||
if ($dataRels) {
|
||||
// exists and not empty if the ribbon have some pictures (other than internal MSO)
|
||||
$UIRels = simplexml_load_string($this->securityScan($dataRels), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());
|
||||
@ -1967,7 +1967,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
if ($ele["Type"] == 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image') {
|
||||
// an image ?
|
||||
$customUIImagesNames[(string) $ele['Id']] = (string)$ele['Target'];
|
||||
$customUIImagesBinaries[(string)$ele['Target']] = $this->_getFromZipArchive($zip, $baseDir . '/' . (string) $ele['Target']);
|
||||
$customUIImagesBinaries[(string)$ele['Target']] = $this->getFromZipArchive($zip, $baseDir . '/' . (string) $ele['Target']);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1985,12 +1985,12 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
||||
}
|
||||
}
|
||||
|
||||
private static function array_item($array, $key = 0)
|
||||
private static function getArrayItem($array, $key = 0)
|
||||
{
|
||||
return (isset($array[$key]) ? $array[$key] : null);
|
||||
}
|
||||
|
||||
private static function dir_add($base, $add)
|
||||
private static function dirAdd($base, $add)
|
||||
{
|
||||
return preg_replace('~[^/]+/\.\./~', '', dirname($base) . "/$add");
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -101,7 +101,7 @@ class PHPExcel_Reader_Excel5_Escher
|
||||
// Parse Escher stream
|
||||
while ($this->pos < $this->dataSize) {
|
||||
// offset: 2; size: 2: Record Type
|
||||
$fbt = PHPExcel_Reader_Excel5::_GetInt2d($this->data, $this->pos + 2);
|
||||
$fbt = PHPExcel_Reader_Excel5::getInt2d($this->data, $this->pos + 2);
|
||||
|
||||
switch ($fbt) {
|
||||
case self::DGGCONTAINER:
|
||||
@ -173,15 +173,15 @@ class PHPExcel_Reader_Excel5_Escher
|
||||
private function readDefault()
|
||||
{
|
||||
// offset 0; size: 2; recVer and recInstance
|
||||
$verInstance = PHPExcel_Reader_Excel5::_GetInt2d($this->data, $this->pos);
|
||||
$verInstance = PHPExcel_Reader_Excel5::getInt2d($this->data, $this->pos);
|
||||
|
||||
// offset: 2; size: 2: Record Type
|
||||
$fbt = PHPExcel_Reader_Excel5::_GetInt2d($this->data, $this->pos + 2);
|
||||
$fbt = PHPExcel_Reader_Excel5::getInt2d($this->data, $this->pos + 2);
|
||||
|
||||
// bit: 0-3; mask: 0x000F; recVer
|
||||
$recVer = (0x000F & $verInstance) >> 0;
|
||||
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
|
||||
$length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4);
|
||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||
|
||||
// move stream pointer to next record
|
||||
@ -193,7 +193,7 @@ class PHPExcel_Reader_Excel5_Escher
|
||||
*/
|
||||
private function readDggContainer()
|
||||
{
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
|
||||
$length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4);
|
||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||
|
||||
// move stream pointer to next record
|
||||
@ -211,7 +211,7 @@ class PHPExcel_Reader_Excel5_Escher
|
||||
*/
|
||||
private function readDgg()
|
||||
{
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
|
||||
$length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4);
|
||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||
|
||||
// move stream pointer to next record
|
||||
@ -223,7 +223,7 @@ class PHPExcel_Reader_Excel5_Escher
|
||||
*/
|
||||
private function readBstoreContainer()
|
||||
{
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
|
||||
$length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4);
|
||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||
|
||||
// move stream pointer to next record
|
||||
@ -244,9 +244,9 @@ class PHPExcel_Reader_Excel5_Escher
|
||||
// offset: 0; size: 2; recVer and recInstance
|
||||
|
||||
// bit: 4-15; mask: 0xFFF0; recInstance
|
||||
$recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::_GetInt2d($this->data, $this->pos)) >> 4;
|
||||
$recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::getInt2d($this->data, $this->pos)) >> 4;
|
||||
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
|
||||
$length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4);
|
||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||
|
||||
// move stream pointer to next record
|
||||
@ -268,16 +268,16 @@ class PHPExcel_Reader_Excel5_Escher
|
||||
$rgbUid = substr($recordData, 2, 16);
|
||||
|
||||
// offset: 18; size: 2; tag
|
||||
$tag = PHPExcel_Reader_Excel5::_GetInt2d($recordData, 18);
|
||||
$tag = PHPExcel_Reader_Excel5::getInt2d($recordData, 18);
|
||||
|
||||
// offset: 20; size: 4; size of BLIP in bytes
|
||||
$size = PHPExcel_Reader_Excel5::_GetInt4d($recordData, 20);
|
||||
$size = PHPExcel_Reader_Excel5::getInt4d($recordData, 20);
|
||||
|
||||
// offset: 24; size: 4; number of references to this BLIP
|
||||
$cRef = PHPExcel_Reader_Excel5::_GetInt4d($recordData, 24);
|
||||
$cRef = PHPExcel_Reader_Excel5::getInt4d($recordData, 24);
|
||||
|
||||
// offset: 28; size: 4; MSOFO file offset
|
||||
$foDelay = PHPExcel_Reader_Excel5::_GetInt4d($recordData, 28);
|
||||
$foDelay = PHPExcel_Reader_Excel5::getInt4d($recordData, 28);
|
||||
|
||||
// offset: 32; size: 1; unused1
|
||||
$unused1 = ord($recordData{32});
|
||||
@ -310,9 +310,9 @@ class PHPExcel_Reader_Excel5_Escher
|
||||
// offset: 0; size: 2; recVer and recInstance
|
||||
|
||||
// bit: 4-15; mask: 0xFFF0; recInstance
|
||||
$recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::_GetInt2d($this->data, $this->pos)) >> 4;
|
||||
$recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::getInt2d($this->data, $this->pos)) >> 4;
|
||||
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
|
||||
$length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4);
|
||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||
|
||||
// move stream pointer to next record
|
||||
@ -351,9 +351,9 @@ class PHPExcel_Reader_Excel5_Escher
|
||||
// offset: 0; size: 2; recVer and recInstance
|
||||
|
||||
// bit: 4-15; mask: 0xFFF0; recInstance
|
||||
$recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::_GetInt2d($this->data, $this->pos)) >> 4;
|
||||
$recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::getInt2d($this->data, $this->pos)) >> 4;
|
||||
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
|
||||
$length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4);
|
||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||
|
||||
// move stream pointer to next record
|
||||
@ -392,9 +392,9 @@ class PHPExcel_Reader_Excel5_Escher
|
||||
// offset: 0; size: 2; recVer and recInstance
|
||||
|
||||
// bit: 4-15; mask: 0xFFF0; recInstance
|
||||
$recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::_GetInt2d($this->data, $this->pos)) >> 4;
|
||||
$recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::getInt2d($this->data, $this->pos)) >> 4;
|
||||
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
|
||||
$length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4);
|
||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||
|
||||
// move stream pointer to next record
|
||||
@ -411,9 +411,9 @@ class PHPExcel_Reader_Excel5_Escher
|
||||
// offset: 0; size: 2; recVer and recInstance
|
||||
|
||||
// bit: 4-15; mask: 0xFFF0; recInstance
|
||||
$recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::_GetInt2d($this->data, $this->pos)) >> 4;
|
||||
$recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::getInt2d($this->data, $this->pos)) >> 4;
|
||||
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
|
||||
$length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4);
|
||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||
|
||||
// move stream pointer to next record
|
||||
@ -425,7 +425,7 @@ class PHPExcel_Reader_Excel5_Escher
|
||||
*/
|
||||
private function readSplitMenuColors()
|
||||
{
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
|
||||
$length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4);
|
||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||
|
||||
// move stream pointer to next record
|
||||
@ -437,7 +437,7 @@ class PHPExcel_Reader_Excel5_Escher
|
||||
*/
|
||||
private function readDgContainer()
|
||||
{
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
|
||||
$length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4);
|
||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||
|
||||
// move stream pointer to next record
|
||||
@ -455,7 +455,7 @@ class PHPExcel_Reader_Excel5_Escher
|
||||
*/
|
||||
private function readDg()
|
||||
{
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
|
||||
$length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4);
|
||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||
|
||||
// move stream pointer to next record
|
||||
@ -469,7 +469,7 @@ class PHPExcel_Reader_Excel5_Escher
|
||||
{
|
||||
// context is either context DgContainer or SpgrContainer
|
||||
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
|
||||
$length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4);
|
||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||
|
||||
// move stream pointer to next record
|
||||
@ -495,7 +495,7 @@ class PHPExcel_Reader_Excel5_Escher
|
||||
*/
|
||||
private function readSpContainer()
|
||||
{
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
|
||||
$length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4);
|
||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||
|
||||
// add spContainer to spgrContainer
|
||||
@ -515,7 +515,7 @@ class PHPExcel_Reader_Excel5_Escher
|
||||
*/
|
||||
private function readSpgr()
|
||||
{
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
|
||||
$length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4);
|
||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||
|
||||
// move stream pointer to next record
|
||||
@ -530,9 +530,9 @@ class PHPExcel_Reader_Excel5_Escher
|
||||
// offset: 0; size: 2; recVer and recInstance
|
||||
|
||||
// bit: 4-15; mask: 0xFFF0; recInstance
|
||||
$recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::_GetInt2d($this->data, $this->pos)) >> 4;
|
||||
$recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::getInt2d($this->data, $this->pos)) >> 4;
|
||||
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
|
||||
$length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4);
|
||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||
|
||||
// move stream pointer to next record
|
||||
@ -547,9 +547,9 @@ class PHPExcel_Reader_Excel5_Escher
|
||||
// offset: 0; size: 2; recVer and recInstance
|
||||
|
||||
// bit: 4-15; mask: 0xFFF0; recInstance
|
||||
$recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::_GetInt2d($this->data, $this->pos)) >> 4;
|
||||
$recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::getInt2d($this->data, $this->pos)) >> 4;
|
||||
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
|
||||
$length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4);
|
||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||
|
||||
// move stream pointer to next record
|
||||
@ -561,35 +561,35 @@ class PHPExcel_Reader_Excel5_Escher
|
||||
*/
|
||||
private function readClientAnchor()
|
||||
{
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
|
||||
$length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4);
|
||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||
|
||||
// move stream pointer to next record
|
||||
$this->pos += 8 + $length;
|
||||
|
||||
// offset: 2; size: 2; upper-left corner column index (0-based)
|
||||
$c1 = PHPExcel_Reader_Excel5::_GetInt2d($recordData, 2);
|
||||
$c1 = PHPExcel_Reader_Excel5::getInt2d($recordData, 2);
|
||||
|
||||
// offset: 4; size: 2; upper-left corner horizontal offset in 1/1024 of column width
|
||||
$startOffsetX = PHPExcel_Reader_Excel5::_GetInt2d($recordData, 4);
|
||||
$startOffsetX = PHPExcel_Reader_Excel5::getInt2d($recordData, 4);
|
||||
|
||||
// offset: 6; size: 2; upper-left corner row index (0-based)
|
||||
$r1 = PHPExcel_Reader_Excel5::_GetInt2d($recordData, 6);
|
||||
$r1 = PHPExcel_Reader_Excel5::getInt2d($recordData, 6);
|
||||
|
||||
// offset: 8; size: 2; upper-left corner vertical offset in 1/256 of row height
|
||||
$startOffsetY = PHPExcel_Reader_Excel5::_GetInt2d($recordData, 8);
|
||||
$startOffsetY = PHPExcel_Reader_Excel5::getInt2d($recordData, 8);
|
||||
|
||||
// offset: 10; size: 2; bottom-right corner column index (0-based)
|
||||
$c2 = PHPExcel_Reader_Excel5::_GetInt2d($recordData, 10);
|
||||
$c2 = PHPExcel_Reader_Excel5::getInt2d($recordData, 10);
|
||||
|
||||
// offset: 12; size: 2; bottom-right corner horizontal offset in 1/1024 of column width
|
||||
$endOffsetX = PHPExcel_Reader_Excel5::_GetInt2d($recordData, 12);
|
||||
$endOffsetX = PHPExcel_Reader_Excel5::getInt2d($recordData, 12);
|
||||
|
||||
// offset: 14; size: 2; bottom-right corner row index (0-based)
|
||||
$r2 = PHPExcel_Reader_Excel5::_GetInt2d($recordData, 14);
|
||||
$r2 = PHPExcel_Reader_Excel5::getInt2d($recordData, 14);
|
||||
|
||||
// offset: 16; size: 2; bottom-right corner vertical offset in 1/256 of row height
|
||||
$endOffsetY = PHPExcel_Reader_Excel5::_GetInt2d($recordData, 16);
|
||||
$endOffsetY = PHPExcel_Reader_Excel5::getInt2d($recordData, 16);
|
||||
|
||||
// set the start coordinates
|
||||
$this->object->setStartCoordinates(PHPExcel_Cell::stringFromColumnIndex($c1) . ($r1 + 1));
|
||||
@ -615,7 +615,7 @@ class PHPExcel_Reader_Excel5_Escher
|
||||
*/
|
||||
private function readClientData()
|
||||
{
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
|
||||
$length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4);
|
||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||
|
||||
// move stream pointer to next record
|
||||
@ -638,7 +638,7 @@ class PHPExcel_Reader_Excel5_Escher
|
||||
$fopte = substr($data, 6 * $i, 6);
|
||||
|
||||
// offset: 0; size: 2; opid
|
||||
$opid = PHPExcel_Reader_Excel5::_GetInt2d($fopte, 0);
|
||||
$opid = PHPExcel_Reader_Excel5::getInt2d($fopte, 0);
|
||||
|
||||
// bit: 0-13; mask: 0x3FFF; opid.opid
|
||||
$opidOpid = (0x3FFF & $opid) >> 0;
|
||||
@ -650,7 +650,7 @@ class PHPExcel_Reader_Excel5_Escher
|
||||
$opidFComplex = (0x8000 & $opid) >> 15;
|
||||
|
||||
// offset: 2; size: 4; the value for this property
|
||||
$op = PHPExcel_Reader_Excel5::_GetInt4d($fopte, 2);
|
||||
$op = PHPExcel_Reader_Excel5::getInt4d($fopte, 2);
|
||||
|
||||
if ($opidFComplex) {
|
||||
$complexData = substr($splicedComplexData, 0, $op);
|
||||
|
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* PHPExcel
|
||||
* PHPExcel_Reader_Exception
|
||||
*
|
||||
* Copyright (c) 2006 - 2015 PHPExcel
|
||||
*
|
||||
@ -24,15 +25,6 @@
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* PHPExcel_Reader_Exception
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_Reader
|
||||
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
class PHPExcel_Reader_Exception extends PHPExcel_Exception
|
||||
{
|
||||
/**
|
||||
|
@ -57,7 +57,7 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->_readFilter = new PHPExcel_Reader_DefaultReadFilter();
|
||||
$this->readFilter = new PHPExcel_Reader_DefaultReadFilter();
|
||||
$this->referenceHelper = PHPExcel_ReferenceHelper::getInstance();
|
||||
}
|
||||
|
||||
@ -173,7 +173,7 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
|
||||
return $worksheetInfo;
|
||||
}
|
||||
|
||||
private function _gzfileGetContents($filename)
|
||||
private function gzfileGetContents($filename)
|
||||
{
|
||||
$file = @gzopen($filename, 'rb');
|
||||
if ($file !== false) {
|
||||
@ -220,7 +220,7 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
|
||||
$timezoneObj = new DateTimeZone('Europe/London');
|
||||
$GMT = new DateTimeZone('UTC');
|
||||
|
||||
$gFileData = $this->_gzfileGetContents($pFilename);
|
||||
$gFileData = $this->gzfileGetContents($pFilename);
|
||||
|
||||
// echo '<pre>';
|
||||
// echo htmlentities($gFileData,ENT_QUOTES,'UTF-8');
|
||||
@ -340,7 +340,7 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
|
||||
foreach ($gnmXML->Sheets->Sheet as $sheet) {
|
||||
$worksheetName = (string) $sheet->Name;
|
||||
// echo '<b>Worksheet: ', $worksheetName,'</b><br />';
|
||||
if ((isset($this->_loadSheetsOnly)) && (!in_array($worksheetName, $this->_loadSheetsOnly))) {
|
||||
if ((isset($this->loadSheetsOnly)) && (!in_array($worksheetName, $this->loadSheetsOnly))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -354,7 +354,7 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
|
||||
// name in line with the formula, not the reverse
|
||||
$objPHPExcel->getActiveSheet()->setTitle($worksheetName, false);
|
||||
|
||||
if ((!$this->_readDataOnly) && (isset($sheet->PrintInformation))) {
|
||||
if ((!$this->readDataOnly) && (isset($sheet->PrintInformation))) {
|
||||
if (isset($sheet->PrintInformation->Margins)) {
|
||||
foreach ($sheet->PrintInformation->Margins->children('gnm', true) as $key => $margin) {
|
||||
$marginAttributes = $margin->attributes();
|
||||
@ -441,6 +441,7 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
|
||||
$cell = ($cell == 'TRUE') ? true: false;
|
||||
break;
|
||||
case '30': // Integer
|
||||
// Excel 2007+ doesn't differentiate between integer and float, so set the value and dropthru to the next (numeric) case
|
||||
$cell = intval($cell);
|
||||
case '40': // Float
|
||||
$type = PHPExcel_Cell_DataType::TYPE_NUMERIC;
|
||||
@ -458,12 +459,12 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
|
||||
$objPHPExcel->getActiveSheet()->getCell($column.$row)->setValueExplicit($cell, $type);
|
||||
}
|
||||
|
||||
if ((!$this->_readDataOnly) && (isset($sheet->Objects))) {
|
||||
if ((!$this->readDataOnly) && (isset($sheet->Objects))) {
|
||||
foreach ($sheet->Objects->children('gnm', true) as $key => $comment) {
|
||||
$commentAttributes = $comment->attributes();
|
||||
// Only comment objects are handled at the moment
|
||||
if ($commentAttributes->Text) {
|
||||
$objPHPExcel->getActiveSheet()->getComment((string)$commentAttributes->ObjectBound)->setAuthor((string)$commentAttributes->Author)->setText($this->_parseRichText((string)$commentAttributes->Text));
|
||||
$objPHPExcel->getActiveSheet()->getComment((string)$commentAttributes->ObjectBound)->setAuthor((string)$commentAttributes->Author)->setText($this->parseRichText((string)$commentAttributes->Text));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -487,13 +488,13 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
|
||||
// var_dump($styleAttributes);
|
||||
// echo '<br />';
|
||||
|
||||
// We still set the number format mask for date/time values, even if _readDataOnly is true
|
||||
if ((!$this->_readDataOnly) ||
|
||||
// We still set the number format mask for date/time values, even if readDataOnly is true
|
||||
if ((!$this->readDataOnly) ||
|
||||
(PHPExcel_Shared_Date::isDateTimeFormatCode((string) $styleAttributes['Format']))) {
|
||||
$styleArray = array();
|
||||
$styleArray['numberformat']['code'] = (string) $styleAttributes['Format'];
|
||||
// If _readDataOnly is false, we set all formatting information
|
||||
if (!$this->_readDataOnly) {
|
||||
// If readDataOnly is false, we set all formatting information
|
||||
if (!$this->readDataOnly) {
|
||||
switch ($styleAttributes['HAlign']) {
|
||||
case '1':
|
||||
$styleArray['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_GENERAL;
|
||||
@ -535,13 +536,13 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
|
||||
$styleArray['alignment']['shrinkToFit'] = ($styleAttributes['ShrinkToFit'] == '1') ? true : false;
|
||||
$styleArray['alignment']['indent'] = (intval($styleAttributes["Indent"]) > 0) ? $styleAttributes["indent"] : 0;
|
||||
|
||||
$RGB = self::_parseGnumericColour($styleAttributes["Fore"]);
|
||||
$RGB = self::parseGnumericColour($styleAttributes["Fore"]);
|
||||
$styleArray['font']['color']['rgb'] = $RGB;
|
||||
$RGB = self::_parseGnumericColour($styleAttributes["Back"]);
|
||||
$RGB = self::parseGnumericColour($styleAttributes["Back"]);
|
||||
$shade = $styleAttributes["Shade"];
|
||||
if (($RGB != '000000') || ($shade != '0')) {
|
||||
$styleArray['fill']['color']['rgb'] = $styleArray['fill']['startcolor']['rgb'] = $RGB;
|
||||
$RGB2 = self::_parseGnumericColour($styleAttributes["PatternColor"]);
|
||||
$RGB2 = self::parseGnumericColour($styleAttributes["PatternColor"]);
|
||||
$styleArray['fill']['endcolor']['rgb'] = $RGB2;
|
||||
switch ($shade) {
|
||||
case '1':
|
||||
@ -643,25 +644,25 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
|
||||
|
||||
if (isset($styleRegion->Style->StyleBorder)) {
|
||||
if (isset($styleRegion->Style->StyleBorder->Top)) {
|
||||
$styleArray['borders']['top'] = self::_parseBorderAttributes($styleRegion->Style->StyleBorder->Top->attributes());
|
||||
$styleArray['borders']['top'] = self::parseBorderAttributes($styleRegion->Style->StyleBorder->Top->attributes());
|
||||
}
|
||||
if (isset($styleRegion->Style->StyleBorder->Bottom)) {
|
||||
$styleArray['borders']['bottom'] = self::_parseBorderAttributes($styleRegion->Style->StyleBorder->Bottom->attributes());
|
||||
$styleArray['borders']['bottom'] = self::parseBorderAttributes($styleRegion->Style->StyleBorder->Bottom->attributes());
|
||||
}
|
||||
if (isset($styleRegion->Style->StyleBorder->Left)) {
|
||||
$styleArray['borders']['left'] = self::_parseBorderAttributes($styleRegion->Style->StyleBorder->Left->attributes());
|
||||
$styleArray['borders']['left'] = self::parseBorderAttributes($styleRegion->Style->StyleBorder->Left->attributes());
|
||||
}
|
||||
if (isset($styleRegion->Style->StyleBorder->Right)) {
|
||||
$styleArray['borders']['right'] = self::_parseBorderAttributes($styleRegion->Style->StyleBorder->Right->attributes());
|
||||
$styleArray['borders']['right'] = self::parseBorderAttributes($styleRegion->Style->StyleBorder->Right->attributes());
|
||||
}
|
||||
if ((isset($styleRegion->Style->StyleBorder->Diagonal)) && (isset($styleRegion->Style->StyleBorder->{'Rev-Diagonal'}))) {
|
||||
$styleArray['borders']['diagonal'] = self::_parseBorderAttributes($styleRegion->Style->StyleBorder->Diagonal->attributes());
|
||||
$styleArray['borders']['diagonal'] = self::parseBorderAttributes($styleRegion->Style->StyleBorder->Diagonal->attributes());
|
||||
$styleArray['borders']['diagonaldirection'] = PHPExcel_Style_Borders::DIAGONAL_BOTH;
|
||||
} elseif (isset($styleRegion->Style->StyleBorder->Diagonal)) {
|
||||
$styleArray['borders']['diagonal'] = self::_parseBorderAttributes($styleRegion->Style->StyleBorder->Diagonal->attributes());
|
||||
$styleArray['borders']['diagonal'] = self::parseBorderAttributes($styleRegion->Style->StyleBorder->Diagonal->attributes());
|
||||
$styleArray['borders']['diagonaldirection'] = PHPExcel_Style_Borders::DIAGONAL_UP;
|
||||
} elseif (isset($styleRegion->Style->StyleBorder->{'Rev-Diagonal'})) {
|
||||
$styleArray['borders']['diagonal'] = self::_parseBorderAttributes($styleRegion->Style->StyleBorder->{'Rev-Diagonal'}->attributes());
|
||||
$styleArray['borders']['diagonal'] = self::parseBorderAttributes($styleRegion->Style->StyleBorder->{'Rev-Diagonal'}->attributes());
|
||||
$styleArray['borders']['diagonaldirection'] = PHPExcel_Style_Borders::DIAGONAL_DOWN;
|
||||
}
|
||||
}
|
||||
@ -677,7 +678,7 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
|
||||
}
|
||||
}
|
||||
|
||||
if ((!$this->_readDataOnly) && (isset($sheet->Cols))) {
|
||||
if ((!$this->readDataOnly) && (isset($sheet->Cols))) {
|
||||
// Column Widths
|
||||
$columnAttributes = $sheet->Cols->attributes();
|
||||
$defaultWidth = $columnAttributes['DefaultSizePts'] / 5.4;
|
||||
@ -706,7 +707,7 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
|
||||
}
|
||||
}
|
||||
|
||||
if ((!$this->_readDataOnly) && (isset($sheet->Rows))) {
|
||||
if ((!$this->readDataOnly) && (isset($sheet->Rows))) {
|
||||
// Row Heights
|
||||
$rowAttributes = $sheet->Rows->attributes();
|
||||
$defaultHeight = $rowAttributes['DefaultSizePts'];
|
||||
@ -770,13 +771,11 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
|
||||
return $objPHPExcel;
|
||||
}
|
||||
|
||||
private static function _parseBorderAttributes($borderAttributes)
|
||||
private static function parseBorderAttributes($borderAttributes)
|
||||
{
|
||||
$styleArray = array();
|
||||
|
||||
if (isset($borderAttributes["Color"])) {
|
||||
$RGB = self::_parseGnumericColour($borderAttributes["Color"]);
|
||||
$styleArray['color']['rgb'] = $RGB;
|
||||
$styleArray['color']['rgb'] = self::parseGnumericColour($borderAttributes["Color"]);
|
||||
}
|
||||
|
||||
switch ($borderAttributes["Style"]) {
|
||||
@ -789,6 +788,9 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
|
||||
case '2':
|
||||
$styleArray['style'] = PHPExcel_Style_Border::BORDER_MEDIUM;
|
||||
break;
|
||||
case '3':
|
||||
$styleArray['style'] = PHPExcel_Style_Border::BORDER_SLANTDASHDOT;
|
||||
break;
|
||||
case '4':
|
||||
$styleArray['style'] = PHPExcel_Style_Border::BORDER_DASHED;
|
||||
break;
|
||||
@ -801,6 +803,9 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
|
||||
case '7':
|
||||
$styleArray['style'] = PHPExcel_Style_Border::BORDER_DOTTED;
|
||||
break;
|
||||
case '8':
|
||||
$styleArray['style'] = PHPExcel_Style_Border::BORDER_MEDIUMDASHED;
|
||||
break;
|
||||
case '9':
|
||||
$styleArray['style'] = PHPExcel_Style_Border::BORDER_DASHDOT;
|
||||
break;
|
||||
@ -816,33 +821,24 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
|
||||
case '13':
|
||||
$styleArray['style'] = PHPExcel_Style_Border::BORDER_MEDIUMDASHDOTDOT;
|
||||
break;
|
||||
case '3':
|
||||
$styleArray['style'] = PHPExcel_Style_Border::BORDER_SLANTDASHDOT;
|
||||
break;
|
||||
case '8':
|
||||
$styleArray['style'] = PHPExcel_Style_Border::BORDER_MEDIUMDASHED;
|
||||
break;
|
||||
}
|
||||
return $styleArray;
|
||||
}
|
||||
|
||||
private function _parseRichText($is = '')
|
||||
private function parseRichText($is = '')
|
||||
{
|
||||
$value = new PHPExcel_RichText();
|
||||
|
||||
$value->createText($is);
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
private static function _parseGnumericColour($gnmColour)
|
||||
private static function parseGnumericColour($gnmColour)
|
||||
{
|
||||
list($gnmR, $gnmG, $gnmB) = explode(':', $gnmColour);
|
||||
$gnmR = substr(str_pad($gnmR, 4, '0', STR_PAD_RIGHT), 0, 2);
|
||||
$gnmG = substr(str_pad($gnmG, 4, '0', STR_PAD_RIGHT), 0, 2);
|
||||
$gnmB = substr(str_pad($gnmB, 4, '0', STR_PAD_RIGHT), 0, 2);
|
||||
$RGB = $gnmR.$gnmG.$gnmB;
|
||||
// echo 'Excel Colour: ', $RGB,'<br />';
|
||||
return $RGB;
|
||||
return $gnmR . $gnmG . $gnmB;
|
||||
}
|
||||
}
|
||||
|
@ -42,52 +42,71 @@ class PHPExcel_Reader_HTML extends PHPExcel_Reader_Abstract implements PHPExcel_
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_inputEncoding = 'ANSI';
|
||||
protected $inputEncoding = 'ANSI';
|
||||
|
||||
/**
|
||||
* Sheet index to read
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $_sheetIndex = 0;
|
||||
protected $sheetIndex = 0;
|
||||
|
||||
/**
|
||||
* Formats
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_formats = array(
|
||||
'h1' => array('font' => array('bold' => true,
|
||||
protected $formats = array(
|
||||
'h1' => array(
|
||||
'font' => array(
|
||||
'bold' => true,
|
||||
'size' => 24,
|
||||
),
|
||||
), // Bold, 24pt
|
||||
'h2' => array('font' => array('bold' => true,
|
||||
'h2' => array(
|
||||
'font' => array(
|
||||
'bold' => true,
|
||||
'size' => 18,
|
||||
),
|
||||
), // Bold, 18pt
|
||||
'h3' => array('font' => array('bold' => true,
|
||||
'h3' => array(
|
||||
'font' => array(
|
||||
'bold' => true,
|
||||
'size' => 13.5,
|
||||
),
|
||||
), // Bold, 13.5pt
|
||||
'h4' => array('font' => array('bold' => true,
|
||||
'h4' => array(
|
||||
'font' => array(
|
||||
'bold' => true,
|
||||
'size' => 12,
|
||||
),
|
||||
), // Bold, 12pt
|
||||
'h5' => array('font' => array('bold' => true,
|
||||
'h5' => array(
|
||||
'font' => array(
|
||||
'bold' => true,
|
||||
'size' => 10,
|
||||
),
|
||||
), // Bold, 10pt
|
||||
'h6' => array('font' => array('bold' => true,
|
||||
'h6' => array(
|
||||
'font' => array(
|
||||
'bold' => true,
|
||||
'size' => 7.5,
|
||||
),
|
||||
), // Bold, 7.5pt
|
||||
'a' => array('font' => array('underline' => true,
|
||||
'color' => array('argb' => PHPExcel_Style_Color::COLOR_BLUE,
|
||||
'a' => array(
|
||||
'font' => array(
|
||||
'underline' => true,
|
||||
'color' => array(
|
||||
'argb' => PHPExcel_Style_Color::COLOR_BLUE,
|
||||
),
|
||||
),
|
||||
), // Blue underlined
|
||||
'hr' => array('borders' => array('bottom' => array('style' => PHPExcel_Style_Border::BORDER_THIN,
|
||||
'color' => array(\PHPExcel_Style_Color::COLOR_BLACK,
|
||||
'hr' => array(
|
||||
'borders' => array(
|
||||
'bottom' => array(
|
||||
'style' => PHPExcel_Style_Border::BORDER_THIN,
|
||||
'color' => array(
|
||||
PHPExcel_Style_Color::COLOR_BLACK,
|
||||
),
|
||||
),
|
||||
),
|
||||
@ -101,7 +120,7 @@ class PHPExcel_Reader_HTML extends PHPExcel_Reader_Abstract implements PHPExcel_
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->_readFilter = new PHPExcel_Reader_DefaultReadFilter();
|
||||
$this->readFilter = new PHPExcel_Reader_DefaultReadFilter();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -109,10 +128,10 @@ class PHPExcel_Reader_HTML extends PHPExcel_Reader_Abstract implements PHPExcel_
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
protected function _isValidFormat()
|
||||
protected function isValidFormat()
|
||||
{
|
||||
// Reading 2048 bytes should be enough to validate that the format is HTML
|
||||
$data = fread($this->_fileHandle, 2048);
|
||||
$data = fread($this->fileHandle, 2048);
|
||||
if ((strpos($data, '<') !== false) &&
|
||||
(strlen($data) !== strlen(strip_tags($data)))) {
|
||||
return true;
|
||||
@ -144,7 +163,7 @@ class PHPExcel_Reader_HTML extends PHPExcel_Reader_Abstract implements PHPExcel_
|
||||
*/
|
||||
public function setInputEncoding($pValue = 'ANSI')
|
||||
{
|
||||
$this->_inputEncoding = $pValue;
|
||||
$this->inputEncoding = $pValue;
|
||||
|
||||
return $this;
|
||||
}
|
||||
@ -156,7 +175,7 @@ class PHPExcel_Reader_HTML extends PHPExcel_Reader_Abstract implements PHPExcel_
|
||||
*/
|
||||
public function getInputEncoding()
|
||||
{
|
||||
return $this->_inputEncoding;
|
||||
return $this->inputEncoding;
|
||||
}
|
||||
|
||||
// Data Array used for testing only, should write to PHPExcel object on completion of tests
|
||||
@ -164,7 +183,7 @@ class PHPExcel_Reader_HTML extends PHPExcel_Reader_Abstract implements PHPExcel_
|
||||
protected $_tableLevel = 0;
|
||||
protected $_nestedColumn = array('A');
|
||||
|
||||
protected function _setTableStartColumn($column)
|
||||
protected function setTableStartColumn($column)
|
||||
{
|
||||
if ($this->_tableLevel == 0) {
|
||||
$column = 'A';
|
||||
@ -175,19 +194,19 @@ class PHPExcel_Reader_HTML extends PHPExcel_Reader_Abstract implements PHPExcel_
|
||||
return $this->_nestedColumn[$this->_tableLevel];
|
||||
}
|
||||
|
||||
protected function _getTableStartColumn()
|
||||
protected function getTableStartColumn()
|
||||
{
|
||||
return $this->_nestedColumn[$this->_tableLevel];
|
||||
}
|
||||
|
||||
protected function _releaseTableStartColumn()
|
||||
protected function releaseTableStartColumn()
|
||||
{
|
||||
--$this->_tableLevel;
|
||||
|
||||
return array_pop($this->_nestedColumn);
|
||||
}
|
||||
|
||||
protected function _flushCell($sheet, $column, $row, &$cellContent)
|
||||
protected function flushCell($sheet, $column, $row, &$cellContent)
|
||||
{
|
||||
if (is_string($cellContent)) {
|
||||
// Simple String content
|
||||
@ -207,7 +226,7 @@ class PHPExcel_Reader_HTML extends PHPExcel_Reader_Abstract implements PHPExcel_
|
||||
$cellContent = (string) '';
|
||||
}
|
||||
|
||||
protected function _processDomElement(DOMNode $element, $sheet, &$row, &$column, &$cellContent, $format = null)
|
||||
protected function processDomElement(DOMNode $element, $sheet, &$row, &$column, &$cellContent, $format = null)
|
||||
{
|
||||
foreach ($element->childNodes as $child) {
|
||||
if ($child instanceof DOMText) {
|
||||
@ -238,10 +257,10 @@ class PHPExcel_Reader_HTML extends PHPExcel_Reader_Abstract implements PHPExcel_
|
||||
break;
|
||||
}
|
||||
}
|
||||
$this->_processDomElement($child, $sheet, $row, $column, $cellContent);
|
||||
$this->processDomElement($child, $sheet, $row, $column, $cellContent);
|
||||
break;
|
||||
case 'title':
|
||||
$this->_processDomElement($child, $sheet, $row, $column, $cellContent);
|
||||
$this->processDomElement($child, $sheet, $row, $column, $cellContent);
|
||||
$sheet->setTitle($cellContent);
|
||||
$cellContent = '';
|
||||
break;
|
||||
@ -256,20 +275,20 @@ class PHPExcel_Reader_HTML extends PHPExcel_Reader_Abstract implements PHPExcel_
|
||||
if ($cellContent > '') {
|
||||
$cellContent .= ' ';
|
||||
}
|
||||
$this->_processDomElement($child, $sheet, $row, $column, $cellContent);
|
||||
$this->processDomElement($child, $sheet, $row, $column, $cellContent);
|
||||
if ($cellContent > '') {
|
||||
$cellContent .= ' ';
|
||||
}
|
||||
// echo 'END OF STYLING, SPAN OR DIV<br />';
|
||||
break;
|
||||
case 'hr':
|
||||
$this->_flushCell($sheet, $column, $row, $cellContent);
|
||||
$this->flushCell($sheet, $column, $row, $cellContent);
|
||||
++$row;
|
||||
if (isset($this->_formats[$child->nodeName])) {
|
||||
$sheet->getStyle($column . $row)->applyFromArray($this->_formats[$child->nodeName]);
|
||||
if (isset($this->formats[$child->nodeName])) {
|
||||
$sheet->getStyle($column . $row)->applyFromArray($this->formats[$child->nodeName]);
|
||||
} else {
|
||||
$cellContent = '----------';
|
||||
$this->_flushCell($sheet, $column, $row, $cellContent);
|
||||
$this->flushCell($sheet, $column, $row, $cellContent);
|
||||
}
|
||||
++$row;
|
||||
case 'br':
|
||||
@ -278,7 +297,7 @@ class PHPExcel_Reader_HTML extends PHPExcel_Reader_Abstract implements PHPExcel_
|
||||
$cellContent .= "\n";
|
||||
} else {
|
||||
// Otherwise flush our existing content and move the row cursor on
|
||||
$this->_flushCell($sheet, $column, $row, $cellContent);
|
||||
$this->flushCell($sheet, $column, $row, $cellContent);
|
||||
++$row;
|
||||
}
|
||||
// echo 'HARD LINE BREAK: ' , '<br />';
|
||||
@ -290,14 +309,14 @@ class PHPExcel_Reader_HTML extends PHPExcel_Reader_Abstract implements PHPExcel_
|
||||
case 'href':
|
||||
// echo 'Link to ' , $attributeValue , '<br />';
|
||||
$sheet->getCell($column . $row)->getHyperlink()->setUrl($attributeValue);
|
||||
if (isset($this->_formats[$child->nodeName])) {
|
||||
$sheet->getStyle($column . $row)->applyFromArray($this->_formats[$child->nodeName]);
|
||||
if (isset($this->formats[$child->nodeName])) {
|
||||
$sheet->getStyle($column . $row)->applyFromArray($this->formats[$child->nodeName]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
$cellContent .= ' ';
|
||||
$this->_processDomElement($child, $sheet, $row, $column, $cellContent);
|
||||
$this->processDomElement($child, $sheet, $row, $column, $cellContent);
|
||||
// echo 'END OF HYPERLINK:' , '<br />';
|
||||
break;
|
||||
case 'h1':
|
||||
@ -313,20 +332,20 @@ class PHPExcel_Reader_HTML extends PHPExcel_Reader_Abstract implements PHPExcel_
|
||||
// If we're inside a table, replace with a \n
|
||||
$cellContent .= "\n";
|
||||
// echo 'LIST ENTRY: ' , '<br />';
|
||||
$this->_processDomElement($child, $sheet, $row, $column, $cellContent);
|
||||
$this->processDomElement($child, $sheet, $row, $column, $cellContent);
|
||||
// echo 'END OF LIST ENTRY:' , '<br />';
|
||||
} else {
|
||||
if ($cellContent > '') {
|
||||
$this->_flushCell($sheet, $column, $row, $cellContent);
|
||||
$this->flushCell($sheet, $column, $row, $cellContent);
|
||||
$row++;
|
||||
}
|
||||
// echo 'START OF PARAGRAPH: ' , '<br />';
|
||||
$this->_processDomElement($child, $sheet, $row, $column, $cellContent);
|
||||
$this->processDomElement($child, $sheet, $row, $column, $cellContent);
|
||||
// echo 'END OF PARAGRAPH:' , '<br />';
|
||||
$this->_flushCell($sheet, $column, $row, $cellContent);
|
||||
$this->flushCell($sheet, $column, $row, $cellContent);
|
||||
|
||||
if (isset($this->_formats[$child->nodeName])) {
|
||||
$sheet->getStyle($column . $row)->applyFromArray($this->_formats[$child->nodeName]);
|
||||
if (isset($this->formats[$child->nodeName])) {
|
||||
$sheet->getStyle($column . $row)->applyFromArray($this->formats[$child->nodeName]);
|
||||
}
|
||||
|
||||
$row++;
|
||||
@ -338,30 +357,30 @@ class PHPExcel_Reader_HTML extends PHPExcel_Reader_Abstract implements PHPExcel_
|
||||
// If we're inside a table, replace with a \n
|
||||
$cellContent .= "\n";
|
||||
// echo 'LIST ENTRY: ' , '<br />';
|
||||
$this->_processDomElement($child, $sheet, $row, $column, $cellContent);
|
||||
$this->processDomElement($child, $sheet, $row, $column, $cellContent);
|
||||
// echo 'END OF LIST ENTRY:' , '<br />';
|
||||
} else {
|
||||
if ($cellContent > '') {
|
||||
$this->_flushCell($sheet, $column, $row, $cellContent);
|
||||
$this->flushCell($sheet, $column, $row, $cellContent);
|
||||
}
|
||||
++$row;
|
||||
// echo 'LIST ENTRY: ' , '<br />';
|
||||
$this->_processDomElement($child, $sheet, $row, $column, $cellContent);
|
||||
$this->processDomElement($child, $sheet, $row, $column, $cellContent);
|
||||
// echo 'END OF LIST ENTRY:' , '<br />';
|
||||
$this->_flushCell($sheet, $column, $row, $cellContent);
|
||||
$this->flushCell($sheet, $column, $row, $cellContent);
|
||||
$column = 'A';
|
||||
}
|
||||
break;
|
||||
case 'table':
|
||||
$this->_flushCell($sheet, $column, $row, $cellContent);
|
||||
$column = $this->_setTableStartColumn($column);
|
||||
$this->flushCell($sheet, $column, $row, $cellContent);
|
||||
$column = $this->setTableStartColumn($column);
|
||||
// echo 'START OF TABLE LEVEL ' , $this->_tableLevel , '<br />';
|
||||
if ($this->_tableLevel > 1) {
|
||||
--$row;
|
||||
}
|
||||
$this->_processDomElement($child, $sheet, $row, $column, $cellContent);
|
||||
$this->processDomElement($child, $sheet, $row, $column, $cellContent);
|
||||
// echo 'END OF TABLE LEVEL ' , $this->_tableLevel , '<br />';
|
||||
$column = $this->_releaseTableStartColumn();
|
||||
$column = $this->releaseTableStartColumn();
|
||||
if ($this->_tableLevel > 1) {
|
||||
++$column;
|
||||
} else {
|
||||
@ -370,27 +389,27 @@ class PHPExcel_Reader_HTML extends PHPExcel_Reader_Abstract implements PHPExcel_
|
||||
break;
|
||||
case 'thead':
|
||||
case 'tbody':
|
||||
$this->_processDomElement($child, $sheet, $row, $column, $cellContent);
|
||||
$this->processDomElement($child, $sheet, $row, $column, $cellContent);
|
||||
break;
|
||||
case 'tr':
|
||||
$column = $this->_getTableStartColumn();
|
||||
$column = $this->getTableStartColumn();
|
||||
$cellContent = '';
|
||||
// echo 'START OF TABLE ' , $this->_tableLevel , ' ROW<br />';
|
||||
$this->_processDomElement($child, $sheet, $row, $column, $cellContent);
|
||||
$this->processDomElement($child, $sheet, $row, $column, $cellContent);
|
||||
++$row;
|
||||
// echo 'END OF TABLE ' , $this->_tableLevel , ' ROW<br />';
|
||||
break;
|
||||
case 'th':
|
||||
case 'td':
|
||||
// echo 'START OF TABLE ' , $this->_tableLevel , ' CELL<br />';
|
||||
$this->_processDomElement($child, $sheet, $row, $column, $cellContent);
|
||||
$this->processDomElement($child, $sheet, $row, $column, $cellContent);
|
||||
// echo 'END OF TABLE ' , $this->_tableLevel , ' CELL<br />';
|
||||
|
||||
while (isset($this->rowspan[$column . $row])) {
|
||||
++$column;
|
||||
}
|
||||
|
||||
$this->_flushCell($sheet, $column, $row, $cellContent);
|
||||
$this->flushCell($sheet, $column, $row, $cellContent);
|
||||
|
||||
// if (isset($attributeArray['style']) && !empty($attributeArray['style'])) {
|
||||
// $styleAry = $this->getPhpExcelStyleArray($attributeArray['style']);
|
||||
@ -435,10 +454,10 @@ class PHPExcel_Reader_HTML extends PHPExcel_Reader_Abstract implements PHPExcel_
|
||||
$column = 'A';
|
||||
$content = '';
|
||||
$this->_tableLevel = 0;
|
||||
$this->_processDomElement($child, $sheet, $row, $column, $cellContent);
|
||||
$this->processDomElement($child, $sheet, $row, $column, $cellContent);
|
||||
break;
|
||||
default:
|
||||
$this->_processDomElement($child, $sheet, $row, $column, $cellContent);
|
||||
$this->processDomElement($child, $sheet, $row, $column, $cellContent);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -455,19 +474,19 @@ class PHPExcel_Reader_HTML extends PHPExcel_Reader_Abstract implements PHPExcel_
|
||||
public function loadIntoExisting($pFilename, PHPExcel $objPHPExcel)
|
||||
{
|
||||
// Open file to validate
|
||||
$this->_openFile($pFilename);
|
||||
if (!$this->_isValidFormat()) {
|
||||
fclose($this->_fileHandle);
|
||||
$this->openFile($pFilename);
|
||||
if (!$this->isValidFormat()) {
|
||||
fclose($this->fileHandle);
|
||||
throw new PHPExcel_Reader_Exception($pFilename . " is an Invalid HTML file.");
|
||||
}
|
||||
// Close after validating
|
||||
fclose($this->_fileHandle);
|
||||
fclose($this->fileHandle);
|
||||
|
||||
// Create new PHPExcel
|
||||
while ($objPHPExcel->getSheetCount() <= $this->_sheetIndex) {
|
||||
while ($objPHPExcel->getSheetCount() <= $this->sheetIndex) {
|
||||
$objPHPExcel->createSheet();
|
||||
}
|
||||
$objPHPExcel->setActiveSheetIndex($this->_sheetIndex);
|
||||
$objPHPExcel->setActiveSheetIndex($this->sheetIndex);
|
||||
|
||||
// Create a new DOM object
|
||||
$dom = new domDocument;
|
||||
@ -483,7 +502,7 @@ class PHPExcel_Reader_HTML extends PHPExcel_Reader_Abstract implements PHPExcel_
|
||||
$row = 0;
|
||||
$column = 'A';
|
||||
$content = '';
|
||||
$this->_processDomElement($dom, $objPHPExcel->getActiveSheet(), $row, $column, $content);
|
||||
$this->processDomElement($dom, $objPHPExcel->getActiveSheet(), $row, $column, $content);
|
||||
|
||||
// Return
|
||||
return $objPHPExcel;
|
||||
@ -496,7 +515,7 @@ class PHPExcel_Reader_HTML extends PHPExcel_Reader_Abstract implements PHPExcel_
|
||||
*/
|
||||
public function getSheetIndex()
|
||||
{
|
||||
return $this->_sheetIndex;
|
||||
return $this->sheetIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -507,7 +526,7 @@ class PHPExcel_Reader_HTML extends PHPExcel_Reader_Abstract implements PHPExcel_
|
||||
*/
|
||||
public function setSheetIndex($pValue = 0)
|
||||
{
|
||||
$this->_sheetIndex = $pValue;
|
||||
$this->sheetIndex = $pValue;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
@ -30,10 +30,10 @@ interface PHPExcel_Reader_IReadFilter
|
||||
/**
|
||||
* Should this cell be read?
|
||||
*
|
||||
* @param $column String column index
|
||||
* @param $row Row index
|
||||
* @param $column Column address (as a string value like "A", or "IV")
|
||||
* @param $row Row number
|
||||
* @param $worksheetName Optional worksheet name
|
||||
* @return boolean
|
||||
* @return boolean
|
||||
*/
|
||||
public function readCell($column, $row, $worksheetName = '');
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* PHPExcel
|
||||
* PHPExcel_Reader_IReader
|
||||
*
|
||||
* Copyright (c) 2006 - 2015 PHPExcel
|
||||
*
|
||||
@ -24,15 +25,6 @@
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* PHPExcel_Reader_IReader
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_Reader
|
||||
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
interface PHPExcel_Reader_IReader
|
||||
{
|
||||
/**
|
||||
|
@ -48,7 +48,7 @@ class PHPExcel_Reader_OOCalc extends PHPExcel_Reader_Abstract implements PHPExce
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->_readFilter = new PHPExcel_Reader_DefaultReadFilter();
|
||||
$this->readFilter = new PHPExcel_Reader_DefaultReadFilter();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -438,8 +438,8 @@ class PHPExcel_Reader_OOCalc extends PHPExcel_Reader_Abstract implements PHPExce
|
||||
$worksheetDataAttributes = $worksheetDataSet->attributes($namespacesContent['table']);
|
||||
// print_r($worksheetDataAttributes);
|
||||
// echo '<br />';
|
||||
if ((isset($this->_loadSheetsOnly)) && (isset($worksheetDataAttributes['name'])) &&
|
||||
(!in_array($worksheetDataAttributes['name'], $this->_loadSheetsOnly))) {
|
||||
if ((isset($this->loadSheetsOnly)) && (isset($worksheetDataAttributes['name'])) &&
|
||||
(!in_array($worksheetDataAttributes['name'], $this->loadSheetsOnly))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -657,7 +657,7 @@ class PHPExcel_Reader_OOCalc extends PHPExcel_Reader_Abstract implements PHPExce
|
||||
|
||||
// Merged cells
|
||||
if ((isset($cellDataTableAttributes['number-columns-spanned'])) || (isset($cellDataTableAttributes['number-rows-spanned']))) {
|
||||
if (($type !== PHPExcel_Cell_DataType::TYPE_NULL) || (!$this->_readDataOnly)) {
|
||||
if (($type !== PHPExcel_Cell_DataType::TYPE_NULL) || (!$this->readDataOnly)) {
|
||||
$columnTo = $columnID;
|
||||
if (isset($cellDataTableAttributes['number-columns-spanned'])) {
|
||||
$columnTo = PHPExcel_Cell::stringFromColumnIndex(PHPExcel_Cell::columnIndexFromString($columnID) + $cellDataTableAttributes['number-columns-spanned'] -2);
|
||||
|
@ -1,6 +1,16 @@
|
||||
<?php
|
||||
|
||||
/** PHPExcel root directory */
|
||||
if (!defined('PHPEXCEL_ROOT')) {
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
|
||||
require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||
}
|
||||
|
||||
/**
|
||||
* PHPExcel
|
||||
* PHPExcel_Reader_SYLK
|
||||
*
|
||||
* Copyright (c) 2006 - 2015 PHPExcel
|
||||
*
|
||||
@ -24,24 +34,6 @@
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
|
||||
/** PHPExcel root directory */
|
||||
if (!defined('PHPEXCEL_ROOT')) {
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
|
||||
require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||
}
|
||||
|
||||
/**
|
||||
* PHPExcel_Reader_SYLK
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_Reader
|
||||
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
class PHPExcel_Reader_SYLK extends PHPExcel_Reader_Abstract implements PHPExcel_Reader_IReader
|
||||
{
|
||||
/**
|
||||
@ -77,7 +69,7 @@ class PHPExcel_Reader_SYLK extends PHPExcel_Reader_Abstract implements PHPExcel_
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->_readFilter = new PHPExcel_Reader_DefaultReadFilter();
|
||||
$this->readFilter = new PHPExcel_Reader_DefaultReadFilter();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -85,10 +77,10 @@ class PHPExcel_Reader_SYLK extends PHPExcel_Reader_Abstract implements PHPExcel_
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
protected function _isValidFormat()
|
||||
protected function isValidFormat()
|
||||
{
|
||||
// Read sample data (first 2 KB will do)
|
||||
$data = fread($this->_fileHandle, 2048);
|
||||
$data = fread($this->fileHandle, 2048);
|
||||
|
||||
// Count delimiters in file
|
||||
$delimiterCount = substr_count($data, ';');
|
||||
@ -135,12 +127,12 @@ class PHPExcel_Reader_SYLK extends PHPExcel_Reader_Abstract implements PHPExcel_
|
||||
public function listWorksheetInfo($pFilename)
|
||||
{
|
||||
// Open file
|
||||
$this->_openFile($pFilename);
|
||||
if (!$this->_isValidFormat()) {
|
||||
fclose($this->_fileHandle);
|
||||
$this->openFile($pFilename);
|
||||
if (!$this->isValidFormat()) {
|
||||
fclose($this->fileHandle);
|
||||
throw new PHPExcel_Reader_Exception($pFilename . " is an Invalid Spreadsheet file.");
|
||||
}
|
||||
$fileHandle = $this->_fileHandle;
|
||||
$fileHandle = $this->fileHandle;
|
||||
rewind($fileHandle);
|
||||
|
||||
$worksheetInfo = array();
|
||||
@ -222,12 +214,12 @@ class PHPExcel_Reader_SYLK extends PHPExcel_Reader_Abstract implements PHPExcel_
|
||||
public function loadIntoExisting($pFilename, PHPExcel $objPHPExcel)
|
||||
{
|
||||
// Open file
|
||||
$this->_openFile($pFilename);
|
||||
if (!$this->_isValidFormat()) {
|
||||
fclose($this->_fileHandle);
|
||||
$this->openFile($pFilename);
|
||||
if (!$this->isValidFormat()) {
|
||||
fclose($this->fileHandle);
|
||||
throw new PHPExcel_Reader_Exception($pFilename . " is an Invalid Spreadsheet file.");
|
||||
}
|
||||
$fileHandle = $this->_fileHandle;
|
||||
$fileHandle = $this->fileHandle;
|
||||
rewind($fileHandle);
|
||||
|
||||
// Create new PHPExcel
|
||||
|
@ -39,154 +39,105 @@ class PHPExcel_Shared_CodePage
|
||||
{
|
||||
switch ($codePage) {
|
||||
case 367:
|
||||
return 'ASCII';
|
||||
break; // ASCII
|
||||
return 'ASCII'; // ASCII
|
||||
case 437:
|
||||
return 'CP437';
|
||||
break; // OEM US
|
||||
return 'CP437'; // OEM US
|
||||
case 720:
|
||||
throw new PHPExcel_Exception('Code page 720 not supported.');
|
||||
break; // OEM Arabic
|
||||
throw new PHPExcel_Exception('Code page 720 not supported.'); // OEM Arabic
|
||||
case 737:
|
||||
return 'CP737';
|
||||
break; // OEM Greek
|
||||
return 'CP737'; // OEM Greek
|
||||
case 775:
|
||||
return 'CP775';
|
||||
break; // OEM Baltic
|
||||
return 'CP775'; // OEM Baltic
|
||||
case 850:
|
||||
return 'CP850';
|
||||
break; // OEM Latin I
|
||||
return 'CP850'; // OEM Latin I
|
||||
case 852:
|
||||
return 'CP852';
|
||||
break; // OEM Latin II (Central European)
|
||||
return 'CP852'; // OEM Latin II (Central European)
|
||||
case 855:
|
||||
return 'CP855';
|
||||
break; // OEM Cyrillic
|
||||
return 'CP855'; // OEM Cyrillic
|
||||
case 857:
|
||||
return 'CP857';
|
||||
break; // OEM Turkish
|
||||
return 'CP857'; // OEM Turkish
|
||||
case 858:
|
||||
return 'CP858';
|
||||
break; // OEM Multilingual Latin I with Euro
|
||||
return 'CP858'; // OEM Multilingual Latin I with Euro
|
||||
case 860:
|
||||
return 'CP860';
|
||||
break; // OEM Portugese
|
||||
return 'CP860'; // OEM Portugese
|
||||
case 861:
|
||||
return 'CP861';
|
||||
break; // OEM Icelandic
|
||||
return 'CP861'; // OEM Icelandic
|
||||
case 862:
|
||||
return 'CP862';
|
||||
break; // OEM Hebrew
|
||||
return 'CP862'; // OEM Hebrew
|
||||
case 863:
|
||||
return 'CP863';
|
||||
break; // OEM Canadian (French)
|
||||
return 'CP863'; // OEM Canadian (French)
|
||||
case 864:
|
||||
return 'CP864';
|
||||
break; // OEM Arabic
|
||||
return 'CP864'; // OEM Arabic
|
||||
case 865:
|
||||
return 'CP865';
|
||||
break; // OEM Nordic
|
||||
return 'CP865'; // OEM Nordic
|
||||
case 866:
|
||||
return 'CP866';
|
||||
break; // OEM Cyrillic (Russian)
|
||||
return 'CP866'; // OEM Cyrillic (Russian)
|
||||
case 869:
|
||||
return 'CP869';
|
||||
break; // OEM Greek (Modern)
|
||||
return 'CP869'; // OEM Greek (Modern)
|
||||
case 874:
|
||||
return 'CP874';
|
||||
break; // ANSI Thai
|
||||
return 'CP874'; // ANSI Thai
|
||||
case 932:
|
||||
return 'CP932';
|
||||
break; // ANSI Japanese Shift-JIS
|
||||
return 'CP932'; // ANSI Japanese Shift-JIS
|
||||
case 936:
|
||||
return 'CP936';
|
||||
break; // ANSI Chinese Simplified GBK
|
||||
return 'CP936'; // ANSI Chinese Simplified GBK
|
||||
case 949:
|
||||
return 'CP949';
|
||||
break; // ANSI Korean (Wansung)
|
||||
return 'CP949'; // ANSI Korean (Wansung)
|
||||
case 950:
|
||||
return 'CP950';
|
||||
break; // ANSI Chinese Traditional BIG5
|
||||
return 'CP950'; // ANSI Chinese Traditional BIG5
|
||||
case 1200:
|
||||
return 'UTF-16LE';
|
||||
break; // UTF-16 (BIFF8)
|
||||
return 'UTF-16LE'; // UTF-16 (BIFF8)
|
||||
case 1250:
|
||||
return 'CP1250';
|
||||
break; // ANSI Latin II (Central European)
|
||||
return 'CP1250'; // ANSI Latin II (Central European)
|
||||
case 1251:
|
||||
return 'CP1251';
|
||||
break; // ANSI Cyrillic
|
||||
return 'CP1251'; // ANSI Cyrillic
|
||||
case 0:
|
||||
// CodePage is not always correctly set when the xls file was saved by Apple's Numbers program
|
||||
// CodePage is not always correctly set when the xls file was saved by Apple's Numbers program
|
||||
case 1252:
|
||||
return 'CP1252';
|
||||
break; // ANSI Latin I (BIFF4-BIFF7)
|
||||
return 'CP1252'; // ANSI Latin I (BIFF4-BIFF7)
|
||||
case 1253:
|
||||
return 'CP1253';
|
||||
break; // ANSI Greek
|
||||
return 'CP1253'; // ANSI Greek
|
||||
case 1254:
|
||||
return 'CP1254';
|
||||
break; // ANSI Turkish
|
||||
return 'CP1254'; // ANSI Turkish
|
||||
case 1255:
|
||||
return 'CP1255';
|
||||
break; // ANSI Hebrew
|
||||
return 'CP1255'; // ANSI Hebrew
|
||||
case 1256:
|
||||
return 'CP1256';
|
||||
break; // ANSI Arabic
|
||||
return 'CP1256'; // ANSI Arabic
|
||||
case 1257:
|
||||
return 'CP1257';
|
||||
break; // ANSI Baltic
|
||||
return 'CP1257'; // ANSI Baltic
|
||||
case 1258:
|
||||
return 'CP1258';
|
||||
break; // ANSI Vietnamese
|
||||
return 'CP1258'; // ANSI Vietnamese
|
||||
case 1361:
|
||||
return 'CP1361';
|
||||
break; // ANSI Korean (Johab)
|
||||
return 'CP1361'; // ANSI Korean (Johab)
|
||||
case 10000:
|
||||
return 'MAC';
|
||||
break; // Apple Roman
|
||||
return 'MAC'; // Apple Roman
|
||||
case 10001:
|
||||
return 'CP932';
|
||||
break; // Macintosh Japanese
|
||||
return 'CP932'; // Macintosh Japanese
|
||||
case 10002:
|
||||
return 'CP950';
|
||||
break; // Macintosh Chinese Traditional
|
||||
return 'CP950'; // Macintosh Chinese Traditional
|
||||
case 10003:
|
||||
return 'CP1361';
|
||||
break; // Macintosh Korean
|
||||
return 'CP1361'; // Macintosh Korean
|
||||
case 10006:
|
||||
return 'MACGREEK';
|
||||
break; // Macintosh Greek
|
||||
return 'MACGREEK'; // Macintosh Greek
|
||||
case 10007:
|
||||
return 'MACCYRILLIC';
|
||||
break; // Macintosh Cyrillic
|
||||
return 'MACCYRILLIC'; // Macintosh Cyrillic
|
||||
case 10008:
|
||||
return 'CP936';
|
||||
break; // Macintosh - Simplified Chinese (GB 2312)
|
||||
return 'CP936'; // Macintosh - Simplified Chinese (GB 2312)
|
||||
case 10029:
|
||||
return 'MACCENTRALEUROPE';
|
||||
break; // Macintosh Central Europe
|
||||
return 'MACCENTRALEUROPE'; // Macintosh Central Europe
|
||||
case 10079:
|
||||
return 'MACICELAND';
|
||||
break; // Macintosh Icelandic
|
||||
return 'MACICELAND'; // Macintosh Icelandic
|
||||
case 10081:
|
||||
return 'MACTURKISH';
|
||||
break; // Macintosh Turkish
|
||||
return 'MACTURKISH'; // Macintosh Turkish
|
||||
case 21010:
|
||||
return 'UTF-16LE';
|
||||
break; // UTF-16 (BIFF8) This isn't correct, but some Excel writer libraries erroneously use Codepage 21010 for UTF-16LE
|
||||
return 'UTF-16LE'; // UTF-16 (BIFF8) This isn't correct, but some Excel writer libraries erroneously use Codepage 21010 for UTF-16LE
|
||||
case 32768:
|
||||
return 'MAC';
|
||||
break; // Apple Roman
|
||||
return 'MAC'; // Apple Roman
|
||||
case 32769:
|
||||
throw new PHPExcel_Exception('Code page 32769 not supported.');
|
||||
break; // ANSI Latin I (BIFF2-BIFF3)
|
||||
throw new PHPExcel_Exception('Code page 32769 not supported.'); // ANSI Latin I (BIFF2-BIFF3)
|
||||
case 65000:
|
||||
return 'UTF-7';
|
||||
break; // Unicode (UTF-7)
|
||||
return 'UTF-7'; // Unicode (UTF-7)
|
||||
case 65001:
|
||||
return 'UTF-8';
|
||||
break; // Unicode (UTF-8)
|
||||
return 'UTF-8'; // Unicode (UTF-8)
|
||||
}
|
||||
throw new PHPExcel_Exception('Unknown codepage: ' . $codePage);
|
||||
}
|
||||
|
@ -94,19 +94,19 @@ class PHPExcel_Shared_OLERead
|
||||
$this->data = file_get_contents($sFileName);
|
||||
|
||||
// Total number of sectors used for the SAT
|
||||
$this->numBigBlockDepotBlocks = self::_GetInt4d($this->data, self::NUM_BIG_BLOCK_DEPOT_BLOCKS_POS);
|
||||
$this->numBigBlockDepotBlocks = self::getInt4d($this->data, self::NUM_BIG_BLOCK_DEPOT_BLOCKS_POS);
|
||||
|
||||
// SecID of the first sector of the directory stream
|
||||
$this->rootStartBlock = self::_GetInt4d($this->data, self::ROOT_START_BLOCK_POS);
|
||||
$this->rootStartBlock = self::getInt4d($this->data, self::ROOT_START_BLOCK_POS);
|
||||
|
||||
// SecID of the first sector of the SSAT (or -2 if not extant)
|
||||
$this->sbdStartBlock = self::_GetInt4d($this->data, self::SMALL_BLOCK_DEPOT_BLOCK_POS);
|
||||
$this->sbdStartBlock = self::getInt4d($this->data, self::SMALL_BLOCK_DEPOT_BLOCK_POS);
|
||||
|
||||
// SecID of the first sector of the MSAT (or -2 if no additional sectors are used)
|
||||
$this->extensionBlock = self::_GetInt4d($this->data, self::EXTENSION_BLOCK_POS);
|
||||
$this->extensionBlock = self::getInt4d($this->data, self::EXTENSION_BLOCK_POS);
|
||||
|
||||
// Total number of sectors used by MSAT
|
||||
$this->numExtensionBlocks = self::_GetInt4d($this->data, self::NUM_EXTENSION_BLOCK_POS);
|
||||
$this->numExtensionBlocks = self::getInt4d($this->data, self::NUM_EXTENSION_BLOCK_POS);
|
||||
|
||||
$bigBlockDepotBlocks = array();
|
||||
$pos = self::BIG_BLOCK_DEPOT_BLOCKS_POS;
|
||||
@ -118,7 +118,7 @@ class PHPExcel_Shared_OLERead
|
||||
}
|
||||
|
||||
for ($i = 0; $i < $bbdBlocks; ++$i) {
|
||||
$bigBlockDepotBlocks[$i] = self::_GetInt4d($this->data, $pos);
|
||||
$bigBlockDepotBlocks[$i] = self::getInt4d($this->data, $pos);
|
||||
$pos += 4;
|
||||
}
|
||||
|
||||
@ -127,13 +127,13 @@ class PHPExcel_Shared_OLERead
|
||||
$blocksToRead = min($this->numBigBlockDepotBlocks - $bbdBlocks, self::BIG_BLOCK_SIZE / 4 - 1);
|
||||
|
||||
for ($i = $bbdBlocks; $i < $bbdBlocks + $blocksToRead; ++$i) {
|
||||
$bigBlockDepotBlocks[$i] = self::_GetInt4d($this->data, $pos);
|
||||
$bigBlockDepotBlocks[$i] = self::getInt4d($this->data, $pos);
|
||||
$pos += 4;
|
||||
}
|
||||
|
||||
$bbdBlocks += $blocksToRead;
|
||||
if ($bbdBlocks < $this->numBigBlockDepotBlocks) {
|
||||
$this->extensionBlock = self::_GetInt4d($this->data, $pos);
|
||||
$this->extensionBlock = self::getInt4d($this->data, $pos);
|
||||
}
|
||||
}
|
||||
|
||||
@ -156,14 +156,14 @@ class PHPExcel_Shared_OLERead
|
||||
$this->smallBlockChain .= substr($this->data, $pos, 4*$bbs);
|
||||
$pos += 4*$bbs;
|
||||
|
||||
$sbdBlock = self::_GetInt4d($this->bigBlockChain, $sbdBlock*4);
|
||||
$sbdBlock = self::getInt4d($this->bigBlockChain, $sbdBlock*4);
|
||||
}
|
||||
|
||||
// read the directory stream
|
||||
$block = $this->rootStartBlock;
|
||||
$this->entry = $this->_readData($block);
|
||||
|
||||
$this->_readPropertySets();
|
||||
$this->readPropertySets();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -188,7 +188,7 @@ class PHPExcel_Shared_OLERead
|
||||
$pos = $block * self::SMALL_BLOCK_SIZE;
|
||||
$streamData .= substr($rootdata, $pos, self::SMALL_BLOCK_SIZE);
|
||||
|
||||
$block = self::_GetInt4d($this->smallBlockChain, $block*4);
|
||||
$block = self::getInt4d($this->smallBlockChain, $block*4);
|
||||
}
|
||||
|
||||
return $streamData;
|
||||
@ -207,7 +207,7 @@ class PHPExcel_Shared_OLERead
|
||||
while ($block != -2) {
|
||||
$pos = ($block + 1) * self::BIG_BLOCK_SIZE;
|
||||
$streamData .= substr($this->data, $pos, self::BIG_BLOCK_SIZE);
|
||||
$block = self::_GetInt4d($this->bigBlockChain, $block*4);
|
||||
$block = self::getInt4d($this->bigBlockChain, $block*4);
|
||||
}
|
||||
|
||||
return $streamData;
|
||||
@ -228,7 +228,7 @@ class PHPExcel_Shared_OLERead
|
||||
while ($block != -2) {
|
||||
$pos = ($block + 1) * self::BIG_BLOCK_SIZE;
|
||||
$data .= substr($this->data, $pos, self::BIG_BLOCK_SIZE);
|
||||
$block = self::_GetInt4d($this->bigBlockChain, $block*4);
|
||||
$block = self::getInt4d($this->bigBlockChain, $block*4);
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
@ -236,7 +236,7 @@ class PHPExcel_Shared_OLERead
|
||||
/**
|
||||
* Read entries in the directory stream.
|
||||
*/
|
||||
private function _readPropertySets()
|
||||
private function readPropertySets()
|
||||
{
|
||||
$offset = 0;
|
||||
|
||||
@ -254,9 +254,9 @@ class PHPExcel_Shared_OLERead
|
||||
|
||||
// sectorID of first sector or short sector, if this entry refers to a stream (the case with workbook)
|
||||
// sectorID of first sector of the short-stream container stream, if this entry is root entry
|
||||
$startBlock = self::_GetInt4d($d, self::START_BLOCK_POS);
|
||||
$startBlock = self::getInt4d($d, self::START_BLOCK_POS);
|
||||
|
||||
$size = self::_GetInt4d($d, self::SIZE_POS);
|
||||
$size = self::getInt4d($d, self::SIZE_POS);
|
||||
|
||||
$name = str_replace("\x00", "", substr($d, 0, $nameSize));
|
||||
|
||||
@ -301,7 +301,7 @@ class PHPExcel_Shared_OLERead
|
||||
* @param int $pos
|
||||
* @return int
|
||||
*/
|
||||
private static function _GetInt4d($data, $pos)
|
||||
private static function getInt4d($data, $pos)
|
||||
{
|
||||
// FIX: represent numbers correctly on 64-bit system
|
||||
// http://sourceforge.net/tracker/index.php?func=detail&aid=1487372&group_id=99160&atid=623334
|
||||
|
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* PHPExcel
|
||||
* PHPExcel_Worksheet_AutoFilter
|
||||
*
|
||||
* Copyright (c) 2006 - 2015 PHPExcel
|
||||
*
|
||||
@ -24,15 +25,6 @@
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* PHPExcel_Worksheet_AutoFilter
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_Worksheet
|
||||
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
class PHPExcel_Worksheet_AutoFilter
|
||||
{
|
||||
/**
|
||||
@ -40,7 +32,7 @@ class PHPExcel_Worksheet_AutoFilter
|
||||
*
|
||||
* @var PHPExcel_Worksheet
|
||||
*/
|
||||
private $_workSheet = null;
|
||||
private $workSheet;
|
||||
|
||||
|
||||
/**
|
||||
@ -48,7 +40,7 @@ class PHPExcel_Worksheet_AutoFilter
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_range = '';
|
||||
private $range = '';
|
||||
|
||||
|
||||
/**
|
||||
@ -56,7 +48,7 @@ class PHPExcel_Worksheet_AutoFilter
|
||||
*
|
||||
* @var array of PHPExcel_Worksheet_AutoFilter_Column
|
||||
*/
|
||||
private $_columns = array();
|
||||
private $columns = array();
|
||||
|
||||
|
||||
/**
|
||||
@ -67,8 +59,8 @@ class PHPExcel_Worksheet_AutoFilter
|
||||
*/
|
||||
public function __construct($pRange = '', PHPExcel_Worksheet $pSheet = null)
|
||||
{
|
||||
$this->_range = $pRange;
|
||||
$this->_workSheet = $pSheet;
|
||||
$this->range = $pRange;
|
||||
$this->workSheet = $pSheet;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -78,7 +70,7 @@ class PHPExcel_Worksheet_AutoFilter
|
||||
*/
|
||||
public function getParent()
|
||||
{
|
||||
return $this->_workSheet;
|
||||
return $this->workSheet;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -89,7 +81,7 @@ class PHPExcel_Worksheet_AutoFilter
|
||||
*/
|
||||
public function setParent(PHPExcel_Worksheet $pSheet = null)
|
||||
{
|
||||
$this->_workSheet = $pSheet;
|
||||
$this->workSheet = $pSheet;
|
||||
|
||||
return $this;
|
||||
}
|
||||
@ -101,7 +93,7 @@ class PHPExcel_Worksheet_AutoFilter
|
||||
*/
|
||||
public function getRange()
|
||||
{
|
||||
return $this->_range;
|
||||
return $this->range;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -120,23 +112,23 @@ class PHPExcel_Worksheet_AutoFilter
|
||||
}
|
||||
|
||||
if (strpos($pRange, ':') !== false) {
|
||||
$this->_range = $pRange;
|
||||
$this->range = $pRange;
|
||||
} elseif (empty($pRange)) {
|
||||
$this->_range = '';
|
||||
$this->range = '';
|
||||
} else {
|
||||
throw new PHPExcel_Exception('Autofilter must be set on a range of cells.');
|
||||
}
|
||||
|
||||
if (empty($pRange)) {
|
||||
// Discard all column rules
|
||||
$this->_columns = array();
|
||||
$this->columns = array();
|
||||
} else {
|
||||
// Discard any column rules that are no longer valid within this range
|
||||
list($rangeStart, $rangeEnd) = PHPExcel_Cell::rangeBoundaries($this->_range);
|
||||
foreach ($this->_columns as $key => $value) {
|
||||
list($rangeStart, $rangeEnd) = PHPExcel_Cell::rangeBoundaries($this->range);
|
||||
foreach ($this->columns as $key => $value) {
|
||||
$colIndex = PHPExcel_Cell::columnIndexFromString($key);
|
||||
if (($rangeStart[0] > $colIndex) || ($rangeEnd[0] < $colIndex)) {
|
||||
unset($this->_columns[$key]);
|
||||
unset($this->columns[$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -152,7 +144,7 @@ class PHPExcel_Worksheet_AutoFilter
|
||||
*/
|
||||
public function getColumns()
|
||||
{
|
||||
return $this->_columns;
|
||||
return $this->columns;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -164,12 +156,12 @@ class PHPExcel_Worksheet_AutoFilter
|
||||
*/
|
||||
public function testColumnInRange($column)
|
||||
{
|
||||
if (empty($this->_range)) {
|
||||
if (empty($this->range)) {
|
||||
throw new PHPExcel_Exception("No autofilter range is defined.");
|
||||
}
|
||||
|
||||
$columnIndex = PHPExcel_Cell::columnIndexFromString($column);
|
||||
list($rangeStart, $rangeEnd) = PHPExcel_Cell::rangeBoundaries($this->_range);
|
||||
list($rangeStart, $rangeEnd) = PHPExcel_Cell::rangeBoundaries($this->range);
|
||||
if (($rangeStart[0] > $columnIndex) || ($rangeEnd[0] < $columnIndex)) {
|
||||
throw new PHPExcel_Exception("Column is outside of current autofilter range.");
|
||||
}
|
||||
@ -200,11 +192,11 @@ class PHPExcel_Worksheet_AutoFilter
|
||||
{
|
||||
$this->testColumnInRange($pColumn);
|
||||
|
||||
if (!isset($this->_columns[$pColumn])) {
|
||||
$this->_columns[$pColumn] = new PHPExcel_Worksheet_AutoFilter_Column($pColumn, $this);
|
||||
if (!isset($this->columns[$pColumn])) {
|
||||
$this->columns[$pColumn] = new PHPExcel_Worksheet_AutoFilter_Column($pColumn, $this);
|
||||
}
|
||||
|
||||
return $this->_columns[$pColumn];
|
||||
return $this->columns[$pColumn];
|
||||
}
|
||||
|
||||
/**
|
||||
@ -216,7 +208,7 @@ class PHPExcel_Worksheet_AutoFilter
|
||||
*/
|
||||
public function getColumnByOffset($pColumnOffset = 0)
|
||||
{
|
||||
list($rangeStart, $rangeEnd) = PHPExcel_Cell::rangeBoundaries($this->_range);
|
||||
list($rangeStart, $rangeEnd) = PHPExcel_Cell::rangeBoundaries($this->range);
|
||||
$pColumn = PHPExcel_Cell::stringFromColumnIndex($rangeStart[0] + $pColumnOffset - 1);
|
||||
|
||||
return $this->getColumn($pColumn);
|
||||
@ -242,12 +234,12 @@ class PHPExcel_Worksheet_AutoFilter
|
||||
$this->testColumnInRange($column);
|
||||
|
||||
if (is_string($pColumn)) {
|
||||
$this->_columns[$pColumn] = new PHPExcel_Worksheet_AutoFilter_Column($pColumn, $this);
|
||||
$this->columns[$pColumn] = new PHPExcel_Worksheet_AutoFilter_Column($pColumn, $this);
|
||||
} elseif (is_object($pColumn) && ($pColumn instanceof PHPExcel_Worksheet_AutoFilter_Column)) {
|
||||
$pColumn->setParent($this);
|
||||
$this->_columns[$column] = $pColumn;
|
||||
$this->columns[$column] = $pColumn;
|
||||
}
|
||||
ksort($this->_columns);
|
||||
ksort($this->columns);
|
||||
|
||||
return $this;
|
||||
}
|
||||
@ -263,8 +255,8 @@ class PHPExcel_Worksheet_AutoFilter
|
||||
{
|
||||
$this->testColumnInRange($pColumn);
|
||||
|
||||
if (isset($this->_columns[$pColumn])) {
|
||||
unset($this->_columns[$pColumn]);
|
||||
if (isset($this->columns[$pColumn])) {
|
||||
unset($this->columns[$pColumn]);
|
||||
}
|
||||
|
||||
return $this;
|
||||
@ -286,14 +278,14 @@ class PHPExcel_Worksheet_AutoFilter
|
||||
$fromColumn = strtoupper($fromColumn);
|
||||
$toColumn = strtoupper($toColumn);
|
||||
|
||||
if (($fromColumn !== null) && (isset($this->_columns[$fromColumn])) && ($toColumn !== null)) {
|
||||
$this->_columns[$fromColumn]->setParent();
|
||||
$this->_columns[$fromColumn]->setColumnIndex($toColumn);
|
||||
$this->_columns[$toColumn] = $this->_columns[$fromColumn];
|
||||
$this->_columns[$toColumn]->setParent($this);
|
||||
unset($this->_columns[$fromColumn]);
|
||||
if (($fromColumn !== null) && (isset($this->columns[$fromColumn])) && ($toColumn !== null)) {
|
||||
$this->columns[$fromColumn]->setParent();
|
||||
$this->columns[$fromColumn]->setColumnIndex($toColumn);
|
||||
$this->columns[$toColumn] = $this->columns[$fromColumn];
|
||||
$this->columns[$toColumn]->setParent($this);
|
||||
unset($this->columns[$fromColumn]);
|
||||
|
||||
ksort($this->_columns);
|
||||
ksort($this->columns);
|
||||
}
|
||||
|
||||
return $this;
|
||||
@ -307,7 +299,7 @@ class PHPExcel_Worksheet_AutoFilter
|
||||
* @param mixed[] $dataSet
|
||||
* @return boolean
|
||||
*/
|
||||
private static function _filterTestInSimpleDataSet($cellValue, $dataSet)
|
||||
private static function filterTestInSimpleDataSet($cellValue, $dataSet)
|
||||
{
|
||||
$dataSetValues = $dataSet['filterValues'];
|
||||
$blanks = $dataSet['blanks'];
|
||||
@ -324,7 +316,7 @@ class PHPExcel_Worksheet_AutoFilter
|
||||
* @param mixed[] $dataSet
|
||||
* @return boolean
|
||||
*/
|
||||
private static function _filterTestInDateGroupSet($cellValue, $dataSet)
|
||||
private static function filterTestInDateGroupSet($cellValue, $dataSet)
|
||||
{
|
||||
$dateSet = $dataSet['filterValues'];
|
||||
$blanks = $dataSet['blanks'];
|
||||
@ -364,7 +356,7 @@ class PHPExcel_Worksheet_AutoFilter
|
||||
* @param mixed[] $ruleSet
|
||||
* @return boolean
|
||||
*/
|
||||
private static function _filterTestInCustomDataSet($cellValue, $ruleSet)
|
||||
private static function filterTestInCustomDataSet($cellValue, $ruleSet)
|
||||
{
|
||||
$dataSet = $ruleSet['filterRules'];
|
||||
$join = $ruleSet['join'];
|
||||
@ -442,7 +434,7 @@ class PHPExcel_Worksheet_AutoFilter
|
||||
* @param mixed[] $monthSet
|
||||
* @return boolean
|
||||
*/
|
||||
private static function _filterTestInPeriodDateSet($cellValue, $monthSet)
|
||||
private static function filterTestInPeriodDateSet($cellValue, $monthSet)
|
||||
{
|
||||
// Blank cells are always ignored, so return a FALSE
|
||||
if (($cellValue == '') || ($cellValue === null)) {
|
||||
@ -464,8 +456,8 @@ class PHPExcel_Worksheet_AutoFilter
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private static $_fromReplace = array('\*', '\?', '~~', '~.*', '~.?');
|
||||
private static $_toReplace = array('.*', '.', '~', '\*', '\?');
|
||||
private static $fromReplace = array('\*', '\?', '~~', '~.*', '~.?');
|
||||
private static $toReplace = array('.*', '.', '~', '\*', '\?');
|
||||
|
||||
|
||||
/**
|
||||
@ -475,7 +467,7 @@ class PHPExcel_Worksheet_AutoFilter
|
||||
* @param PHPExcel_Worksheet_AutoFilter_Column &$filterColumn
|
||||
* @return mixed[]
|
||||
*/
|
||||
private function _dynamicFilterDateRange($dynamicRuleType, &$filterColumn)
|
||||
private function dynamicFilterDateRange($dynamicRuleType, &$filterColumn)
|
||||
{
|
||||
$rDateType = PHPExcel_Calculation_Functions::getReturnDateType();
|
||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
|
||||
@ -574,13 +566,13 @@ class PHPExcel_Worksheet_AutoFilter
|
||||
$ruleValues[] = array('operator' => PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_LESSTHAN, 'value' => $maxVal);
|
||||
PHPExcel_Calculation_Functions::setReturnDateType($rDateType);
|
||||
|
||||
return array('method' => '_filterTestInCustomDataSet', 'arguments' => array('filterRules' => $ruleValues, 'join' => PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_COLUMN_JOIN_AND));
|
||||
return array('method' => 'filterTestInCustomDataSet', 'arguments' => array('filterRules' => $ruleValues, 'join' => PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_COLUMN_JOIN_AND));
|
||||
}
|
||||
|
||||
private function _calculateTopTenValue($columnID, $startRow, $endRow, $ruleType, $ruleValue)
|
||||
private function calculateTopTenValue($columnID, $startRow, $endRow, $ruleType, $ruleValue)
|
||||
{
|
||||
$range = $columnID.$startRow.':'.$columnID.$endRow;
|
||||
$dataValues = PHPExcel_Calculation_Functions::flattenArray($this->_workSheet->rangeToArray($range, null, true, false));
|
||||
$dataValues = PHPExcel_Calculation_Functions::flattenArray($this->workSheet->rangeToArray($range, null, true, false));
|
||||
|
||||
$dataValues = array_filter($dataValues);
|
||||
if ($ruleType == PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_TOP) {
|
||||
@ -600,14 +592,14 @@ class PHPExcel_Worksheet_AutoFilter
|
||||
*/
|
||||
public function showHideRows()
|
||||
{
|
||||
list($rangeStart, $rangeEnd) = PHPExcel_Cell::rangeBoundaries($this->_range);
|
||||
list($rangeStart, $rangeEnd) = PHPExcel_Cell::rangeBoundaries($this->range);
|
||||
|
||||
// The heading row should always be visible
|
||||
// echo 'AutoFilter Heading Row ', $rangeStart[1],' is always SHOWN',PHP_EOL;
|
||||
$this->_workSheet->getRowDimension($rangeStart[1])->setVisible(true);
|
||||
$this->workSheet->getRowDimension($rangeStart[1])->setVisible(true);
|
||||
|
||||
$columnFilterTests = array();
|
||||
foreach ($this->_columns as $columnID => $filterColumn) {
|
||||
foreach ($this->columns as $columnID => $filterColumn) {
|
||||
$rules = $filterColumn->getRules();
|
||||
switch ($filterColumn->getFilterType()) {
|
||||
case PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_FILTER:
|
||||
@ -626,7 +618,7 @@ class PHPExcel_Worksheet_AutoFilter
|
||||
if ($ruleType == PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_FILTER) {
|
||||
// Filter on absolute values
|
||||
$columnFilterTests[$columnID] = array(
|
||||
'method' => '_filterTestInSimpleDataSet',
|
||||
'method' => 'filterTestInSimpleDataSet',
|
||||
'arguments' => array('filterValues' => $ruleDataSet, 'blanks' => $blanks)
|
||||
);
|
||||
} else {
|
||||
@ -672,7 +664,7 @@ class PHPExcel_Worksheet_AutoFilter
|
||||
$arguments['time'] = array_filter($arguments['time']);
|
||||
$arguments['dateTime'] = array_filter($arguments['dateTime']);
|
||||
$columnFilterTests[$columnID] = array(
|
||||
'method' => '_filterTestInDateGroupSet',
|
||||
'method' => 'filterTestInDateGroupSet',
|
||||
'arguments' => array('filterValues' => $arguments, 'blanks' => $blanks)
|
||||
);
|
||||
}
|
||||
@ -687,7 +679,7 @@ class PHPExcel_Worksheet_AutoFilter
|
||||
if (!is_numeric($ruleValue)) {
|
||||
// Convert to a regexp allowing for regexp reserved characters, wildcards and escaped wildcards
|
||||
$ruleValue = preg_quote($ruleValue);
|
||||
$ruleValue = str_replace(self::$_fromReplace, self::$_toReplace, $ruleValue);
|
||||
$ruleValue = str_replace(self::$fromReplace, self::$toReplace, $ruleValue);
|
||||
if (trim($ruleValue) == '') {
|
||||
$customRuleForBlanks = true;
|
||||
$ruleValue = trim($ruleValue);
|
||||
@ -697,7 +689,7 @@ class PHPExcel_Worksheet_AutoFilter
|
||||
}
|
||||
$join = $filterColumn->getJoin();
|
||||
$columnFilterTests[$columnID] = array(
|
||||
'method' => '_filterTestInCustomDataSet',
|
||||
'method' => 'filterTestInCustomDataSet',
|
||||
'arguments' => array('filterRules' => $ruleValues, 'join' => $join, 'customRuleForBlanks' => $customRuleForBlanks)
|
||||
);
|
||||
break;
|
||||
@ -711,7 +703,7 @@ class PHPExcel_Worksheet_AutoFilter
|
||||
// Number (Average) based
|
||||
// Calculate the average
|
||||
$averageFormula = '=AVERAGE('.$columnID.($rangeStart[1]+1).':'.$columnID.$rangeEnd[1].')';
|
||||
$average = PHPExcel_Calculation::getInstance()->calculateFormula($averageFormula, null, $this->_workSheet->getCell('A1'));
|
||||
$average = PHPExcel_Calculation::getInstance()->calculateFormula($averageFormula, null, $this->workSheet->getCell('A1'));
|
||||
// Set above/below rule based on greaterThan or LessTan
|
||||
$operator = ($dynamicRuleType === PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_ABOVEAVERAGE)
|
||||
? PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_GREATERTHAN
|
||||
@ -720,7 +712,7 @@ class PHPExcel_Worksheet_AutoFilter
|
||||
'value' => $average
|
||||
);
|
||||
$columnFilterTests[$columnID] = array(
|
||||
'method' => '_filterTestInCustomDataSet',
|
||||
'method' => 'filterTestInCustomDataSet',
|
||||
'arguments' => array('filterRules' => $ruleValues, 'join' => PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_COLUMN_JOIN_OR)
|
||||
);
|
||||
} else {
|
||||
@ -737,13 +729,13 @@ class PHPExcel_Worksheet_AutoFilter
|
||||
$ruleValues = range($periodStart, $periodEnd);
|
||||
}
|
||||
$columnFilterTests[$columnID] = array(
|
||||
'method' => '_filterTestInPeriodDateSet',
|
||||
'method' => 'filterTestInPeriodDateSet',
|
||||
'arguments' => $ruleValues
|
||||
);
|
||||
$filterColumn->setAttributes(array());
|
||||
} else {
|
||||
// Date Range
|
||||
$columnFilterTests[$columnID] = $this->_dynamicFilterDateRange($dynamicRuleType, $filterColumn);
|
||||
$columnFilterTests[$columnID] = $this->dynamicFilterDateRange($dynamicRuleType, $filterColumn);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -768,14 +760,14 @@ class PHPExcel_Worksheet_AutoFilter
|
||||
$ruleValue = 500;
|
||||
}
|
||||
|
||||
$maxVal = $this->_calculateTopTenValue($columnID, $rangeStart[1]+1, $rangeEnd[1], $toptenRuleType, $ruleValue);
|
||||
$maxVal = $this->calculateTopTenValue($columnID, $rangeStart[1]+1, $rangeEnd[1], $toptenRuleType, $ruleValue);
|
||||
|
||||
$operator = ($toptenRuleType == PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_TOP)
|
||||
? PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_GREATERTHANOREQUAL
|
||||
: PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_LESSTHANOREQUAL;
|
||||
$ruleValues[] = array('operator' => $operator, 'value' => $maxVal);
|
||||
$columnFilterTests[$columnID] = array(
|
||||
'method' => '_filterTestInCustomDataSet',
|
||||
'method' => 'filterTestInCustomDataSet',
|
||||
'arguments' => array('filterRules' => $ruleValues, 'join' => PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_COLUMN_JOIN_OR)
|
||||
);
|
||||
$filterColumn->setAttributes(array('maxVal' => $maxVal));
|
||||
@ -792,7 +784,7 @@ class PHPExcel_Worksheet_AutoFilter
|
||||
$result = true;
|
||||
foreach ($columnFilterTests as $columnID => $columnFilterTest) {
|
||||
// echo 'Testing cell ', $columnID.$row,PHP_EOL;
|
||||
$cellValue = $this->_workSheet->getCell($columnID.$row)->getCalculatedValue();
|
||||
$cellValue = $this->workSheet->getCell($columnID.$row)->getCalculatedValue();
|
||||
// echo 'Value is ', $cellValue,PHP_EOL;
|
||||
// Execute the filter test
|
||||
$result = $result &&
|
||||
@ -808,7 +800,7 @@ class PHPExcel_Worksheet_AutoFilter
|
||||
}
|
||||
// Set show/hide for the row based on the result of the autoFilter result
|
||||
// echo (($result) ? 'SHOW' : 'HIDE'),PHP_EOL;
|
||||
$this->_workSheet->getRowDimension($row)->setVisible($result);
|
||||
$this->workSheet->getRowDimension($row)->setVisible($result);
|
||||
}
|
||||
|
||||
return $this;
|
||||
@ -823,13 +815,13 @@ class PHPExcel_Worksheet_AutoFilter
|
||||
$vars = get_object_vars($this);
|
||||
foreach ($vars as $key => $value) {
|
||||
if (is_object($value)) {
|
||||
if ($key == '_workSheet') {
|
||||
if ($key == 'workSheet') {
|
||||
// Detach from worksheet
|
||||
$this->{$key} = null;
|
||||
} else {
|
||||
$this->{$key} = clone $value;
|
||||
}
|
||||
} elseif ((is_array($value)) && ($key == '_columns')) {
|
||||
} elseif ((is_array($value)) && ($key == 'columns')) {
|
||||
// The columns array of PHPExcel_Worksheet_AutoFilter objects
|
||||
$this->{$key} = array();
|
||||
foreach ($value as $k => $v) {
|
||||
@ -849,6 +841,6 @@ class PHPExcel_Worksheet_AutoFilter
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return (string) $this->_range;
|
||||
return (string) $this->range;
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* PHPExcel
|
||||
* PHPExcel_Worksheet_AutoFilter_Column
|
||||
*
|
||||
* Copyright (c) 2006 - 2015 PHPExcel
|
||||
*
|
||||
@ -24,32 +25,23 @@
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* PHPExcel_Worksheet_AutoFilter_Column
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_Worksheet
|
||||
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
class PHPExcel_Worksheet_AutoFilter_Column
|
||||
{
|
||||
const AUTOFILTER_FILTERTYPE_FILTER = 'filters';
|
||||
const AUTOFILTER_FILTERTYPE_CUSTOMFILTER = 'customFilters';
|
||||
const AUTOFILTER_FILTERTYPE_FILTER = 'filters';
|
||||
const AUTOFILTER_FILTERTYPE_CUSTOMFILTER = 'customFilters';
|
||||
// Supports no more than 2 rules, with an And/Or join criteria
|
||||
// if more than 1 rule is defined
|
||||
const AUTOFILTER_FILTERTYPE_DYNAMICFILTER = 'dynamicFilter';
|
||||
const AUTOFILTER_FILTERTYPE_DYNAMICFILTER = 'dynamicFilter';
|
||||
// Even though the filter rule is constant, the filtered data can vary
|
||||
// e.g. filtered by date = TODAY
|
||||
const AUTOFILTER_FILTERTYPE_TOPTENFILTER = 'top10';
|
||||
const AUTOFILTER_FILTERTYPE_TOPTENFILTER = 'top10';
|
||||
|
||||
/**
|
||||
* Types of autofilter rules
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
private static $_filterTypes = array(
|
||||
private static $filterTypes = array(
|
||||
// Currently we're not handling
|
||||
// colorFilter
|
||||
// extLst
|
||||
@ -61,15 +53,15 @@ class PHPExcel_Worksheet_AutoFilter_Column
|
||||
);
|
||||
|
||||
/* Multiple Rule Connections */
|
||||
const AUTOFILTER_COLUMN_JOIN_AND = 'and';
|
||||
const AUTOFILTER_COLUMN_JOIN_OR = 'or';
|
||||
const AUTOFILTER_COLUMN_JOIN_AND = 'and';
|
||||
const AUTOFILTER_COLUMN_JOIN_OR = 'or';
|
||||
|
||||
/**
|
||||
* Join options for autofilter rules
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
private static $_ruleJoins = array(
|
||||
private static $ruleJoins = array(
|
||||
self::AUTOFILTER_COLUMN_JOIN_AND,
|
||||
self::AUTOFILTER_COLUMN_JOIN_OR,
|
||||
);
|
||||
@ -79,7 +71,7 @@ class PHPExcel_Worksheet_AutoFilter_Column
|
||||
*
|
||||
* @var PHPExcel_Worksheet_AutoFilter
|
||||
*/
|
||||
private $_parent = null;
|
||||
private $parent;
|
||||
|
||||
|
||||
/**
|
||||
@ -87,7 +79,7 @@ class PHPExcel_Worksheet_AutoFilter_Column
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_columnIndex = '';
|
||||
private $columnIndex = '';
|
||||
|
||||
|
||||
/**
|
||||
@ -95,7 +87,7 @@ class PHPExcel_Worksheet_AutoFilter_Column
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_filterType = self::AUTOFILTER_FILTERTYPE_FILTER;
|
||||
private $filterType = self::AUTOFILTER_FILTERTYPE_FILTER;
|
||||
|
||||
|
||||
/**
|
||||
@ -103,7 +95,7 @@ class PHPExcel_Worksheet_AutoFilter_Column
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_join = self::AUTOFILTER_COLUMN_JOIN_OR;
|
||||
private $join = self::AUTOFILTER_COLUMN_JOIN_OR;
|
||||
|
||||
|
||||
/**
|
||||
@ -111,7 +103,7 @@ class PHPExcel_Worksheet_AutoFilter_Column
|
||||
*
|
||||
* @var array of PHPExcel_Worksheet_AutoFilter_Column_Rule
|
||||
*/
|
||||
private $_ruleset = array();
|
||||
private $ruleset = array();
|
||||
|
||||
|
||||
/**
|
||||
@ -119,7 +111,7 @@ class PHPExcel_Worksheet_AutoFilter_Column
|
||||
*
|
||||
* @var array of mixed
|
||||
*/
|
||||
private $_attributes = array();
|
||||
private $attributes = array();
|
||||
|
||||
|
||||
/**
|
||||
@ -130,8 +122,8 @@ class PHPExcel_Worksheet_AutoFilter_Column
|
||||
*/
|
||||
public function __construct($pColumn, PHPExcel_Worksheet_AutoFilter $pParent = null)
|
||||
{
|
||||
$this->_columnIndex = $pColumn;
|
||||
$this->_parent = $pParent;
|
||||
$this->columnIndex = $pColumn;
|
||||
$this->parent = $pParent;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -141,7 +133,7 @@ class PHPExcel_Worksheet_AutoFilter_Column
|
||||
*/
|
||||
public function getColumnIndex()
|
||||
{
|
||||
return $this->_columnIndex;
|
||||
return $this->columnIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -155,11 +147,11 @@ class PHPExcel_Worksheet_AutoFilter_Column
|
||||
{
|
||||
// Uppercase coordinate
|
||||
$pColumn = strtoupper($pColumn);
|
||||
if ($this->_parent !== null) {
|
||||
$this->_parent->testColumnInRange($pColumn);
|
||||
if ($this->parent !== null) {
|
||||
$this->parent->testColumnInRange($pColumn);
|
||||
}
|
||||
|
||||
$this->_columnIndex = $pColumn;
|
||||
$this->columnIndex = $pColumn;
|
||||
|
||||
return $this;
|
||||
}
|
||||
@ -171,7 +163,7 @@ class PHPExcel_Worksheet_AutoFilter_Column
|
||||
*/
|
||||
public function getParent()
|
||||
{
|
||||
return $this->_parent;
|
||||
return $this->parent;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -182,7 +174,7 @@ class PHPExcel_Worksheet_AutoFilter_Column
|
||||
*/
|
||||
public function setParent(PHPExcel_Worksheet_AutoFilter $pParent = null)
|
||||
{
|
||||
$this->_parent = $pParent;
|
||||
$this->parent = $pParent;
|
||||
|
||||
return $this;
|
||||
}
|
||||
@ -194,7 +186,7 @@ class PHPExcel_Worksheet_AutoFilter_Column
|
||||
*/
|
||||
public function getFilterType()
|
||||
{
|
||||
return $this->_filterType;
|
||||
return $this->filterType;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -206,11 +198,11 @@ class PHPExcel_Worksheet_AutoFilter_Column
|
||||
*/
|
||||
public function setFilterType($pFilterType = self::AUTOFILTER_FILTERTYPE_FILTER)
|
||||
{
|
||||
if (!in_array($pFilterType, self::$_filterTypes)) {
|
||||
if (!in_array($pFilterType, self::$filterTypes)) {
|
||||
throw new PHPExcel_Exception('Invalid filter type for column AutoFilter.');
|
||||
}
|
||||
|
||||
$this->_filterType = $pFilterType;
|
||||
$this->filterType = $pFilterType;
|
||||
|
||||
return $this;
|
||||
}
|
||||
@ -222,7 +214,7 @@ class PHPExcel_Worksheet_AutoFilter_Column
|
||||
*/
|
||||
public function getJoin()
|
||||
{
|
||||
return $this->_join;
|
||||
return $this->join;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -236,11 +228,11 @@ class PHPExcel_Worksheet_AutoFilter_Column
|
||||
{
|
||||
// Lowercase And/Or
|
||||
$pJoin = strtolower($pJoin);
|
||||
if (!in_array($pJoin, self::$_ruleJoins)) {
|
||||
if (!in_array($pJoin, self::$ruleJoins)) {
|
||||
throw new PHPExcel_Exception('Invalid rule connection for column AutoFilter.');
|
||||
}
|
||||
|
||||
$this->_join = $pJoin;
|
||||
$this->join = $pJoin;
|
||||
|
||||
return $this;
|
||||
}
|
||||
@ -254,7 +246,7 @@ class PHPExcel_Worksheet_AutoFilter_Column
|
||||
*/
|
||||
public function setAttributes($pAttributes = array())
|
||||
{
|
||||
$this->_attributes = $pAttributes;
|
||||
$this->attributes = $pAttributes;
|
||||
|
||||
return $this;
|
||||
}
|
||||
@ -269,7 +261,7 @@ class PHPExcel_Worksheet_AutoFilter_Column
|
||||
*/
|
||||
public function setAttribute($pName, $pValue)
|
||||
{
|
||||
$this->_attributes[$pName] = $pValue;
|
||||
$this->attributes[$pName] = $pValue;
|
||||
|
||||
return $this;
|
||||
}
|
||||
@ -281,7 +273,7 @@ class PHPExcel_Worksheet_AutoFilter_Column
|
||||
*/
|
||||
public function getAttributes()
|
||||
{
|
||||
return $this->_attributes;
|
||||
return $this->attributes;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -292,8 +284,8 @@ class PHPExcel_Worksheet_AutoFilter_Column
|
||||
*/
|
||||
public function getAttribute($pName)
|
||||
{
|
||||
if (isset($this->_attributes[$pName])) {
|
||||
return $this->_attributes[$pName];
|
||||
if (isset($this->attributes[$pName])) {
|
||||
return $this->attributes[$pName];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@ -306,7 +298,7 @@ class PHPExcel_Worksheet_AutoFilter_Column
|
||||
*/
|
||||
public function getRules()
|
||||
{
|
||||
return $this->_ruleset;
|
||||
return $this->ruleset;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -317,10 +309,10 @@ class PHPExcel_Worksheet_AutoFilter_Column
|
||||
*/
|
||||
public function getRule($pIndex)
|
||||
{
|
||||
if (!isset($this->_ruleset[$pIndex])) {
|
||||
$this->_ruleset[$pIndex] = new PHPExcel_Worksheet_AutoFilter_Column_Rule($this);
|
||||
if (!isset($this->ruleset[$pIndex])) {
|
||||
$this->ruleset[$pIndex] = new PHPExcel_Worksheet_AutoFilter_Column_Rule($this);
|
||||
}
|
||||
return $this->_ruleset[$pIndex];
|
||||
return $this->ruleset[$pIndex];
|
||||
}
|
||||
|
||||
/**
|
||||
@ -330,9 +322,9 @@ class PHPExcel_Worksheet_AutoFilter_Column
|
||||
*/
|
||||
public function createRule()
|
||||
{
|
||||
$this->_ruleset[] = new PHPExcel_Worksheet_AutoFilter_Column_Rule($this);
|
||||
$this->ruleset[] = new PHPExcel_Worksheet_AutoFilter_Column_Rule($this);
|
||||
|
||||
return end($this->_ruleset);
|
||||
return end($this->ruleset);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -345,7 +337,7 @@ class PHPExcel_Worksheet_AutoFilter_Column
|
||||
public function addRule(PHPExcel_Worksheet_AutoFilter_Column_Rule $pRule, $returnRule = true)
|
||||
{
|
||||
$pRule->setParent($this);
|
||||
$this->_ruleset[] = $pRule;
|
||||
$this->ruleset[] = $pRule;
|
||||
|
||||
return ($returnRule) ? $pRule : $this;
|
||||
}
|
||||
@ -359,10 +351,10 @@ class PHPExcel_Worksheet_AutoFilter_Column
|
||||
*/
|
||||
public function deleteRule($pIndex)
|
||||
{
|
||||
if (isset($this->_ruleset[$pIndex])) {
|
||||
unset($this->_ruleset[$pIndex]);
|
||||
if (isset($this->ruleset[$pIndex])) {
|
||||
unset($this->ruleset[$pIndex]);
|
||||
// If we've just deleted down to a single rule, then reset And/Or joining to Or
|
||||
if (count($this->_ruleset) <= 1) {
|
||||
if (count($this->ruleset) <= 1) {
|
||||
$this->setJoin(self::AUTOFILTER_COLUMN_JOIN_OR);
|
||||
}
|
||||
}
|
||||
@ -377,7 +369,7 @@ class PHPExcel_Worksheet_AutoFilter_Column
|
||||
*/
|
||||
public function clearRules()
|
||||
{
|
||||
$this->_ruleset = array();
|
||||
$this->ruleset = array();
|
||||
$this->setJoin(self::AUTOFILTER_COLUMN_JOIN_OR);
|
||||
|
||||
return $this;
|
||||
@ -391,13 +383,13 @@ class PHPExcel_Worksheet_AutoFilter_Column
|
||||
$vars = get_object_vars($this);
|
||||
foreach ($vars as $key => $value) {
|
||||
if (is_object($value)) {
|
||||
if ($key == '_parent') {
|
||||
if ($key == 'parent') {
|
||||
// Detach from autofilter parent
|
||||
$this->$key = null;
|
||||
} else {
|
||||
$this->$key = clone $value;
|
||||
}
|
||||
} elseif ((is_array($value)) && ($key == '_ruleset')) {
|
||||
} elseif ((is_array($value)) && ($key == 'ruleset')) {
|
||||
// The columns array of PHPExcel_Worksheet_AutoFilter objects
|
||||
$this->$key = array();
|
||||
foreach ($value as $k => $v) {
|
||||
|
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* PHPExcel
|
||||
* PHPExcel_Worksheet_AutoFilter_Column_Rule
|
||||
*
|
||||
* Copyright (c) 2006 - 2015 PHPExcel
|
||||
*
|
||||
@ -24,24 +25,15 @@
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* PHPExcel_Worksheet_AutoFilter_Column_Rule
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_Worksheet
|
||||
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
class PHPExcel_Worksheet_AutoFilter_Column_Rule
|
||||
{
|
||||
const AUTOFILTER_RULETYPE_FILTER = 'filter';
|
||||
const AUTOFILTER_RULETYPE_DATEGROUP = 'dateGroupItem';
|
||||
const AUTOFILTER_RULETYPE_CUSTOMFILTER = 'customFilter';
|
||||
const AUTOFILTER_RULETYPE_DYNAMICFILTER = 'dynamicFilter';
|
||||
const AUTOFILTER_RULETYPE_TOPTENFILTER = 'top10Filter';
|
||||
const AUTOFILTER_RULETYPE_DATEGROUP = 'dateGroupItem';
|
||||
const AUTOFILTER_RULETYPE_CUSTOMFILTER = 'customFilter';
|
||||
const AUTOFILTER_RULETYPE_DYNAMICFILTER = 'dynamicFilter';
|
||||
const AUTOFILTER_RULETYPE_TOPTENFILTER = 'top10Filter';
|
||||
|
||||
private static $_ruleTypes = array(
|
||||
private static $ruleTypes = array(
|
||||
// Currently we're not handling
|
||||
// colorFilter
|
||||
// extLst
|
||||
@ -53,14 +45,14 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
|
||||
self::AUTOFILTER_RULETYPE_TOPTENFILTER,
|
||||
);
|
||||
|
||||
const AUTOFILTER_RULETYPE_DATEGROUP_YEAR = 'year';
|
||||
const AUTOFILTER_RULETYPE_DATEGROUP_MONTH = 'month';
|
||||
const AUTOFILTER_RULETYPE_DATEGROUP_DAY = 'day';
|
||||
const AUTOFILTER_RULETYPE_DATEGROUP_HOUR = 'hour';
|
||||
const AUTOFILTER_RULETYPE_DATEGROUP_MINUTE = 'minute';
|
||||
const AUTOFILTER_RULETYPE_DATEGROUP_SECOND = 'second';
|
||||
const AUTOFILTER_RULETYPE_DATEGROUP_YEAR = 'year';
|
||||
const AUTOFILTER_RULETYPE_DATEGROUP_MONTH = 'month';
|
||||
const AUTOFILTER_RULETYPE_DATEGROUP_DAY = 'day';
|
||||
const AUTOFILTER_RULETYPE_DATEGROUP_HOUR = 'hour';
|
||||
const AUTOFILTER_RULETYPE_DATEGROUP_MINUTE = 'minute';
|
||||
const AUTOFILTER_RULETYPE_DATEGROUP_SECOND = 'second';
|
||||
|
||||
private static $_dateTimeGroups = array(
|
||||
private static $dateTimeGroups = array(
|
||||
self::AUTOFILTER_RULETYPE_DATEGROUP_YEAR,
|
||||
self::AUTOFILTER_RULETYPE_DATEGROUP_MONTH,
|
||||
self::AUTOFILTER_RULETYPE_DATEGROUP_DAY,
|
||||
@ -69,54 +61,54 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
|
||||
self::AUTOFILTER_RULETYPE_DATEGROUP_SECOND,
|
||||
);
|
||||
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_YESTERDAY = 'yesterday';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_TODAY = 'today';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_TOMORROW = 'tomorrow';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_YEARTODATE = 'yearToDate';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_THISYEAR = 'thisYear';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_THISQUARTER = 'thisQuarter';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_THISMONTH = 'thisMonth';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_THISWEEK = 'thisWeek';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_LASTYEAR = 'lastYear';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_LASTQUARTER = 'lastQuarter';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_LASTMONTH = 'lastMonth';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_LASTWEEK = 'lastWeek';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_NEXTYEAR = 'nextYear';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_NEXTQUARTER = 'nextQuarter';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_NEXTMONTH = 'nextMonth';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_NEXTWEEK = 'nextWeek';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_MONTH_1 = 'M1';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_JANUARY = self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_1;
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_MONTH_2 = 'M2';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_FEBRUARY = self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_2;
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_MONTH_3 = 'M3';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_MARCH = self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_3;
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_MONTH_4 = 'M4';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_APRIL = self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_4;
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_MONTH_5 = 'M5';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_MAY = self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_5;
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_MONTH_6 = 'M6';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_JUNE = self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_6;
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_MONTH_7 = 'M7';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_JULY = self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_7;
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_MONTH_8 = 'M8';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_AUGUST = self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_8;
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_MONTH_9 = 'M9';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_SEPTEMBER = self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_9;
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_MONTH_10 = 'M10';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_OCTOBER = self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_10;
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_MONTH_11 = 'M11';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_NOVEMBER = self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_11;
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_MONTH_12 = 'M12';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_DECEMBER = self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_12;
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_QUARTER_1 = 'Q1';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_QUARTER_2 = 'Q2';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_QUARTER_3 = 'Q3';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_QUARTER_4 = 'Q4';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_ABOVEAVERAGE = 'aboveAverage';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_BELOWAVERAGE = 'belowAverage';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_YESTERDAY = 'yesterday';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_TODAY = 'today';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_TOMORROW = 'tomorrow';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_YEARTODATE = 'yearToDate';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_THISYEAR = 'thisYear';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_THISQUARTER = 'thisQuarter';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_THISMONTH = 'thisMonth';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_THISWEEK = 'thisWeek';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_LASTYEAR = 'lastYear';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_LASTQUARTER = 'lastQuarter';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_LASTMONTH = 'lastMonth';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_LASTWEEK = 'lastWeek';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_NEXTYEAR = 'nextYear';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_NEXTQUARTER = 'nextQuarter';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_NEXTMONTH = 'nextMonth';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_NEXTWEEK = 'nextWeek';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_MONTH_1 = 'M1';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_JANUARY = self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_1;
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_MONTH_2 = 'M2';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_FEBRUARY = self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_2;
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_MONTH_3 = 'M3';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_MARCH = self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_3;
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_MONTH_4 = 'M4';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_APRIL = self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_4;
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_MONTH_5 = 'M5';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_MAY = self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_5;
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_MONTH_6 = 'M6';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_JUNE = self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_6;
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_MONTH_7 = 'M7';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_JULY = self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_7;
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_MONTH_8 = 'M8';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_AUGUST = self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_8;
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_MONTH_9 = 'M9';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_SEPTEMBER = self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_9;
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_MONTH_10 = 'M10';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_OCTOBER = self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_10;
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_MONTH_11 = 'M11';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_NOVEMBER = self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_11;
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_MONTH_12 = 'M12';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_DECEMBER = self::AUTOFILTER_RULETYPE_DYNAMIC_MONTH_12;
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_QUARTER_1 = 'Q1';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_QUARTER_2 = 'Q2';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_QUARTER_3 = 'Q3';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_QUARTER_4 = 'Q4';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_ABOVEAVERAGE = 'aboveAverage';
|
||||
const AUTOFILTER_RULETYPE_DYNAMIC_BELOWAVERAGE = 'belowAverage';
|
||||
|
||||
private static $_dynamicTypes = array(
|
||||
private static $dynamicTypes = array(
|
||||
self::AUTOFILTER_RULETYPE_DYNAMIC_YESTERDAY,
|
||||
self::AUTOFILTER_RULETYPE_DYNAMIC_TODAY,
|
||||
self::AUTOFILTER_RULETYPE_DYNAMIC_TOMORROW,
|
||||
@ -162,14 +154,14 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
|
||||
* <xsd:enumeration value="greaterThanOrEqual"/>
|
||||
* <xsd:enumeration value="greaterThan"/>
|
||||
*/
|
||||
const AUTOFILTER_COLUMN_RULE_EQUAL = 'equal';
|
||||
const AUTOFILTER_COLUMN_RULE_NOTEQUAL = 'notEqual';
|
||||
const AUTOFILTER_COLUMN_RULE_EQUAL = 'equal';
|
||||
const AUTOFILTER_COLUMN_RULE_NOTEQUAL = 'notEqual';
|
||||
const AUTOFILTER_COLUMN_RULE_GREATERTHAN = 'greaterThan';
|
||||
const AUTOFILTER_COLUMN_RULE_GREATERTHANOREQUAL = 'greaterThanOrEqual';
|
||||
const AUTOFILTER_COLUMN_RULE_LESSTHAN = 'lessThan';
|
||||
const AUTOFILTER_COLUMN_RULE_GREATERTHANOREQUAL = 'greaterThanOrEqual';
|
||||
const AUTOFILTER_COLUMN_RULE_LESSTHAN = 'lessThan';
|
||||
const AUTOFILTER_COLUMN_RULE_LESSTHANOREQUAL = 'lessThanOrEqual';
|
||||
|
||||
private static $_operators = array(
|
||||
private static $operators = array(
|
||||
self::AUTOFILTER_COLUMN_RULE_EQUAL,
|
||||
self::AUTOFILTER_COLUMN_RULE_NOTEQUAL,
|
||||
self::AUTOFILTER_COLUMN_RULE_GREATERTHAN,
|
||||
@ -178,18 +170,18 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
|
||||
self::AUTOFILTER_COLUMN_RULE_LESSTHANOREQUAL,
|
||||
);
|
||||
|
||||
const AUTOFILTER_COLUMN_RULE_TOPTEN_BY_VALUE = 'byValue';
|
||||
const AUTOFILTER_COLUMN_RULE_TOPTEN_PERCENT = 'byPercent';
|
||||
const AUTOFILTER_COLUMN_RULE_TOPTEN_BY_VALUE = 'byValue';
|
||||
const AUTOFILTER_COLUMN_RULE_TOPTEN_PERCENT = 'byPercent';
|
||||
|
||||
private static $_topTenValue = array(
|
||||
private static $topTenValue = array(
|
||||
self::AUTOFILTER_COLUMN_RULE_TOPTEN_BY_VALUE,
|
||||
self::AUTOFILTER_COLUMN_RULE_TOPTEN_PERCENT,
|
||||
);
|
||||
|
||||
const AUTOFILTER_COLUMN_RULE_TOPTEN_TOP = 'top';
|
||||
const AUTOFILTER_COLUMN_RULE_TOPTEN_BOTTOM = 'bottom';
|
||||
const AUTOFILTER_COLUMN_RULE_TOPTEN_TOP = 'top';
|
||||
const AUTOFILTER_COLUMN_RULE_TOPTEN_BOTTOM = 'bottom';
|
||||
|
||||
private static $_topTenType = array(
|
||||
private static $topTenType = array(
|
||||
self::AUTOFILTER_COLUMN_RULE_TOPTEN_TOP,
|
||||
self::AUTOFILTER_COLUMN_RULE_TOPTEN_BOTTOM,
|
||||
);
|
||||
@ -234,7 +226,7 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
|
||||
*
|
||||
* @var PHPExcel_Worksheet_AutoFilter_Column
|
||||
*/
|
||||
private $_parent = null;
|
||||
private $parent = null;
|
||||
|
||||
|
||||
/**
|
||||
@ -242,7 +234,7 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_ruleType = self::AUTOFILTER_RULETYPE_FILTER;
|
||||
private $ruleType = self::AUTOFILTER_RULETYPE_FILTER;
|
||||
|
||||
|
||||
/**
|
||||
@ -250,21 +242,21 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_value = '';
|
||||
private $value = '';
|
||||
|
||||
/**
|
||||
* Autofilter Rule Operator
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_operator = self::AUTOFILTER_COLUMN_RULE_EQUAL;
|
||||
private $operator = self::AUTOFILTER_COLUMN_RULE_EQUAL;
|
||||
|
||||
/**
|
||||
* DateTimeGrouping Group Value
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_grouping = '';
|
||||
private $grouping = '';
|
||||
|
||||
|
||||
/**
|
||||
@ -274,7 +266,7 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
|
||||
*/
|
||||
public function __construct(PHPExcel_Worksheet_AutoFilter_Column $pParent = null)
|
||||
{
|
||||
$this->_parent = $pParent;
|
||||
$this->parent = $pParent;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -284,7 +276,7 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
|
||||
*/
|
||||
public function getRuleType()
|
||||
{
|
||||
return $this->_ruleType;
|
||||
return $this->ruleType;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -296,11 +288,11 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
|
||||
*/
|
||||
public function setRuleType($pRuleType = self::AUTOFILTER_RULETYPE_FILTER)
|
||||
{
|
||||
if (!in_array($pRuleType, self::$_ruleTypes)) {
|
||||
if (!in_array($pRuleType, self::$ruleTypes)) {
|
||||
throw new PHPExcel_Exception('Invalid rule type for column AutoFilter Rule.');
|
||||
}
|
||||
|
||||
$this->_ruleType = $pRuleType;
|
||||
$this->ruleType = $pRuleType;
|
||||
|
||||
return $this;
|
||||
}
|
||||
@ -312,7 +304,7 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
|
||||
*/
|
||||
public function getValue()
|
||||
{
|
||||
return $this->_value;
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -328,21 +320,21 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
|
||||
$grouping = -1;
|
||||
foreach ($pValue as $key => $value) {
|
||||
// Validate array entries
|
||||
if (!in_array($key, self::$_dateTimeGroups)) {
|
||||
if (!in_array($key, self::$dateTimeGroups)) {
|
||||
// Remove any invalid entries from the value array
|
||||
unset($pValue[$key]);
|
||||
} else {
|
||||
// Work out what the dateTime grouping will be
|
||||
$grouping = max($grouping, array_search($key, self::$_dateTimeGroups));
|
||||
$grouping = max($grouping, array_search($key, self::$dateTimeGroups));
|
||||
}
|
||||
}
|
||||
if (count($pValue) == 0) {
|
||||
throw new PHPExcel_Exception('Invalid rule value for column AutoFilter Rule.');
|
||||
}
|
||||
// Set the dateTime grouping that we've anticipated
|
||||
$this->setGrouping(self::$_dateTimeGroups[$grouping]);
|
||||
$this->setGrouping(self::$dateTimeGroups[$grouping]);
|
||||
}
|
||||
$this->_value = $pValue;
|
||||
$this->value = $pValue;
|
||||
|
||||
return $this;
|
||||
}
|
||||
@ -354,7 +346,7 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
|
||||
*/
|
||||
public function getOperator()
|
||||
{
|
||||
return $this->_operator;
|
||||
return $this->operator;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -369,11 +361,11 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
|
||||
if (empty($pOperator)) {
|
||||
$pOperator = self::AUTOFILTER_COLUMN_RULE_EQUAL;
|
||||
}
|
||||
if ((!in_array($pOperator, self::$_operators)) &&
|
||||
(!in_array($pOperator, self::$_topTenValue))) {
|
||||
if ((!in_array($pOperator, self::$operators)) &&
|
||||
(!in_array($pOperator, self::$topTenValue))) {
|
||||
throw new PHPExcel_Exception('Invalid operator for column AutoFilter Rule.');
|
||||
}
|
||||
$this->_operator = $pOperator;
|
||||
$this->operator = $pOperator;
|
||||
|
||||
return $this;
|
||||
}
|
||||
@ -385,7 +377,7 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
|
||||
*/
|
||||
public function getGrouping()
|
||||
{
|
||||
return $this->_grouping;
|
||||
return $this->grouping;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -398,12 +390,12 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
|
||||
public function setGrouping($pGrouping = null)
|
||||
{
|
||||
if (($pGrouping !== null) &&
|
||||
(!in_array($pGrouping, self::$_dateTimeGroups)) &&
|
||||
(!in_array($pGrouping, self::$_dynamicTypes)) &&
|
||||
(!in_array($pGrouping, self::$_topTenType))) {
|
||||
(!in_array($pGrouping, self::$dateTimeGroups)) &&
|
||||
(!in_array($pGrouping, self::$dynamicTypes)) &&
|
||||
(!in_array($pGrouping, self::$topTenType))) {
|
||||
throw new PHPExcel_Exception('Invalid rule type for column AutoFilter Rule.');
|
||||
}
|
||||
$this->_grouping = $pGrouping;
|
||||
$this->grouping = $pGrouping;
|
||||
|
||||
return $this;
|
||||
}
|
||||
@ -438,7 +430,7 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
|
||||
*/
|
||||
public function getParent()
|
||||
{
|
||||
return $this->_parent;
|
||||
return $this->parent;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -449,7 +441,7 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
|
||||
*/
|
||||
public function setParent(PHPExcel_Worksheet_AutoFilter_Column $pParent = null)
|
||||
{
|
||||
$this->_parent = $pParent;
|
||||
$this->parent = $pParent;
|
||||
|
||||
return $this;
|
||||
}
|
||||
@ -462,7 +454,7 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
|
||||
$vars = get_object_vars($this);
|
||||
foreach ($vars as $key => $value) {
|
||||
if (is_object($value)) {
|
||||
if ($key == '_parent') {
|
||||
if ($key == 'parent') {
|
||||
// Detach from autofilter column parent
|
||||
$this->$key = null;
|
||||
} else {
|
||||
|
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* PHPExcel
|
||||
* PHPExcel_Worksheet_BaseDrawing
|
||||
*
|
||||
* Copyright (c) 2006 - 2015 PHPExcel
|
||||
*
|
||||
@ -24,15 +25,6 @@
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* PHPExcel_Worksheet_BaseDrawing
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_Worksheet
|
||||
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
|
||||
{
|
||||
/**
|
||||
@ -40,14 +32,14 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private static $_imageCounter = 0;
|
||||
private static $imageCounter = 0;
|
||||
|
||||
/**
|
||||
* Image index
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private $_imageIndex = 0;
|
||||
private $imageIndex = 0;
|
||||
|
||||
/**
|
||||
* Name
|
||||
@ -145,8 +137,8 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
|
||||
$this->_shadow = new PHPExcel_Worksheet_Drawing_Shadow();
|
||||
|
||||
// Set image index
|
||||
self::$_imageCounter++;
|
||||
$this->_imageIndex = self::$_imageCounter;
|
||||
self::$imageCounter++;
|
||||
$this->imageIndex = self::$imageCounter;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -156,7 +148,7 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
|
||||
*/
|
||||
public function getImageIndex()
|
||||
{
|
||||
return $this->_imageIndex;
|
||||
return $this->imageIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -483,7 +475,19 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
|
||||
*/
|
||||
public function getHashCode()
|
||||
{
|
||||
return md5($this->_name.$this->_description.$this->_worksheet->getHashCode().$this->_coordinates.$this->_offsetX.$this->_offsetY.$this->_width.$this->_height.$this->_rotation.$this->_shadow->getHashCode().__CLASS__);
|
||||
return md5(
|
||||
$this->_name .
|
||||
$this->_description .
|
||||
$this->_worksheet->getHashCode() .
|
||||
$this->_coordinates .
|
||||
$this->_offsetX .
|
||||
$this->_offsetY .
|
||||
$this->_width .
|
||||
$this->_height .
|
||||
$this->_rotation .
|
||||
$this->_shadow->getHashCode() .
|
||||
__CLASS__
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* PHPExcel
|
||||
* PHPExcel_Worksheet_Drawing
|
||||
*
|
||||
* Copyright (c) 2006 - 2015 PHPExcel
|
||||
*
|
||||
@ -24,15 +25,6 @@
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* PHPExcel_Worksheet_Drawing
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_Worksheet_Drawing
|
||||
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
class PHPExcel_Worksheet_Drawing extends PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
|
||||
{
|
||||
/**
|
||||
@ -40,7 +32,7 @@ class PHPExcel_Worksheet_Drawing extends PHPExcel_Worksheet_BaseDrawing implemen
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_path;
|
||||
private $path;
|
||||
|
||||
/**
|
||||
* Create a new PHPExcel_Worksheet_Drawing
|
||||
@ -48,7 +40,7 @@ class PHPExcel_Worksheet_Drawing extends PHPExcel_Worksheet_BaseDrawing implemen
|
||||
public function __construct()
|
||||
{
|
||||
// Initialise values
|
||||
$this->_path = '';
|
||||
$this->path = '';
|
||||
|
||||
// Initialize parent
|
||||
parent::__construct();
|
||||
@ -61,7 +53,7 @@ class PHPExcel_Worksheet_Drawing extends PHPExcel_Worksheet_BaseDrawing implemen
|
||||
*/
|
||||
public function getFilename()
|
||||
{
|
||||
return basename($this->_path);
|
||||
return basename($this->path);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -83,7 +75,7 @@ class PHPExcel_Worksheet_Drawing extends PHPExcel_Worksheet_BaseDrawing implemen
|
||||
*/
|
||||
public function getExtension()
|
||||
{
|
||||
$exploded = explode(".", basename($this->_path));
|
||||
$exploded = explode(".", basename($this->path));
|
||||
return $exploded[count($exploded) - 1];
|
||||
}
|
||||
|
||||
@ -94,7 +86,7 @@ class PHPExcel_Worksheet_Drawing extends PHPExcel_Worksheet_BaseDrawing implemen
|
||||
*/
|
||||
public function getPath()
|
||||
{
|
||||
return $this->_path;
|
||||
return $this->path;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -109,7 +101,7 @@ class PHPExcel_Worksheet_Drawing extends PHPExcel_Worksheet_BaseDrawing implemen
|
||||
{
|
||||
if ($pVerifyFile) {
|
||||
if (file_exists($pValue)) {
|
||||
$this->_path = $pValue;
|
||||
$this->path = $pValue;
|
||||
|
||||
if ($this->_width == 0 && $this->_height == 0) {
|
||||
// Get width/height
|
||||
@ -119,7 +111,7 @@ class PHPExcel_Worksheet_Drawing extends PHPExcel_Worksheet_BaseDrawing implemen
|
||||
throw new PHPExcel_Exception("File $pValue not found!");
|
||||
}
|
||||
} else {
|
||||
$this->_path = $pValue;
|
||||
$this->path = $pValue;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
@ -132,9 +124,9 @@ class PHPExcel_Worksheet_Drawing extends PHPExcel_Worksheet_BaseDrawing implemen
|
||||
public function getHashCode()
|
||||
{
|
||||
return md5(
|
||||
$this->_path
|
||||
. parent::getHashCode()
|
||||
. __CLASS__
|
||||
$this->path .
|
||||
parent::getHashCode() .
|
||||
__CLASS__
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* PHPExcel
|
||||
* PHPExcel_Worksheet_Drawing_Shadow
|
||||
*
|
||||
* Copyright (c) 2006 - 2015 PHPExcel
|
||||
*
|
||||
@ -24,33 +25,24 @@
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* PHPExcel_Worksheet_Drawing_Shadow
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_Worksheet_Drawing
|
||||
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
class PHPExcel_Worksheet_Drawing_Shadow implements PHPExcel_IComparable
|
||||
{
|
||||
/* Shadow alignment */
|
||||
const SHADOW_BOTTOM = 'b';
|
||||
const SHADOW_BOTTOM_LEFT = 'bl';
|
||||
const SHADOW_BOTTOM_RIGHT = 'br';
|
||||
const SHADOW_CENTER = 'ctr';
|
||||
const SHADOW_LEFT = 'l';
|
||||
const SHADOW_TOP = 't';
|
||||
const SHADOW_TOP_LEFT = 'tl';
|
||||
const SHADOW_TOP_RIGHT = 'tr';
|
||||
const SHADOW_BOTTOM = 'b';
|
||||
const SHADOW_BOTTOM_LEFT = 'bl';
|
||||
const SHADOW_BOTTOM_RIGHT = 'br';
|
||||
const SHADOW_CENTER = 'ctr';
|
||||
const SHADOW_LEFT = 'l';
|
||||
const SHADOW_TOP = 't';
|
||||
const SHADOW_TOP_LEFT = 'tl';
|
||||
const SHADOW_TOP_RIGHT = 'tr';
|
||||
|
||||
/**
|
||||
* Visible
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
private $_visible;
|
||||
private $visible;
|
||||
|
||||
/**
|
||||
* Blur radius
|
||||
@ -59,7 +51,7 @@ class PHPExcel_Worksheet_Drawing_Shadow implements PHPExcel_IComparable
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private $_blurRadius;
|
||||
private $blurRadius;
|
||||
|
||||
/**
|
||||
* Shadow distance
|
||||
@ -68,35 +60,35 @@ class PHPExcel_Worksheet_Drawing_Shadow implements PHPExcel_IComparable
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private $_distance;
|
||||
private $distance;
|
||||
|
||||
/**
|
||||
* Shadow direction (in degrees)
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private $_direction;
|
||||
private $direction;
|
||||
|
||||
/**
|
||||
* Shadow alignment
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private $_alignment;
|
||||
private $alignment;
|
||||
|
||||
/**
|
||||
* Color
|
||||
*
|
||||
* @var PHPExcel_Style_Color
|
||||
*/
|
||||
private $_color;
|
||||
private $color;
|
||||
|
||||
/**
|
||||
* Alpha
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private $_alpha;
|
||||
private $alpha;
|
||||
|
||||
/**
|
||||
* Create a new PHPExcel_Worksheet_Drawing_Shadow
|
||||
@ -104,13 +96,13 @@ class PHPExcel_Worksheet_Drawing_Shadow implements PHPExcel_IComparable
|
||||
public function __construct()
|
||||
{
|
||||
// Initialise values
|
||||
$this->_visible = false;
|
||||
$this->_blurRadius = 6;
|
||||
$this->_distance = 2;
|
||||
$this->_direction = 0;
|
||||
$this->_alignment = PHPExcel_Worksheet_Drawing_Shadow::SHADOW_BOTTOM_RIGHT;
|
||||
$this->_color = new PHPExcel_Style_Color(PHPExcel_Style_Color::COLOR_BLACK);
|
||||
$this->_alpha = 50;
|
||||
$this->visible = false;
|
||||
$this->blurRadius = 6;
|
||||
$this->distance = 2;
|
||||
$this->direction = 0;
|
||||
$this->alignment = PHPExcel_Worksheet_Drawing_Shadow::SHADOW_BOTTOM_RIGHT;
|
||||
$this->color = new PHPExcel_Style_Color(PHPExcel_Style_Color::COLOR_BLACK);
|
||||
$this->alpha = 50;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -120,7 +112,7 @@ class PHPExcel_Worksheet_Drawing_Shadow implements PHPExcel_IComparable
|
||||
*/
|
||||
public function getVisible()
|
||||
{
|
||||
return $this->_visible;
|
||||
return $this->visible;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -131,7 +123,7 @@ class PHPExcel_Worksheet_Drawing_Shadow implements PHPExcel_IComparable
|
||||
*/
|
||||
public function setVisible($pValue = false)
|
||||
{
|
||||
$this->_visible = $pValue;
|
||||
$this->visible = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -142,7 +134,7 @@ class PHPExcel_Worksheet_Drawing_Shadow implements PHPExcel_IComparable
|
||||
*/
|
||||
public function getBlurRadius()
|
||||
{
|
||||
return $this->_blurRadius;
|
||||
return $this->blurRadius;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -153,7 +145,7 @@ class PHPExcel_Worksheet_Drawing_Shadow implements PHPExcel_IComparable
|
||||
*/
|
||||
public function setBlurRadius($pValue = 6)
|
||||
{
|
||||
$this->_blurRadius = $pValue;
|
||||
$this->blurRadius = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -164,7 +156,7 @@ class PHPExcel_Worksheet_Drawing_Shadow implements PHPExcel_IComparable
|
||||
*/
|
||||
public function getDistance()
|
||||
{
|
||||
return $this->_distance;
|
||||
return $this->distance;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -175,7 +167,7 @@ class PHPExcel_Worksheet_Drawing_Shadow implements PHPExcel_IComparable
|
||||
*/
|
||||
public function setDistance($pValue = 2)
|
||||
{
|
||||
$this->_distance = $pValue;
|
||||
$this->distance = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -186,7 +178,7 @@ class PHPExcel_Worksheet_Drawing_Shadow implements PHPExcel_IComparable
|
||||
*/
|
||||
public function getDirection()
|
||||
{
|
||||
return $this->_direction;
|
||||
return $this->direction;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -197,7 +189,7 @@ class PHPExcel_Worksheet_Drawing_Shadow implements PHPExcel_IComparable
|
||||
*/
|
||||
public function setDirection($pValue = 0)
|
||||
{
|
||||
$this->_direction = $pValue;
|
||||
$this->direction = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -208,7 +200,7 @@ class PHPExcel_Worksheet_Drawing_Shadow implements PHPExcel_IComparable
|
||||
*/
|
||||
public function getAlignment()
|
||||
{
|
||||
return $this->_alignment;
|
||||
return $this->alignment;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -219,7 +211,7 @@ class PHPExcel_Worksheet_Drawing_Shadow implements PHPExcel_IComparable
|
||||
*/
|
||||
public function setAlignment($pValue = 0)
|
||||
{
|
||||
$this->_alignment = $pValue;
|
||||
$this->alignment = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -230,7 +222,7 @@ class PHPExcel_Worksheet_Drawing_Shadow implements PHPExcel_IComparable
|
||||
*/
|
||||
public function getColor()
|
||||
{
|
||||
return $this->_color;
|
||||
return $this->color;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -242,7 +234,7 @@ class PHPExcel_Worksheet_Drawing_Shadow implements PHPExcel_IComparable
|
||||
*/
|
||||
public function setColor(PHPExcel_Style_Color $pValue = null)
|
||||
{
|
||||
$this->_color = $pValue;
|
||||
$this->color = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -253,7 +245,7 @@ class PHPExcel_Worksheet_Drawing_Shadow implements PHPExcel_IComparable
|
||||
*/
|
||||
public function getAlpha()
|
||||
{
|
||||
return $this->_alpha;
|
||||
return $this->alpha;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -264,7 +256,7 @@ class PHPExcel_Worksheet_Drawing_Shadow implements PHPExcel_IComparable
|
||||
*/
|
||||
public function setAlpha($pValue = 0)
|
||||
{
|
||||
$this->_alpha = $pValue;
|
||||
$this->alpha = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -276,14 +268,14 @@ class PHPExcel_Worksheet_Drawing_Shadow implements PHPExcel_IComparable
|
||||
public function getHashCode()
|
||||
{
|
||||
return md5(
|
||||
($this->_visible ? 't' : 'f')
|
||||
. $this->_blurRadius
|
||||
. $this->_distance
|
||||
. $this->_direction
|
||||
. $this->_alignment
|
||||
. $this->_color->getHashCode()
|
||||
. $this->_alpha
|
||||
. __CLASS__
|
||||
($this->visible ? 't' : 'f') .
|
||||
$this->blurRadius .
|
||||
$this->distance .
|
||||
$this->direction .
|
||||
$this->alignment .
|
||||
$this->color->getHashCode() .
|
||||
$this->alpha .
|
||||
__CLASS__
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPExcel
|
||||
* PHPExcel_Worksheet_HeaderFooter
|
||||
*
|
||||
* Copyright (c) 2006 - 2015 PHPExcel
|
||||
*
|
||||
@ -23,11 +23,6 @@
|
||||
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* PHPExcel_Worksheet_HeaderFooter
|
||||
*
|
||||
* <code>
|
||||
* Header/Footer Formatting Syntax taken from Office Open XML Part 4 - Markup Language Reference, page 1970:
|
||||
@ -89,96 +84,93 @@
|
||||
* &H - code for "shadow style"
|
||||
* </code>
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_Worksheet
|
||||
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
class PHPExcel_Worksheet_HeaderFooter
|
||||
{
|
||||
/* Header/footer image location */
|
||||
const IMAGE_HEADER_LEFT = 'LH';
|
||||
const IMAGE_HEADER_CENTER = 'CH';
|
||||
const IMAGE_HEADER_RIGHT = 'RH';
|
||||
const IMAGE_FOOTER_LEFT = 'LF';
|
||||
const IMAGE_FOOTER_CENTER = 'CF';
|
||||
const IMAGE_FOOTER_RIGHT = 'RF';
|
||||
const IMAGE_HEADER_LEFT = 'LH';
|
||||
const IMAGE_HEADER_CENTER = 'CH';
|
||||
const IMAGE_HEADER_RIGHT = 'RH';
|
||||
const IMAGE_FOOTER_LEFT = 'LF';
|
||||
const IMAGE_FOOTER_CENTER = 'CF';
|
||||
const IMAGE_FOOTER_RIGHT = 'RF';
|
||||
|
||||
/**
|
||||
* OddHeader
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_oddHeader = '';
|
||||
private $oddHeader = '';
|
||||
|
||||
/**
|
||||
* OddFooter
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_oddFooter = '';
|
||||
private $oddFooter = '';
|
||||
|
||||
/**
|
||||
* EvenHeader
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_evenHeader = '';
|
||||
private $evenHeader = '';
|
||||
|
||||
/**
|
||||
* EvenFooter
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_evenFooter = '';
|
||||
private $evenFooter = '';
|
||||
|
||||
/**
|
||||
* FirstHeader
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_firstHeader = '';
|
||||
private $firstHeader = '';
|
||||
|
||||
/**
|
||||
* FirstFooter
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_firstFooter = '';
|
||||
private $firstFooter = '';
|
||||
|
||||
/**
|
||||
* Different header for Odd/Even, defaults to false
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
private $_differentOddEven = false;
|
||||
private $differentOddEven = false;
|
||||
|
||||
/**
|
||||
* Different header for first page, defaults to false
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
private $_differentFirst = false;
|
||||
private $differentFirst = false;
|
||||
|
||||
/**
|
||||
* Scale with document, defaults to true
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
private $_scaleWithDocument = true;
|
||||
private $scaleWithDocument = true;
|
||||
|
||||
/**
|
||||
* Align with margins, defaults to true
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
private $_alignWithMargins = true;
|
||||
private $alignWithMargins = true;
|
||||
|
||||
/**
|
||||
* Header/footer images
|
||||
*
|
||||
* @var PHPExcel_Worksheet_HeaderFooterDrawing[]
|
||||
*/
|
||||
private $_headerFooterImages = array();
|
||||
private $headerFooterImages = array();
|
||||
|
||||
/**
|
||||
* Create a new PHPExcel_Worksheet_HeaderFooter
|
||||
@ -194,7 +186,7 @@ class PHPExcel_Worksheet_HeaderFooter
|
||||
*/
|
||||
public function getOddHeader()
|
||||
{
|
||||
return $this->_oddHeader;
|
||||
return $this->oddHeader;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -205,7 +197,7 @@ class PHPExcel_Worksheet_HeaderFooter
|
||||
*/
|
||||
public function setOddHeader($pValue)
|
||||
{
|
||||
$this->_oddHeader = $pValue;
|
||||
$this->oddHeader = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -216,7 +208,7 @@ class PHPExcel_Worksheet_HeaderFooter
|
||||
*/
|
||||
public function getOddFooter()
|
||||
{
|
||||
return $this->_oddFooter;
|
||||
return $this->oddFooter;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -227,7 +219,7 @@ class PHPExcel_Worksheet_HeaderFooter
|
||||
*/
|
||||
public function setOddFooter($pValue)
|
||||
{
|
||||
$this->_oddFooter = $pValue;
|
||||
$this->oddFooter = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -238,7 +230,7 @@ class PHPExcel_Worksheet_HeaderFooter
|
||||
*/
|
||||
public function getEvenHeader()
|
||||
{
|
||||
return $this->_evenHeader;
|
||||
return $this->evenHeader;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -249,7 +241,7 @@ class PHPExcel_Worksheet_HeaderFooter
|
||||
*/
|
||||
public function setEvenHeader($pValue)
|
||||
{
|
||||
$this->_evenHeader = $pValue;
|
||||
$this->evenHeader = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -260,7 +252,7 @@ class PHPExcel_Worksheet_HeaderFooter
|
||||
*/
|
||||
public function getEvenFooter()
|
||||
{
|
||||
return $this->_evenFooter;
|
||||
return $this->evenFooter;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -271,7 +263,7 @@ class PHPExcel_Worksheet_HeaderFooter
|
||||
*/
|
||||
public function setEvenFooter($pValue)
|
||||
{
|
||||
$this->_evenFooter = $pValue;
|
||||
$this->evenFooter = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -282,7 +274,7 @@ class PHPExcel_Worksheet_HeaderFooter
|
||||
*/
|
||||
public function getFirstHeader()
|
||||
{
|
||||
return $this->_firstHeader;
|
||||
return $this->firstHeader;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -293,7 +285,7 @@ class PHPExcel_Worksheet_HeaderFooter
|
||||
*/
|
||||
public function setFirstHeader($pValue)
|
||||
{
|
||||
$this->_firstHeader = $pValue;
|
||||
$this->firstHeader = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -304,7 +296,7 @@ class PHPExcel_Worksheet_HeaderFooter
|
||||
*/
|
||||
public function getFirstFooter()
|
||||
{
|
||||
return $this->_firstFooter;
|
||||
return $this->firstFooter;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -315,7 +307,7 @@ class PHPExcel_Worksheet_HeaderFooter
|
||||
*/
|
||||
public function setFirstFooter($pValue)
|
||||
{
|
||||
$this->_firstFooter = $pValue;
|
||||
$this->firstFooter = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -326,7 +318,7 @@ class PHPExcel_Worksheet_HeaderFooter
|
||||
*/
|
||||
public function getDifferentOddEven()
|
||||
{
|
||||
return $this->_differentOddEven;
|
||||
return $this->differentOddEven;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -337,7 +329,7 @@ class PHPExcel_Worksheet_HeaderFooter
|
||||
*/
|
||||
public function setDifferentOddEven($pValue = false)
|
||||
{
|
||||
$this->_differentOddEven = $pValue;
|
||||
$this->differentOddEven = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -348,7 +340,7 @@ class PHPExcel_Worksheet_HeaderFooter
|
||||
*/
|
||||
public function getDifferentFirst()
|
||||
{
|
||||
return $this->_differentFirst;
|
||||
return $this->differentFirst;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -359,7 +351,7 @@ class PHPExcel_Worksheet_HeaderFooter
|
||||
*/
|
||||
public function setDifferentFirst($pValue = false)
|
||||
{
|
||||
$this->_differentFirst = $pValue;
|
||||
$this->differentFirst = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -370,7 +362,7 @@ class PHPExcel_Worksheet_HeaderFooter
|
||||
*/
|
||||
public function getScaleWithDocument()
|
||||
{
|
||||
return $this->_scaleWithDocument;
|
||||
return $this->scaleWithDocument;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -381,7 +373,7 @@ class PHPExcel_Worksheet_HeaderFooter
|
||||
*/
|
||||
public function setScaleWithDocument($pValue = true)
|
||||
{
|
||||
$this->_scaleWithDocument = $pValue;
|
||||
$this->scaleWithDocument = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -392,7 +384,7 @@ class PHPExcel_Worksheet_HeaderFooter
|
||||
*/
|
||||
public function getAlignWithMargins()
|
||||
{
|
||||
return $this->_alignWithMargins;
|
||||
return $this->alignWithMargins;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -403,7 +395,7 @@ class PHPExcel_Worksheet_HeaderFooter
|
||||
*/
|
||||
public function setAlignWithMargins($pValue = true)
|
||||
{
|
||||
$this->_alignWithMargins = $pValue;
|
||||
$this->alignWithMargins = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -417,7 +409,7 @@ class PHPExcel_Worksheet_HeaderFooter
|
||||
*/
|
||||
public function addImage(PHPExcel_Worksheet_HeaderFooterDrawing $image = null, $location = self::IMAGE_HEADER_LEFT)
|
||||
{
|
||||
$this->_headerFooterImages[$location] = $image;
|
||||
$this->headerFooterImages[$location] = $image;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -430,8 +422,8 @@ class PHPExcel_Worksheet_HeaderFooter
|
||||
*/
|
||||
public function removeImage($location = self::IMAGE_HEADER_LEFT)
|
||||
{
|
||||
if (isset($this->_headerFooterImages[$location])) {
|
||||
unset($this->_headerFooterImages[$location]);
|
||||
if (isset($this->headerFooterImages[$location])) {
|
||||
unset($this->headerFooterImages[$location]);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
@ -449,7 +441,7 @@ class PHPExcel_Worksheet_HeaderFooter
|
||||
throw new PHPExcel_Exception('Invalid parameter!');
|
||||
}
|
||||
|
||||
$this->_headerFooterImages = $images;
|
||||
$this->headerFooterImages = $images;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -462,27 +454,27 @@ class PHPExcel_Worksheet_HeaderFooter
|
||||
{
|
||||
// Sort array
|
||||
$images = array();
|
||||
if (isset($this->_headerFooterImages[self::IMAGE_HEADER_LEFT])) {
|
||||
$images[self::IMAGE_HEADER_LEFT] = $this->_headerFooterImages[self::IMAGE_HEADER_LEFT];
|
||||
if (isset($this->headerFooterImages[self::IMAGE_HEADER_LEFT])) {
|
||||
$images[self::IMAGE_HEADER_LEFT] = $this->headerFooterImages[self::IMAGE_HEADER_LEFT];
|
||||
}
|
||||
if (isset($this->_headerFooterImages[self::IMAGE_HEADER_CENTER])) {
|
||||
$images[self::IMAGE_HEADER_CENTER] = $this->_headerFooterImages[self::IMAGE_HEADER_CENTER];
|
||||
if (isset($this->headerFooterImages[self::IMAGE_HEADER_CENTER])) {
|
||||
$images[self::IMAGE_HEADER_CENTER] = $this->headerFooterImages[self::IMAGE_HEADER_CENTER];
|
||||
}
|
||||
if (isset($this->_headerFooterImages[self::IMAGE_HEADER_RIGHT])) {
|
||||
$images[self::IMAGE_HEADER_RIGHT] = $this->_headerFooterImages[self::IMAGE_HEADER_RIGHT];
|
||||
if (isset($this->headerFooterImages[self::IMAGE_HEADER_RIGHT])) {
|
||||
$images[self::IMAGE_HEADER_RIGHT] = $this->headerFooterImages[self::IMAGE_HEADER_RIGHT];
|
||||
}
|
||||
if (isset($this->_headerFooterImages[self::IMAGE_FOOTER_LEFT])) {
|
||||
$images[self::IMAGE_FOOTER_LEFT] = $this->_headerFooterImages[self::IMAGE_FOOTER_LEFT];
|
||||
if (isset($this->headerFooterImages[self::IMAGE_FOOTER_LEFT])) {
|
||||
$images[self::IMAGE_FOOTER_LEFT] = $this->headerFooterImages[self::IMAGE_FOOTER_LEFT];
|
||||
}
|
||||
if (isset($this->_headerFooterImages[self::IMAGE_FOOTER_CENTER])) {
|
||||
$images[self::IMAGE_FOOTER_CENTER] = $this->_headerFooterImages[self::IMAGE_FOOTER_CENTER];
|
||||
if (isset($this->headerFooterImages[self::IMAGE_FOOTER_CENTER])) {
|
||||
$images[self::IMAGE_FOOTER_CENTER] = $this->headerFooterImages[self::IMAGE_FOOTER_CENTER];
|
||||
}
|
||||
if (isset($this->_headerFooterImages[self::IMAGE_FOOTER_RIGHT])) {
|
||||
$images[self::IMAGE_FOOTER_RIGHT] = $this->_headerFooterImages[self::IMAGE_FOOTER_RIGHT];
|
||||
if (isset($this->headerFooterImages[self::IMAGE_FOOTER_RIGHT])) {
|
||||
$images[self::IMAGE_FOOTER_RIGHT] = $this->headerFooterImages[self::IMAGE_FOOTER_RIGHT];
|
||||
}
|
||||
$this->_headerFooterImages = $images;
|
||||
$this->headerFooterImages = $images;
|
||||
|
||||
return $this->_headerFooterImages;
|
||||
return $this->headerFooterImages;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* PHPExcel
|
||||
* PHPExcel_Worksheet_HeaderFooterDrawing
|
||||
*
|
||||
* Copyright (c) 2006 - 2015 PHPExcel
|
||||
*
|
||||
@ -24,15 +25,6 @@
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* PHPExcel_Worksheet_HeaderFooterDrawing
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_Worksheet
|
||||
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing implements PHPExcel_IComparable
|
||||
{
|
||||
/**
|
||||
@ -40,49 +32,49 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_path;
|
||||
private $path;
|
||||
|
||||
/**
|
||||
* Name
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_name;
|
||||
protected $name;
|
||||
|
||||
/**
|
||||
* Offset X
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $_offsetX;
|
||||
protected $offsetX;
|
||||
|
||||
/**
|
||||
* Offset Y
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $_offsetY;
|
||||
protected $offsetY;
|
||||
|
||||
/**
|
||||
* Width
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $_width;
|
||||
protected $width;
|
||||
|
||||
/**
|
||||
* Height
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $_height;
|
||||
protected $height;
|
||||
|
||||
/**
|
||||
* Proportional resize
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
protected $_resizeProportional;
|
||||
protected $resizeProportional;
|
||||
|
||||
/**
|
||||
* Create a new PHPExcel_Worksheet_HeaderFooterDrawing
|
||||
@ -90,13 +82,13 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
|
||||
public function __construct()
|
||||
{
|
||||
// Initialise values
|
||||
$this->_path = '';
|
||||
$this->_name = '';
|
||||
$this->_offsetX = 0;
|
||||
$this->_offsetY = 0;
|
||||
$this->_width = 0;
|
||||
$this->_height = 0;
|
||||
$this->_resizeProportional = true;
|
||||
$this->path = '';
|
||||
$this->name = '';
|
||||
$this->offsetX = 0;
|
||||
$this->offsetY = 0;
|
||||
$this->width = 0;
|
||||
$this->height = 0;
|
||||
$this->resizeProportional = true;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -106,7 +98,7 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->_name;
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -117,7 +109,7 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
|
||||
*/
|
||||
public function setName($pValue = '')
|
||||
{
|
||||
$this->_name = $pValue;
|
||||
$this->name = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -128,7 +120,7 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
|
||||
*/
|
||||
public function getOffsetX()
|
||||
{
|
||||
return $this->_offsetX;
|
||||
return $this->offsetX;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -139,7 +131,7 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
|
||||
*/
|
||||
public function setOffsetX($pValue = 0)
|
||||
{
|
||||
$this->_offsetX = $pValue;
|
||||
$this->offsetX = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -150,7 +142,7 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
|
||||
*/
|
||||
public function getOffsetY()
|
||||
{
|
||||
return $this->_offsetY;
|
||||
return $this->offsetY;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -161,7 +153,7 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
|
||||
*/
|
||||
public function setOffsetY($pValue = 0)
|
||||
{
|
||||
$this->_offsetY = $pValue;
|
||||
$this->offsetY = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -172,7 +164,7 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
|
||||
*/
|
||||
public function getWidth()
|
||||
{
|
||||
return $this->_width;
|
||||
return $this->width;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -184,13 +176,13 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
|
||||
public function setWidth($pValue = 0)
|
||||
{
|
||||
// Resize proportional?
|
||||
if ($this->_resizeProportional && $pValue != 0) {
|
||||
$ratio = $this->_width / $this->_height;
|
||||
$this->_height = round($ratio * $pValue);
|
||||
if ($this->resizeProportional && $pValue != 0) {
|
||||
$ratio = $this->width / $this->height;
|
||||
$this->height = round($ratio * $pValue);
|
||||
}
|
||||
|
||||
// Set width
|
||||
$this->_width = $pValue;
|
||||
$this->width = $pValue;
|
||||
|
||||
return $this;
|
||||
}
|
||||
@ -202,7 +194,7 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
|
||||
*/
|
||||
public function getHeight()
|
||||
{
|
||||
return $this->_height;
|
||||
return $this->height;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -214,13 +206,13 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
|
||||
public function setHeight($pValue = 0)
|
||||
{
|
||||
// Resize proportional?
|
||||
if ($this->_resizeProportional && $pValue != 0) {
|
||||
$ratio = $this->_width / $this->_height;
|
||||
$this->_width = round($ratio * $pValue);
|
||||
if ($this->resizeProportional && $pValue != 0) {
|
||||
$ratio = $this->width / $this->height;
|
||||
$this->width = round($ratio * $pValue);
|
||||
}
|
||||
|
||||
// Set height
|
||||
$this->_height = $pValue;
|
||||
$this->height = $pValue;
|
||||
|
||||
return $this;
|
||||
}
|
||||
@ -240,15 +232,15 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
|
||||
*/
|
||||
public function setWidthAndHeight($width = 0, $height = 0)
|
||||
{
|
||||
$xratio = $width / $this->_width;
|
||||
$yratio = $height / $this->_height;
|
||||
if ($this->_resizeProportional && !($width == 0 || $height == 0)) {
|
||||
if (($xratio * $this->_height) < $height) {
|
||||
$this->_height = ceil($xratio * $this->_height);
|
||||
$this->_width = $width;
|
||||
$xratio = $width / $this->width;
|
||||
$yratio = $height / $this->height;
|
||||
if ($this->resizeProportional && !($width == 0 || $height == 0)) {
|
||||
if (($xratio * $this->height) < $height) {
|
||||
$this->height = ceil($xratio * $this->height);
|
||||
$this->width = $width;
|
||||
} else {
|
||||
$this->_width = ceil($yratio * $this->_width);
|
||||
$this->_height = $height;
|
||||
$this->width = ceil($yratio * $this->width);
|
||||
$this->height = $height;
|
||||
}
|
||||
}
|
||||
return $this;
|
||||
@ -261,7 +253,7 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
|
||||
*/
|
||||
public function getResizeProportional()
|
||||
{
|
||||
return $this->_resizeProportional;
|
||||
return $this->resizeProportional;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -272,7 +264,7 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
|
||||
*/
|
||||
public function setResizeProportional($pValue = true)
|
||||
{
|
||||
$this->_resizeProportional = $pValue;
|
||||
$this->resizeProportional = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -283,7 +275,7 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
|
||||
*/
|
||||
public function getFilename()
|
||||
{
|
||||
return basename($this->_path);
|
||||
return basename($this->path);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -293,7 +285,7 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
|
||||
*/
|
||||
public function getExtension()
|
||||
{
|
||||
$parts = explode(".", basename($this->_path));
|
||||
$parts = explode(".", basename($this->path));
|
||||
return end($parts);
|
||||
}
|
||||
|
||||
@ -304,7 +296,7 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
|
||||
*/
|
||||
public function getPath()
|
||||
{
|
||||
return $this->_path;
|
||||
return $this->path;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -319,17 +311,17 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
|
||||
{
|
||||
if ($pVerifyFile) {
|
||||
if (file_exists($pValue)) {
|
||||
$this->_path = $pValue;
|
||||
$this->path = $pValue;
|
||||
|
||||
if ($this->_width == 0 && $this->_height == 0) {
|
||||
if ($this->width == 0 && $this->height == 0) {
|
||||
// Get width/height
|
||||
list($this->_width, $this->_height) = getimagesize($pValue);
|
||||
list($this->width, $this->height) = getimagesize($pValue);
|
||||
}
|
||||
} else {
|
||||
throw new PHPExcel_Exception("File $pValue not found!");
|
||||
}
|
||||
} else {
|
||||
$this->_path = $pValue;
|
||||
$this->path = $pValue;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
@ -342,13 +334,13 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
|
||||
public function getHashCode()
|
||||
{
|
||||
return md5(
|
||||
$this->_path
|
||||
. $this->_name
|
||||
. $this->_offsetX
|
||||
. $this->_offsetY
|
||||
. $this->_width
|
||||
. $this->_height
|
||||
. __CLASS__
|
||||
$this->path .
|
||||
$this->name .
|
||||
$this->offsetX .
|
||||
$this->offsetY .
|
||||
$this->width .
|
||||
$this->height .
|
||||
__CLASS__
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* PHPExcel
|
||||
* PHPExcel_Worksheet_MemoryDrawing
|
||||
*
|
||||
* Copyright (c) 2006 - 2015 PHPExcel
|
||||
*
|
||||
@ -24,56 +25,47 @@
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* PHPExcel_Worksheet_MemoryDrawing
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_Worksheet
|
||||
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
class PHPExcel_Worksheet_MemoryDrawing extends PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
|
||||
{
|
||||
/* Rendering functions */
|
||||
const RENDERING_DEFAULT = 'imagepng';
|
||||
const RENDERING_PNG = 'imagepng';
|
||||
const RENDERING_GIF = 'imagegif';
|
||||
const RENDERING_JPEG = 'imagejpeg';
|
||||
const RENDERING_DEFAULT = 'imagepng';
|
||||
const RENDERING_PNG = 'imagepng';
|
||||
const RENDERING_GIF = 'imagegif';
|
||||
const RENDERING_JPEG = 'imagejpeg';
|
||||
|
||||
/* MIME types */
|
||||
const MIMETYPE_DEFAULT = 'image/png';
|
||||
const MIMETYPE_PNG = 'image/png';
|
||||
const MIMETYPE_GIF = 'image/gif';
|
||||
const MIMETYPE_JPEG = 'image/jpeg';
|
||||
const MIMETYPE_DEFAULT = 'image/png';
|
||||
const MIMETYPE_PNG = 'image/png';
|
||||
const MIMETYPE_GIF = 'image/gif';
|
||||
const MIMETYPE_JPEG = 'image/jpeg';
|
||||
|
||||
/**
|
||||
* Image resource
|
||||
*
|
||||
* @var resource
|
||||
*/
|
||||
private $_imageResource;
|
||||
private $imageResource;
|
||||
|
||||
/**
|
||||
* Rendering function
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_renderingFunction;
|
||||
private $renderingFunction;
|
||||
|
||||
/**
|
||||
* Mime type
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_mimeType;
|
||||
private $mimeType;
|
||||
|
||||
/**
|
||||
* Unique name
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_uniqueName;
|
||||
private $uniqueName;
|
||||
|
||||
/**
|
||||
* Create a new PHPExcel_Worksheet_MemoryDrawing
|
||||
@ -81,10 +73,10 @@ class PHPExcel_Worksheet_MemoryDrawing extends PHPExcel_Worksheet_BaseDrawing im
|
||||
public function __construct()
|
||||
{
|
||||
// Initialise values
|
||||
$this->_imageResource = null;
|
||||
$this->_renderingFunction = self::RENDERING_DEFAULT;
|
||||
$this->_mimeType = self::MIMETYPE_DEFAULT;
|
||||
$this->_uniqueName = md5(rand(0, 9999). time() . rand(0, 9999));
|
||||
$this->imageResource = null;
|
||||
$this->renderingFunction = self::RENDERING_DEFAULT;
|
||||
$this->mimeType = self::MIMETYPE_DEFAULT;
|
||||
$this->uniqueName = md5(rand(0, 9999). time() . rand(0, 9999));
|
||||
|
||||
// Initialize parent
|
||||
parent::__construct();
|
||||
@ -97,7 +89,7 @@ class PHPExcel_Worksheet_MemoryDrawing extends PHPExcel_Worksheet_BaseDrawing im
|
||||
*/
|
||||
public function getImageResource()
|
||||
{
|
||||
return $this->_imageResource;
|
||||
return $this->imageResource;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -108,12 +100,12 @@ class PHPExcel_Worksheet_MemoryDrawing extends PHPExcel_Worksheet_BaseDrawing im
|
||||
*/
|
||||
public function setImageResource($value = null)
|
||||
{
|
||||
$this->_imageResource = $value;
|
||||
$this->imageResource = $value;
|
||||
|
||||
if (!is_null($this->_imageResource)) {
|
||||
if (!is_null($this->imageResource)) {
|
||||
// Get width/height
|
||||
$this->_width = imagesx($this->_imageResource);
|
||||
$this->_height = imagesy($this->_imageResource);
|
||||
$this->_width = imagesx($this->imageResource);
|
||||
$this->_height = imagesy($this->imageResource);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
@ -125,7 +117,7 @@ class PHPExcel_Worksheet_MemoryDrawing extends PHPExcel_Worksheet_BaseDrawing im
|
||||
*/
|
||||
public function getRenderingFunction()
|
||||
{
|
||||
return $this->_renderingFunction;
|
||||
return $this->renderingFunction;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -136,7 +128,7 @@ class PHPExcel_Worksheet_MemoryDrawing extends PHPExcel_Worksheet_BaseDrawing im
|
||||
*/
|
||||
public function setRenderingFunction($value = PHPExcel_Worksheet_MemoryDrawing::RENDERING_DEFAULT)
|
||||
{
|
||||
$this->_renderingFunction = $value;
|
||||
$this->renderingFunction = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -147,7 +139,7 @@ class PHPExcel_Worksheet_MemoryDrawing extends PHPExcel_Worksheet_BaseDrawing im
|
||||
*/
|
||||
public function getMimeType()
|
||||
{
|
||||
return $this->_mimeType;
|
||||
return $this->mimeType;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -158,7 +150,7 @@ class PHPExcel_Worksheet_MemoryDrawing extends PHPExcel_Worksheet_BaseDrawing im
|
||||
*/
|
||||
public function setMimeType($value = PHPExcel_Worksheet_MemoryDrawing::MIMETYPE_DEFAULT)
|
||||
{
|
||||
$this->_mimeType = $value;
|
||||
$this->mimeType = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -169,11 +161,11 @@ class PHPExcel_Worksheet_MemoryDrawing extends PHPExcel_Worksheet_BaseDrawing im
|
||||
*/
|
||||
public function getIndexedFilename()
|
||||
{
|
||||
$extension = strtolower($this->getMimeType());
|
||||
$extension = explode('/', $extension);
|
||||
$extension = $extension[1];
|
||||
$extension = strtolower($this->getMimeType());
|
||||
$extension = explode('/', $extension);
|
||||
$extension = $extension[1];
|
||||
|
||||
return $this->_uniqueName . $this->getImageIndex() . '.' . $extension;
|
||||
return $this->uniqueName . $this->getImageIndex() . '.' . $extension;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -184,11 +176,11 @@ class PHPExcel_Worksheet_MemoryDrawing extends PHPExcel_Worksheet_BaseDrawing im
|
||||
public function getHashCode()
|
||||
{
|
||||
return md5(
|
||||
$this->_renderingFunction
|
||||
. $this->_mimeType
|
||||
. $this->_uniqueName
|
||||
. parent::getHashCode()
|
||||
. __CLASS__
|
||||
$this->renderingFunction .
|
||||
$this->mimeType .
|
||||
$this->uniqueName .
|
||||
parent::getHashCode() .
|
||||
__CLASS__
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -189,14 +189,14 @@ class PHPExcel_Worksheet_PageSetup
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private $_paperSize = PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER;
|
||||
private $paperSize = PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER;
|
||||
|
||||
/**
|
||||
* Orientation
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_orientation = PHPExcel_Worksheet_PageSetup::ORIENTATION_DEFAULT;
|
||||
private $orientation = PHPExcel_Worksheet_PageSetup::ORIENTATION_DEFAULT;
|
||||
|
||||
/**
|
||||
* Scale (Print Scale)
|
||||
@ -206,7 +206,7 @@ class PHPExcel_Worksheet_PageSetup
|
||||
*
|
||||
* @var int?
|
||||
*/
|
||||
private $_scale = 100;
|
||||
private $scale = 100;
|
||||
|
||||
/**
|
||||
* Fit To Page
|
||||
@ -214,7 +214,7 @@ class PHPExcel_Worksheet_PageSetup
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
private $_fitToPage = false;
|
||||
private $fitToPage = false;
|
||||
|
||||
/**
|
||||
* Fit To Height
|
||||
@ -222,7 +222,7 @@ class PHPExcel_Worksheet_PageSetup
|
||||
*
|
||||
* @var int?
|
||||
*/
|
||||
private $_fitToHeight = 1;
|
||||
private $fitToHeight = 1;
|
||||
|
||||
/**
|
||||
* Fit To Width
|
||||
@ -230,49 +230,49 @@ class PHPExcel_Worksheet_PageSetup
|
||||
*
|
||||
* @var int?
|
||||
*/
|
||||
private $_fitToWidth = 1;
|
||||
private $fitToWidth = 1;
|
||||
|
||||
/**
|
||||
* Columns to repeat at left
|
||||
*
|
||||
* @var array Containing start column and end column, empty array if option unset
|
||||
*/
|
||||
private $_columnsToRepeatAtLeft = array('', '');
|
||||
private $columnsToRepeatAtLeft = array('', '');
|
||||
|
||||
/**
|
||||
* Rows to repeat at top
|
||||
*
|
||||
* @var array Containing start row number and end row number, empty array if option unset
|
||||
*/
|
||||
private $_rowsToRepeatAtTop = array(0, 0);
|
||||
private $rowsToRepeatAtTop = array(0, 0);
|
||||
|
||||
/**
|
||||
* Center page horizontally
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
private $_horizontalCentered = false;
|
||||
private $horizontalCentered = false;
|
||||
|
||||
/**
|
||||
* Center page vertically
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
private $_verticalCentered = false;
|
||||
private $verticalCentered = false;
|
||||
|
||||
/**
|
||||
* Print area
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_printArea = null;
|
||||
private $printArea = null;
|
||||
|
||||
/**
|
||||
* First page number
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private $_firstPageNumber = null;
|
||||
private $firstPageNumber = null;
|
||||
|
||||
/**
|
||||
* Create a new PHPExcel_Worksheet_PageSetup
|
||||
@ -288,7 +288,7 @@ class PHPExcel_Worksheet_PageSetup
|
||||
*/
|
||||
public function getPaperSize()
|
||||
{
|
||||
return $this->_paperSize;
|
||||
return $this->paperSize;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -299,7 +299,7 @@ class PHPExcel_Worksheet_PageSetup
|
||||
*/
|
||||
public function setPaperSize($pValue = PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER)
|
||||
{
|
||||
$this->_paperSize = $pValue;
|
||||
$this->paperSize = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -310,7 +310,7 @@ class PHPExcel_Worksheet_PageSetup
|
||||
*/
|
||||
public function getOrientation()
|
||||
{
|
||||
return $this->_orientation;
|
||||
return $this->orientation;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -321,7 +321,7 @@ class PHPExcel_Worksheet_PageSetup
|
||||
*/
|
||||
public function setOrientation($pValue = PHPExcel_Worksheet_PageSetup::ORIENTATION_DEFAULT)
|
||||
{
|
||||
$this->_orientation = $pValue;
|
||||
$this->orientation = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -332,7 +332,7 @@ class PHPExcel_Worksheet_PageSetup
|
||||
*/
|
||||
public function getScale()
|
||||
{
|
||||
return $this->_scale;
|
||||
return $this->scale;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -351,9 +351,9 @@ class PHPExcel_Worksheet_PageSetup
|
||||
// Microsoft Office Excel 2007 only allows setting a scale between 10 and 400 via the user interface,
|
||||
// but it is apparently still able to handle any scale >= 0, where 0 results in 100
|
||||
if (($pValue >= 0) || is_null($pValue)) {
|
||||
$this->_scale = $pValue;
|
||||
$this->scale = $pValue;
|
||||
if ($pUpdate) {
|
||||
$this->_fitToPage = false;
|
||||
$this->fitToPage = false;
|
||||
}
|
||||
} else {
|
||||
throw new PHPExcel_Exception("Scale must not be negative");
|
||||
@ -368,7 +368,7 @@ class PHPExcel_Worksheet_PageSetup
|
||||
*/
|
||||
public function getFitToPage()
|
||||
{
|
||||
return $this->_fitToPage;
|
||||
return $this->fitToPage;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -379,7 +379,7 @@ class PHPExcel_Worksheet_PageSetup
|
||||
*/
|
||||
public function setFitToPage($pValue = true)
|
||||
{
|
||||
$this->_fitToPage = $pValue;
|
||||
$this->fitToPage = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -390,7 +390,7 @@ class PHPExcel_Worksheet_PageSetup
|
||||
*/
|
||||
public function getFitToHeight()
|
||||
{
|
||||
return $this->_fitToHeight;
|
||||
return $this->fitToHeight;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -402,9 +402,9 @@ class PHPExcel_Worksheet_PageSetup
|
||||
*/
|
||||
public function setFitToHeight($pValue = 1, $pUpdate = true)
|
||||
{
|
||||
$this->_fitToHeight = $pValue;
|
||||
$this->fitToHeight = $pValue;
|
||||
if ($pUpdate) {
|
||||
$this->_fitToPage = true;
|
||||
$this->fitToPage = true;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
@ -416,7 +416,7 @@ class PHPExcel_Worksheet_PageSetup
|
||||
*/
|
||||
public function getFitToWidth()
|
||||
{
|
||||
return $this->_fitToWidth;
|
||||
return $this->fitToWidth;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -428,9 +428,9 @@ class PHPExcel_Worksheet_PageSetup
|
||||
*/
|
||||
public function setFitToWidth($pValue = 1, $pUpdate = true)
|
||||
{
|
||||
$this->_fitToWidth = $pValue;
|
||||
$this->fitToWidth = $pValue;
|
||||
if ($pUpdate) {
|
||||
$this->_fitToPage = true;
|
||||
$this->fitToPage = true;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
@ -442,8 +442,8 @@ class PHPExcel_Worksheet_PageSetup
|
||||
*/
|
||||
public function isColumnsToRepeatAtLeftSet()
|
||||
{
|
||||
if (is_array($this->_columnsToRepeatAtLeft)) {
|
||||
if ($this->_columnsToRepeatAtLeft[0] != '' && $this->_columnsToRepeatAtLeft[1] != '') {
|
||||
if (is_array($this->columnsToRepeatAtLeft)) {
|
||||
if ($this->columnsToRepeatAtLeft[0] != '' && $this->columnsToRepeatAtLeft[1] != '') {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -458,7 +458,7 @@ class PHPExcel_Worksheet_PageSetup
|
||||
*/
|
||||
public function getColumnsToRepeatAtLeft()
|
||||
{
|
||||
return $this->_columnsToRepeatAtLeft;
|
||||
return $this->columnsToRepeatAtLeft;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -470,7 +470,7 @@ class PHPExcel_Worksheet_PageSetup
|
||||
public function setColumnsToRepeatAtLeft($pValue = null)
|
||||
{
|
||||
if (is_array($pValue)) {
|
||||
$this->_columnsToRepeatAtLeft = $pValue;
|
||||
$this->columnsToRepeatAtLeft = $pValue;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
@ -484,7 +484,7 @@ class PHPExcel_Worksheet_PageSetup
|
||||
*/
|
||||
public function setColumnsToRepeatAtLeftByStartAndEnd($pStart = 'A', $pEnd = 'A')
|
||||
{
|
||||
$this->_columnsToRepeatAtLeft = array($pStart, $pEnd);
|
||||
$this->columnsToRepeatAtLeft = array($pStart, $pEnd);
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -495,8 +495,8 @@ class PHPExcel_Worksheet_PageSetup
|
||||
*/
|
||||
public function isRowsToRepeatAtTopSet()
|
||||
{
|
||||
if (is_array($this->_rowsToRepeatAtTop)) {
|
||||
if ($this->_rowsToRepeatAtTop[0] != 0 && $this->_rowsToRepeatAtTop[1] != 0) {
|
||||
if (is_array($this->rowsToRepeatAtTop)) {
|
||||
if ($this->rowsToRepeatAtTop[0] != 0 && $this->rowsToRepeatAtTop[1] != 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -511,7 +511,7 @@ class PHPExcel_Worksheet_PageSetup
|
||||
*/
|
||||
public function getRowsToRepeatAtTop()
|
||||
{
|
||||
return $this->_rowsToRepeatAtTop;
|
||||
return $this->rowsToRepeatAtTop;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -523,7 +523,7 @@ class PHPExcel_Worksheet_PageSetup
|
||||
public function setRowsToRepeatAtTop($pValue = null)
|
||||
{
|
||||
if (is_array($pValue)) {
|
||||
$this->_rowsToRepeatAtTop = $pValue;
|
||||
$this->rowsToRepeatAtTop = $pValue;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
@ -537,7 +537,7 @@ class PHPExcel_Worksheet_PageSetup
|
||||
*/
|
||||
public function setRowsToRepeatAtTopByStartAndEnd($pStart = 1, $pEnd = 1)
|
||||
{
|
||||
$this->_rowsToRepeatAtTop = array($pStart, $pEnd);
|
||||
$this->rowsToRepeatAtTop = array($pStart, $pEnd);
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -548,7 +548,7 @@ class PHPExcel_Worksheet_PageSetup
|
||||
*/
|
||||
public function getHorizontalCentered()
|
||||
{
|
||||
return $this->_horizontalCentered;
|
||||
return $this->horizontalCentered;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -559,7 +559,7 @@ class PHPExcel_Worksheet_PageSetup
|
||||
*/
|
||||
public function setHorizontalCentered($value = false)
|
||||
{
|
||||
$this->_horizontalCentered = $value;
|
||||
$this->horizontalCentered = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -570,7 +570,7 @@ class PHPExcel_Worksheet_PageSetup
|
||||
*/
|
||||
public function getVerticalCentered()
|
||||
{
|
||||
return $this->_verticalCentered;
|
||||
return $this->verticalCentered;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -581,7 +581,7 @@ class PHPExcel_Worksheet_PageSetup
|
||||
*/
|
||||
public function setVerticalCentered($value = false)
|
||||
{
|
||||
$this->_verticalCentered = $value;
|
||||
$this->verticalCentered = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -598,9 +598,9 @@ class PHPExcel_Worksheet_PageSetup
|
||||
public function getPrintArea($index = 0)
|
||||
{
|
||||
if ($index == 0) {
|
||||
return $this->_printArea;
|
||||
return $this->printArea;
|
||||
}
|
||||
$printAreas = explode(',', $this->_printArea);
|
||||
$printAreas = explode(',', $this->printArea);
|
||||
if (isset($printAreas[$index-1])) {
|
||||
return $printAreas[$index-1];
|
||||
}
|
||||
@ -619,9 +619,9 @@ class PHPExcel_Worksheet_PageSetup
|
||||
public function isPrintAreaSet($index = 0)
|
||||
{
|
||||
if ($index == 0) {
|
||||
return !is_null($this->_printArea);
|
||||
return !is_null($this->printArea);
|
||||
}
|
||||
$printAreas = explode(',', $this->_printArea);
|
||||
$printAreas = explode(',', $this->printArea);
|
||||
return isset($printAreas[$index-1]);
|
||||
}
|
||||
|
||||
@ -637,12 +637,12 @@ class PHPExcel_Worksheet_PageSetup
|
||||
public function clearPrintArea($index = 0)
|
||||
{
|
||||
if ($index == 0) {
|
||||
$this->_printArea = null;
|
||||
$this->printArea = null;
|
||||
} else {
|
||||
$printAreas = explode(',', $this->_printArea);
|
||||
$printAreas = explode(',', $this->printArea);
|
||||
if (isset($printAreas[$index-1])) {
|
||||
unset($printAreas[$index-1]);
|
||||
$this->_printArea = implode(',', $printAreas);
|
||||
$this->printArea = implode(',', $printAreas);
|
||||
}
|
||||
}
|
||||
|
||||
@ -682,9 +682,9 @@ class PHPExcel_Worksheet_PageSetup
|
||||
|
||||
if ($method == self::SETPRINTRANGE_OVERWRITE) {
|
||||
if ($index == 0) {
|
||||
$this->_printArea = $value;
|
||||
$this->printArea = $value;
|
||||
} else {
|
||||
$printAreas = explode(',', $this->_printArea);
|
||||
$printAreas = explode(',', $this->printArea);
|
||||
if ($index < 0) {
|
||||
$index = count($printAreas) - abs($index) + 1;
|
||||
}
|
||||
@ -692,13 +692,13 @@ class PHPExcel_Worksheet_PageSetup
|
||||
throw new PHPExcel_Exception('Invalid index for setting print range.');
|
||||
}
|
||||
$printAreas[$index-1] = $value;
|
||||
$this->_printArea = implode(',', $printAreas);
|
||||
$this->printArea = implode(',', $printAreas);
|
||||
}
|
||||
} elseif ($method == self::SETPRINTRANGE_INSERT) {
|
||||
if ($index == 0) {
|
||||
$this->_printArea .= ($this->_printArea == '') ? $value : ','.$value;
|
||||
$this->printArea .= ($this->printArea == '') ? $value : ','.$value;
|
||||
} else {
|
||||
$printAreas = explode(',', $this->_printArea);
|
||||
$printAreas = explode(',', $this->printArea);
|
||||
if ($index < 0) {
|
||||
$index = abs($index) - 1;
|
||||
}
|
||||
@ -706,7 +706,7 @@ class PHPExcel_Worksheet_PageSetup
|
||||
throw new PHPExcel_Exception('Invalid index for setting print range.');
|
||||
}
|
||||
$printAreas = array_merge(array_slice($printAreas, 0, $index), array($value), array_slice($printAreas, $index));
|
||||
$this->_printArea = implode(',', $printAreas);
|
||||
$this->printArea = implode(',', $printAreas);
|
||||
}
|
||||
} else {
|
||||
throw new PHPExcel_Exception('Invalid method for setting print range.');
|
||||
@ -758,7 +758,11 @@ class PHPExcel_Worksheet_PageSetup
|
||||
*/
|
||||
public function setPrintAreaByColumnAndRow($column1, $row1, $column2, $row2, $index = 0, $method = self::SETPRINTRANGE_OVERWRITE)
|
||||
{
|
||||
return $this->setPrintArea(PHPExcel_Cell::stringFromColumnIndex($column1) . $row1 . ':' . PHPExcel_Cell::stringFromColumnIndex($column2) . $row2, $index, $method);
|
||||
return $this->setPrintArea(
|
||||
PHPExcel_Cell::stringFromColumnIndex($column1) . $row1 . ':' . PHPExcel_Cell::stringFromColumnIndex($column2) . $row2,
|
||||
$index,
|
||||
$method
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -779,7 +783,11 @@ class PHPExcel_Worksheet_PageSetup
|
||||
*/
|
||||
public function addPrintAreaByColumnAndRow($column1, $row1, $column2, $row2, $index = -1)
|
||||
{
|
||||
return $this->setPrintArea(PHPExcel_Cell::stringFromColumnIndex($column1) . $row1 . ':' . PHPExcel_Cell::stringFromColumnIndex($column2) . $row2, $index, self::SETPRINTRANGE_INSERT);
|
||||
return $this->setPrintArea(
|
||||
PHPExcel_Cell::stringFromColumnIndex($column1) . $row1 . ':' . PHPExcel_Cell::stringFromColumnIndex($column2) . $row2,
|
||||
$index,
|
||||
self::SETPRINTRANGE_INSERT
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -789,7 +797,7 @@ class PHPExcel_Worksheet_PageSetup
|
||||
*/
|
||||
public function getFirstPageNumber()
|
||||
{
|
||||
return $this->_firstPageNumber;
|
||||
return $this->firstPageNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -800,7 +808,7 @@ class PHPExcel_Worksheet_PageSetup
|
||||
*/
|
||||
public function setFirstPageNumber($value = null)
|
||||
{
|
||||
$this->_firstPageNumber = $value;
|
||||
$this->firstPageNumber = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,7 @@ abstract class PHPExcel_Writer_Abstract implements PHPExcel_Writer_IWriter
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
protected $_includeCharts = false;
|
||||
protected $includeCharts = false;
|
||||
|
||||
/**
|
||||
* Pre-calculate formulas
|
||||
@ -67,7 +67,7 @@ abstract class PHPExcel_Writer_Abstract implements PHPExcel_Writer_IWriter
|
||||
*/
|
||||
public function getIncludeCharts()
|
||||
{
|
||||
return $this->_includeCharts;
|
||||
return $this->includeCharts;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -80,7 +80,7 @@ abstract class PHPExcel_Writer_Abstract implements PHPExcel_Writer_IWriter
|
||||
*/
|
||||
public function setIncludeCharts($pValue = false)
|
||||
{
|
||||
$this->_includeCharts = (boolean) $pValue;
|
||||
$this->includeCharts = (boolean) $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -236,7 +236,7 @@ class PHPExcel_Writer_Excel2007 extends PHPExcel_Writer_Abstract implements PHPE
|
||||
}
|
||||
|
||||
// Add [Content_Types].xml to ZIP file
|
||||
$objZip->addFromString('[Content_Types].xml', $this->getWriterPart('ContentTypes')->writeContentTypes($this->_spreadSheet, $this->_includeCharts));
|
||||
$objZip->addFromString('[Content_Types].xml', $this->getWriterPart('ContentTypes')->writeContentTypes($this->_spreadSheet, $this->includeCharts));
|
||||
|
||||
//if hasMacros, add the vbaProject.bin file, Certificate file(if exists)
|
||||
if ($this->_spreadSheet->hasMacros()) {
|
||||
@ -292,8 +292,8 @@ class PHPExcel_Writer_Excel2007 extends PHPExcel_Writer_Abstract implements PHPE
|
||||
$chartCount = 0;
|
||||
// Add worksheets
|
||||
for ($i = 0; $i < $this->_spreadSheet->getSheetCount(); ++$i) {
|
||||
$objZip->addFromString('xl/worksheets/sheet' . ($i + 1) . '.xml', $this->getWriterPart('Worksheet')->writeWorksheet($this->_spreadSheet->getSheet($i), $this->_stringTable, $this->_includeCharts));
|
||||
if ($this->_includeCharts) {
|
||||
$objZip->addFromString('xl/worksheets/sheet' . ($i + 1) . '.xml', $this->getWriterPart('Worksheet')->writeWorksheet($this->_spreadSheet->getSheet($i), $this->_stringTable, $this->includeCharts));
|
||||
if ($this->includeCharts) {
|
||||
$charts = $this->_spreadSheet->getSheet($i)->getChartCollection();
|
||||
if (count($charts) > 0) {
|
||||
foreach ($charts as $chart) {
|
||||
@ -308,21 +308,21 @@ class PHPExcel_Writer_Excel2007 extends PHPExcel_Writer_Abstract implements PHPE
|
||||
// Add worksheet relationships (drawings, ...)
|
||||
for ($i = 0; $i < $this->_spreadSheet->getSheetCount(); ++$i) {
|
||||
// Add relationships
|
||||
$objZip->addFromString('xl/worksheets/_rels/sheet' . ($i + 1) . '.xml.rels', $this->getWriterPart('Rels')->writeWorksheetRelationships($this->_spreadSheet->getSheet($i), ($i + 1), $this->_includeCharts));
|
||||
$objZip->addFromString('xl/worksheets/_rels/sheet' . ($i + 1) . '.xml.rels', $this->getWriterPart('Rels')->writeWorksheetRelationships($this->_spreadSheet->getSheet($i), ($i + 1), $this->includeCharts));
|
||||
|
||||
$drawings = $this->_spreadSheet->getSheet($i)->getDrawingCollection();
|
||||
$drawingCount = count($drawings);
|
||||
if ($this->_includeCharts) {
|
||||
if ($this->includeCharts) {
|
||||
$chartCount = $this->_spreadSheet->getSheet($i)->getChartCount();
|
||||
}
|
||||
|
||||
// Add drawing and image relationship parts
|
||||
if (($drawingCount > 0) || ($chartCount > 0)) {
|
||||
// Drawing relationships
|
||||
$objZip->addFromString('xl/drawings/_rels/drawing' . ($i + 1) . '.xml.rels', $this->getWriterPart('Rels')->writeDrawingRelationships($this->_spreadSheet->getSheet($i), $chartRef1, $this->_includeCharts));
|
||||
$objZip->addFromString('xl/drawings/_rels/drawing' . ($i + 1) . '.xml.rels', $this->getWriterPart('Rels')->writeDrawingRelationships($this->_spreadSheet->getSheet($i), $chartRef1, $this->includeCharts));
|
||||
|
||||
// Drawings
|
||||
$objZip->addFromString('xl/drawings/drawing' . ($i + 1) . '.xml', $this->getWriterPart('Drawing')->writeDrawings($this->_spreadSheet->getSheet($i), $chartRef2, $this->_includeCharts));
|
||||
$objZip->addFromString('xl/drawings/drawing' . ($i + 1) . '.xml', $this->getWriterPart('Drawing')->writeDrawings($this->_spreadSheet->getSheet($i), $chartRef2, $this->includeCharts));
|
||||
}
|
||||
|
||||
// Add comment relationship parts
|
||||
|
@ -32,98 +32,98 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
*
|
||||
* @var PHPExcel
|
||||
*/
|
||||
protected $_phpExcel;
|
||||
protected $phpExcel;
|
||||
|
||||
/**
|
||||
* Sheet index to write
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private $_sheetIndex = 0;
|
||||
private $sheetIndex = 0;
|
||||
|
||||
/**
|
||||
* Images root
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_imagesRoot = '.';
|
||||
private $imagesRoot = '.';
|
||||
|
||||
/**
|
||||
* embed images, or link to images
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
private $_embedImages = false;
|
||||
private $embedImages = false;
|
||||
|
||||
/**
|
||||
* Use inline CSS?
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
private $_useInlineCss = false;
|
||||
private $useInlineCss = false;
|
||||
|
||||
/**
|
||||
* Array of CSS styles
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $_cssStyles = null;
|
||||
private $cssStyles;
|
||||
|
||||
/**
|
||||
* Array of column widths in points
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $_columnWidths = null;
|
||||
private $columnWidths;
|
||||
|
||||
/**
|
||||
* Default font
|
||||
*
|
||||
* @var PHPExcel_Style_Font
|
||||
*/
|
||||
private $_defaultFont;
|
||||
private $defaultFont;
|
||||
|
||||
/**
|
||||
* Flag whether spans have been calculated
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
private $_spansAreCalculated = false;
|
||||
private $spansAreCalculated = false;
|
||||
|
||||
/**
|
||||
* Excel cells that should not be written as HTML cells
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $_isSpannedCell = array();
|
||||
private $isSpannedCell = array();
|
||||
|
||||
/**
|
||||
* Excel cells that are upper-left corner in a cell merge
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $_isBaseCell = array();
|
||||
private $isBaseCell = array();
|
||||
|
||||
/**
|
||||
* Excel rows that should not be written as HTML rows
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $_isSpannedRow = array();
|
||||
private $isSpannedRow = array();
|
||||
|
||||
/**
|
||||
* Is the current writer creating PDF?
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
protected $_isPdf = false;
|
||||
protected $isPdf = false;
|
||||
|
||||
/**
|
||||
* Generate the Navigation block
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
private $_generateSheetNavigationBlock = true;
|
||||
private $generateSheetNavigationBlock = true;
|
||||
|
||||
/**
|
||||
* Create a new PHPExcel_Writer_HTML
|
||||
@ -132,8 +132,8 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
*/
|
||||
public function __construct(PHPExcel $phpExcel)
|
||||
{
|
||||
$this->_phpExcel = $phpExcel;
|
||||
$this->_defaultFont = $this->_phpExcel->getDefaultStyle()->getFont();
|
||||
$this->phpExcel = $phpExcel;
|
||||
$this->defaultFont = $this->phpExcel->getDefaultStyle()->getFont();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -145,15 +145,15 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
public function save($pFilename = null)
|
||||
{
|
||||
// garbage collect
|
||||
$this->_phpExcel->garbageCollect();
|
||||
$this->phpExcel->garbageCollect();
|
||||
|
||||
$saveDebugLog = PHPExcel_Calculation::getInstance($this->_phpExcel)->getDebugLog()->getWriteDebugLog();
|
||||
PHPExcel_Calculation::getInstance($this->_phpExcel)->getDebugLog()->setWriteDebugLog(false);
|
||||
$saveDebugLog = PHPExcel_Calculation::getInstance($this->phpExcel)->getDebugLog()->getWriteDebugLog();
|
||||
PHPExcel_Calculation::getInstance($this->phpExcel)->getDebugLog()->setWriteDebugLog(false);
|
||||
$saveArrayReturnType = PHPExcel_Calculation::getArrayReturnType();
|
||||
PHPExcel_Calculation::setArrayReturnType(PHPExcel_Calculation::RETURN_ARRAY_AS_VALUE);
|
||||
|
||||
// Build CSS
|
||||
$this->buildCSS(!$this->_useInlineCss);
|
||||
$this->buildCSS(!$this->useInlineCss);
|
||||
|
||||
// Open file
|
||||
$fileHandle = fopen($pFilename, 'wb+');
|
||||
@ -162,10 +162,10 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
}
|
||||
|
||||
// Write headers
|
||||
fwrite($fileHandle, $this->generateHTMLHeader(!$this->_useInlineCss));
|
||||
fwrite($fileHandle, $this->generateHTMLHeader(!$this->useInlineCss));
|
||||
|
||||
// Write navigation (tabs)
|
||||
if ((!$this->_isPdf) && ($this->_generateSheetNavigationBlock)) {
|
||||
if ((!$this->isPdf) && ($this->generateSheetNavigationBlock)) {
|
||||
fwrite($fileHandle, $this->generateNavigation());
|
||||
}
|
||||
|
||||
@ -179,7 +179,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
fclose($fileHandle);
|
||||
|
||||
PHPExcel_Calculation::setArrayReturnType($saveArrayReturnType);
|
||||
PHPExcel_Calculation::getInstance($this->_phpExcel)->getDebugLog()->setWriteDebugLog($saveDebugLog);
|
||||
PHPExcel_Calculation::getInstance($this->phpExcel)->getDebugLog()->setWriteDebugLog($saveDebugLog);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -188,7 +188,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
* @param string $vAlign Vertical alignment
|
||||
* @return string
|
||||
*/
|
||||
private function _mapVAlign($vAlign)
|
||||
private function mapVAlign($vAlign)
|
||||
{
|
||||
switch ($vAlign) {
|
||||
case PHPExcel_Style_Alignment::VERTICAL_BOTTOM:
|
||||
@ -209,7 +209,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
* @param string $hAlign Horizontal alignment
|
||||
* @return string|false
|
||||
*/
|
||||
private function _mapHAlign($hAlign)
|
||||
private function mapHAlign($hAlign)
|
||||
{
|
||||
switch ($hAlign) {
|
||||
case PHPExcel_Style_Alignment::HORIZONTAL_GENERAL:
|
||||
@ -234,7 +234,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
* @param int $borderStyle Sheet index
|
||||
* @return string
|
||||
*/
|
||||
private function _mapBorderStyle($borderStyle)
|
||||
private function mapBorderStyle($borderStyle)
|
||||
{
|
||||
switch ($borderStyle) {
|
||||
case PHPExcel_Style_Border::BORDER_NONE:
|
||||
@ -278,7 +278,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
*/
|
||||
public function getSheetIndex()
|
||||
{
|
||||
return $this->_sheetIndex;
|
||||
return $this->sheetIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -289,7 +289,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
*/
|
||||
public function setSheetIndex($pValue = 0)
|
||||
{
|
||||
$this->_sheetIndex = $pValue;
|
||||
$this->sheetIndex = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -300,7 +300,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
*/
|
||||
public function getGenerateSheetNavigationBlock()
|
||||
{
|
||||
return $this->_generateSheetNavigationBlock;
|
||||
return $this->generateSheetNavigationBlock;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -311,7 +311,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
*/
|
||||
public function setGenerateSheetNavigationBlock($pValue = true)
|
||||
{
|
||||
$this->_generateSheetNavigationBlock = (bool) $pValue;
|
||||
$this->generateSheetNavigationBlock = (bool) $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -320,7 +320,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
*/
|
||||
public function writeAllSheets()
|
||||
{
|
||||
$this->_sheetIndex = null;
|
||||
$this->sheetIndex = null;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -334,12 +334,12 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
public function generateHTMLHeader($pIncludeStyles = false)
|
||||
{
|
||||
// PHPExcel object known?
|
||||
if (is_null($this->_phpExcel)) {
|
||||
if (is_null($this->phpExcel)) {
|
||||
throw new PHPExcel_Writer_Exception('Internal PHPExcel object not set to an instance of an object.');
|
||||
}
|
||||
|
||||
// Construct HTML
|
||||
$properties = $this->_phpExcel->getProperties();
|
||||
$properties = $this->phpExcel->getProperties();
|
||||
$html = '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">' . PHP_EOL;
|
||||
$html .= '<!-- Generated by PHPExcel - http://www.phpexcel.net -->' . PHP_EOL;
|
||||
$html .= '<html>' . PHP_EOL;
|
||||
@ -393,21 +393,21 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
public function generateSheetData()
|
||||
{
|
||||
// PHPExcel object known?
|
||||
if (is_null($this->_phpExcel)) {
|
||||
if (is_null($this->phpExcel)) {
|
||||
throw new PHPExcel_Writer_Exception('Internal PHPExcel object not set to an instance of an object.');
|
||||
}
|
||||
|
||||
// Ensure that Spans have been calculated?
|
||||
if (!$this->_spansAreCalculated) {
|
||||
$this->_calculateSpans();
|
||||
if (!$this->spansAreCalculated) {
|
||||
$this->calculateSpans();
|
||||
}
|
||||
|
||||
// Fetch sheets
|
||||
$sheets = array();
|
||||
if (is_null($this->_sheetIndex)) {
|
||||
$sheets = $this->_phpExcel->getAllSheets();
|
||||
if (is_null($this->sheetIndex)) {
|
||||
$sheets = $this->phpExcel->getAllSheets();
|
||||
} else {
|
||||
$sheets[] = $this->_phpExcel->getSheet($this->_sheetIndex);
|
||||
$sheets[] = $this->phpExcel->getSheet($this->sheetIndex);
|
||||
}
|
||||
|
||||
// Construct HTML
|
||||
@ -417,7 +417,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
$sheetId = 0;
|
||||
foreach ($sheets as $sheet) {
|
||||
// Write table header
|
||||
$html .= $this->_generateTableHeader($sheet);
|
||||
$html .= $this->generateTableHeader($sheet);
|
||||
|
||||
// Get worksheet dimension
|
||||
$dimension = explode(':', $sheet->calculateWorksheetDimension());
|
||||
@ -460,7 +460,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
}
|
||||
|
||||
// Write row if there are HTML table cells in it
|
||||
if (!isset($this->_isSpannedRow[$sheet->getParent()->getIndex($sheet)][$row])) {
|
||||
if (!isset($this->isSpannedRow[$sheet->getParent()->getIndex($sheet)][$row])) {
|
||||
// Start a new rowData
|
||||
$rowData = array();
|
||||
// Loop through columns
|
||||
@ -473,7 +473,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
$rowData[$column] = '';
|
||||
}
|
||||
}
|
||||
$html .= $this->_generateRow($sheet, $rowData, $row - 1, $cellType);
|
||||
$html .= $this->generateRow($sheet, $rowData, $row - 1, $cellType);
|
||||
}
|
||||
|
||||
// </thead> ?
|
||||
@ -481,17 +481,17 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
$html .= ' </thead>' . PHP_EOL;
|
||||
}
|
||||
}
|
||||
$html .= $this->_extendRowsForChartsAndImages($sheet, $row);
|
||||
$html .= $this->extendRowsForChartsAndImages($sheet, $row);
|
||||
|
||||
// Close table body.
|
||||
$html .= ' </tbody>' . PHP_EOL;
|
||||
|
||||
// Write table footer
|
||||
$html .= $this->_generateTableFooter();
|
||||
$html .= $this->generateTableFooter();
|
||||
|
||||
// Writing PDF?
|
||||
if ($this->_isPdf) {
|
||||
if (is_null($this->_sheetIndex) && $sheetId + 1 < $this->_phpExcel->getSheetCount()) {
|
||||
if ($this->isPdf) {
|
||||
if (is_null($this->sheetIndex) && $sheetId + 1 < $this->phpExcel->getSheetCount()) {
|
||||
$html .= '<div style="page-break-before:always" />';
|
||||
}
|
||||
}
|
||||
@ -512,16 +512,16 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
public function generateNavigation()
|
||||
{
|
||||
// PHPExcel object known?
|
||||
if (is_null($this->_phpExcel)) {
|
||||
if (is_null($this->phpExcel)) {
|
||||
throw new PHPExcel_Writer_Exception('Internal PHPExcel object not set to an instance of an object.');
|
||||
}
|
||||
|
||||
// Fetch sheets
|
||||
$sheets = array();
|
||||
if (is_null($this->_sheetIndex)) {
|
||||
$sheets = $this->_phpExcel->getAllSheets();
|
||||
if (is_null($this->sheetIndex)) {
|
||||
$sheets = $this->phpExcel->getAllSheets();
|
||||
} else {
|
||||
$sheets[] = $this->_phpExcel->getSheet($this->_sheetIndex);
|
||||
$sheets[] = $this->phpExcel->getSheet($this->sheetIndex);
|
||||
}
|
||||
|
||||
// Construct HTML
|
||||
@ -545,11 +545,11 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
return $html;
|
||||
}
|
||||
|
||||
private function _extendRowsForChartsAndImages(PHPExcel_Worksheet $pSheet, $row)
|
||||
private function extendRowsForChartsAndImages(PHPExcel_Worksheet $pSheet, $row)
|
||||
{
|
||||
$rowMax = $row;
|
||||
$colMax = 'A';
|
||||
if ($this->_includeCharts) {
|
||||
if ($this->includeCharts) {
|
||||
foreach ($pSheet->getChartCollection() as $chart) {
|
||||
if ($chart instanceof PHPExcel_Chart) {
|
||||
$chartCoordinates = $chart->getTopLeftPosition();
|
||||
@ -583,9 +583,9 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
$html .= '<tr>';
|
||||
for ($col = 'A'; $col != $colMax; ++$col) {
|
||||
$html .= '<td>';
|
||||
$html .= $this->_writeImageInCell($pSheet, $col.$row);
|
||||
if ($this->_includeCharts) {
|
||||
$html .= $this->_writeChartInCell($pSheet, $col.$row);
|
||||
$html .= $this->writeImageInCell($pSheet, $col.$row);
|
||||
if ($this->includeCharts) {
|
||||
$html .= $this->writeChartInCell($pSheet, $col.$row);
|
||||
}
|
||||
$html .= '</td>';
|
||||
}
|
||||
@ -604,7 +604,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
* @return string
|
||||
* @throws PHPExcel_Writer_Exception
|
||||
*/
|
||||
private function _writeImageInCell(PHPExcel_Worksheet $pSheet, $coordinates)
|
||||
private function writeImageInCell(PHPExcel_Worksheet $pSheet, $coordinates)
|
||||
{
|
||||
// Construct HTML
|
||||
$html = '';
|
||||
@ -632,7 +632,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
$filename = htmlspecialchars($filename);
|
||||
|
||||
$html .= PHP_EOL;
|
||||
if ((!$this->_embedImages) || ($this->_isPdf)) {
|
||||
if ((!$this->embedImages) || ($this->isPdf)) {
|
||||
$imageData = $filename;
|
||||
} else {
|
||||
$imageDetails = getimagesize($filename);
|
||||
@ -669,7 +669,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
* @return string
|
||||
* @throws PHPExcel_Writer_Exception
|
||||
*/
|
||||
private function _writeChartInCell(PHPExcel_Worksheet $pSheet, $coordinates)
|
||||
private function writeChartInCell(PHPExcel_Worksheet $pSheet, $coordinates)
|
||||
{
|
||||
// Construct HTML
|
||||
$html = '';
|
||||
@ -718,7 +718,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
public function generateStyles($generateSurroundingHTML = true)
|
||||
{
|
||||
// PHPExcel object known?
|
||||
if (is_null($this->_phpExcel)) {
|
||||
if (is_null($this->phpExcel)) {
|
||||
throw new PHPExcel_Writer_Exception('Internal PHPExcel object not set to an instance of an object.');
|
||||
}
|
||||
|
||||
@ -731,13 +731,13 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
// Start styles
|
||||
if ($generateSurroundingHTML) {
|
||||
$html .= ' <style type="text/css">' . PHP_EOL;
|
||||
$html .= ' html { ' . $this->_assembleCSS($css['html']) . ' }' . PHP_EOL;
|
||||
$html .= ' html { ' . $this->assembleCSS($css['html']) . ' }' . PHP_EOL;
|
||||
}
|
||||
|
||||
// Write all other styles
|
||||
foreach ($css as $styleName => $styleDefinition) {
|
||||
if ($styleName != 'html') {
|
||||
$html .= ' ' . $styleName . ' { ' . $this->_assembleCSS($styleDefinition) . ' }' . PHP_EOL;
|
||||
$html .= ' ' . $styleName . ' { ' . $this->assembleCSS($styleDefinition) . ' }' . PHP_EOL;
|
||||
}
|
||||
}
|
||||
|
||||
@ -760,18 +760,18 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
public function buildCSS($generateSurroundingHTML = true)
|
||||
{
|
||||
// PHPExcel object known?
|
||||
if (is_null($this->_phpExcel)) {
|
||||
if (is_null($this->phpExcel)) {
|
||||
throw new PHPExcel_Writer_Exception('Internal PHPExcel object not set to an instance of an object.');
|
||||
}
|
||||
|
||||
// Cached?
|
||||
if (!is_null($this->_cssStyles)) {
|
||||
return $this->_cssStyles;
|
||||
if (!is_null($this->cssStyles)) {
|
||||
return $this->cssStyles;
|
||||
}
|
||||
|
||||
// Ensure that spans have been calculated
|
||||
if (!$this->_spansAreCalculated) {
|
||||
$this->_calculateSpans();
|
||||
if (!$this->spansAreCalculated) {
|
||||
$this->calculateSpans();
|
||||
}
|
||||
|
||||
// Construct CSS
|
||||
@ -788,7 +788,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
|
||||
// table { }
|
||||
$css['table']['border-collapse'] = 'collapse';
|
||||
if (!$this->_isPdf) {
|
||||
if (!$this->isPdf) {
|
||||
$css['table']['page-break-after'] = 'always';
|
||||
}
|
||||
|
||||
@ -815,17 +815,17 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
$css['.s']['text-align'] = 'left'; // STRING
|
||||
|
||||
// Calculate cell style hashes
|
||||
foreach ($this->_phpExcel->getCellXfCollection() as $index => $style) {
|
||||
$css['td.style' . $index] = $this->_createCSSStyle($style);
|
||||
$css['th.style' . $index] = $this->_createCSSStyle($style);
|
||||
foreach ($this->phpExcel->getCellXfCollection() as $index => $style) {
|
||||
$css['td.style' . $index] = $this->createCSSStyle($style);
|
||||
$css['th.style' . $index] = $this->createCSSStyle($style);
|
||||
}
|
||||
|
||||
// Fetch sheets
|
||||
$sheets = array();
|
||||
if (is_null($this->_sheetIndex)) {
|
||||
$sheets = $this->_phpExcel->getAllSheets();
|
||||
if (is_null($this->sheetIndex)) {
|
||||
$sheets = $this->phpExcel->getAllSheets();
|
||||
} else {
|
||||
$sheets[] = $this->_phpExcel->getSheet($this->_sheetIndex);
|
||||
$sheets[] = $this->phpExcel->getSheet($this->sheetIndex);
|
||||
}
|
||||
|
||||
// Build styles per sheet
|
||||
@ -841,16 +841,16 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
$highestColumnIndex = PHPExcel_Cell::columnIndexFromString($sheet->getHighestColumn()) - 1;
|
||||
$column = -1;
|
||||
while ($column++ < $highestColumnIndex) {
|
||||
$this->_columnWidths[$sheetIndex][$column] = 42; // approximation
|
||||
$this->columnWidths[$sheetIndex][$column] = 42; // approximation
|
||||
$css['table.sheet' . $sheetIndex . ' col.col' . $column]['width'] = '42pt';
|
||||
}
|
||||
|
||||
// col elements, loop through columnDimensions and set width
|
||||
foreach ($sheet->getColumnDimensions() as $columnDimension) {
|
||||
if (($width = PHPExcel_Shared_Drawing::cellDimensionToPixels($columnDimension->getWidth(), $this->_defaultFont)) >= 0) {
|
||||
if (($width = PHPExcel_Shared_Drawing::cellDimensionToPixels($columnDimension->getWidth(), $this->defaultFont)) >= 0) {
|
||||
$width = PHPExcel_Shared_Drawing::pixelsToPoints($width);
|
||||
$column = PHPExcel_Cell::columnIndexFromString($columnDimension->getColumnIndex()) - 1;
|
||||
$this->_columnWidths[$sheetIndex][$column] = $width;
|
||||
$this->columnWidths[$sheetIndex][$column] = $width;
|
||||
$css['table.sheet' . $sheetIndex . ' col.col' . $column]['width'] = $width . 'pt';
|
||||
|
||||
if ($columnDimension->getVisible() === false) {
|
||||
@ -867,7 +867,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
$css['table.sheet' . $sheetIndex . ' tr'] = array();
|
||||
|
||||
if ($rowDimension->getRowHeight() == -1) {
|
||||
$pt_height = PHPExcel_Shared_Font::getDefaultRowHeightByFont($this->_phpExcel->getDefaultStyle()->getFont());
|
||||
$pt_height = PHPExcel_Shared_Font::getDefaultRowHeightByFont($this->phpExcel->getDefaultStyle()->getFont());
|
||||
} else {
|
||||
$pt_height = $rowDimension->getRowHeight();
|
||||
}
|
||||
@ -885,7 +885,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
$css['table.sheet' . $sheetIndex . ' tr.row' . $row] = array();
|
||||
|
||||
if ($rowDimension->getRowHeight() == -1) {
|
||||
$pt_height = PHPExcel_Shared_Font::getDefaultRowHeightByFont($this->_phpExcel->getDefaultStyle()->getFont());
|
||||
$pt_height = PHPExcel_Shared_Font::getDefaultRowHeightByFont($this->phpExcel->getDefaultStyle()->getFont());
|
||||
} else {
|
||||
$pt_height = $rowDimension->getRowHeight();
|
||||
}
|
||||
@ -898,8 +898,8 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
}
|
||||
|
||||
// Cache
|
||||
if (is_null($this->_cssStyles)) {
|
||||
$this->_cssStyles = $css;
|
||||
if (is_null($this->cssStyles)) {
|
||||
$this->cssStyles = $css;
|
||||
}
|
||||
|
||||
// Return
|
||||
@ -912,17 +912,17 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
* @param PHPExcel_Style $pStyle PHPExcel_Style
|
||||
* @return array
|
||||
*/
|
||||
private function _createCSSStyle(PHPExcel_Style $pStyle)
|
||||
private function createCSSStyle(PHPExcel_Style $pStyle)
|
||||
{
|
||||
// Construct CSS
|
||||
$css = '';
|
||||
|
||||
// Create CSS
|
||||
$css = array_merge(
|
||||
$this->_createCSSStyleAlignment($pStyle->getAlignment()),
|
||||
$this->_createCSSStyleBorders($pStyle->getBorders()),
|
||||
$this->_createCSSStyleFont($pStyle->getFont()),
|
||||
$this->_createCSSStyleFill($pStyle->getFill())
|
||||
$this->createCSSStyleAlignment($pStyle->getAlignment()),
|
||||
$this->createCSSStyleBorders($pStyle->getBorders()),
|
||||
$this->createCSSStyleFont($pStyle->getFont()),
|
||||
$this->createCSSStyleFill($pStyle->getFill())
|
||||
);
|
||||
|
||||
// Return
|
||||
@ -935,14 +935,14 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
* @param PHPExcel_Style_Alignment $pStyle PHPExcel_Style_Alignment
|
||||
* @return array
|
||||
*/
|
||||
private function _createCSSStyleAlignment(PHPExcel_Style_Alignment $pStyle)
|
||||
private function createCSSStyleAlignment(PHPExcel_Style_Alignment $pStyle)
|
||||
{
|
||||
// Construct CSS
|
||||
$css = array();
|
||||
|
||||
// Create CSS
|
||||
$css['vertical-align'] = $this->_mapVAlign($pStyle->getVertical());
|
||||
if ($textAlign = $this->_mapHAlign($pStyle->getHorizontal())) {
|
||||
$css['vertical-align'] = $this->mapVAlign($pStyle->getVertical());
|
||||
if ($textAlign = $this->mapHAlign($pStyle->getHorizontal())) {
|
||||
$css['text-align'] = $textAlign;
|
||||
if (in_array($textAlign, array('left', 'right'))) {
|
||||
$css['padding-'.$textAlign] = (string)((int)$pStyle->getIndent() * 9).'px';
|
||||
@ -958,7 +958,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
* @param PHPExcel_Style_Font $pStyle PHPExcel_Style_Font
|
||||
* @return array
|
||||
*/
|
||||
private function _createCSSStyleFont(PHPExcel_Style_Font $pStyle)
|
||||
private function createCSSStyleFont(PHPExcel_Style_Font $pStyle)
|
||||
{
|
||||
// Construct CSS
|
||||
$css = array();
|
||||
@ -991,16 +991,16 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
* @param PHPExcel_Style_Borders $pStyle PHPExcel_Style_Borders
|
||||
* @return array
|
||||
*/
|
||||
private function _createCSSStyleBorders(PHPExcel_Style_Borders $pStyle)
|
||||
private function createCSSStyleBorders(PHPExcel_Style_Borders $pStyle)
|
||||
{
|
||||
// Construct CSS
|
||||
$css = array();
|
||||
|
||||
// Create CSS
|
||||
$css['border-bottom'] = $this->_createCSSStyleBorder($pStyle->getBottom());
|
||||
$css['border-top'] = $this->_createCSSStyleBorder($pStyle->getTop());
|
||||
$css['border-left'] = $this->_createCSSStyleBorder($pStyle->getLeft());
|
||||
$css['border-right'] = $this->_createCSSStyleBorder($pStyle->getRight());
|
||||
$css['border-bottom'] = $this->createCSSStyleBorder($pStyle->getBottom());
|
||||
$css['border-top'] = $this->createCSSStyleBorder($pStyle->getTop());
|
||||
$css['border-left'] = $this->createCSSStyleBorder($pStyle->getLeft());
|
||||
$css['border-right'] = $this->createCSSStyleBorder($pStyle->getRight());
|
||||
|
||||
return $css;
|
||||
}
|
||||
@ -1011,12 +1011,12 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
* @param PHPExcel_Style_Border $pStyle PHPExcel_Style_Border
|
||||
* @return string
|
||||
*/
|
||||
private function _createCSSStyleBorder(PHPExcel_Style_Border $pStyle)
|
||||
private function createCSSStyleBorder(PHPExcel_Style_Border $pStyle)
|
||||
{
|
||||
// Create CSS
|
||||
// $css = $this->_mapBorderStyle($pStyle->getBorderStyle()) . ' #' . $pStyle->getColor()->getRGB();
|
||||
// $css = $this->mapBorderStyle($pStyle->getBorderStyle()) . ' #' . $pStyle->getColor()->getRGB();
|
||||
// Create CSS - add !important to non-none border styles for merged cells
|
||||
$borderStyle = $this->_mapBorderStyle($pStyle->getBorderStyle());
|
||||
$borderStyle = $this->mapBorderStyle($pStyle->getBorderStyle());
|
||||
$css = $borderStyle . ' #' . $pStyle->getColor()->getRGB() . (($borderStyle == 'none') ? '' : ' !important');
|
||||
|
||||
return $css;
|
||||
@ -1028,7 +1028,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
* @param PHPExcel_Style_Fill $pStyle PHPExcel_Style_Fill
|
||||
* @return array
|
||||
*/
|
||||
private function _createCSSStyleFill(PHPExcel_Style_Fill $pStyle)
|
||||
private function createCSSStyleFill(PHPExcel_Style_Fill $pStyle)
|
||||
{
|
||||
// Construct HTML
|
||||
$css = array();
|
||||
@ -1061,22 +1061,22 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
* @return string
|
||||
* @throws PHPExcel_Writer_Exception
|
||||
*/
|
||||
private function _generateTableHeader($pSheet)
|
||||
private function generateTableHeader($pSheet)
|
||||
{
|
||||
$sheetIndex = $pSheet->getParent()->getIndex($pSheet);
|
||||
|
||||
// Construct HTML
|
||||
$html = '';
|
||||
$html .= $this->_setMargins($pSheet);
|
||||
$html .= $this->setMargins($pSheet);
|
||||
|
||||
if (!$this->_useInlineCss) {
|
||||
if (!$this->useInlineCss) {
|
||||
$gridlines = $pSheet->getShowGridlines() ? ' gridlines' : '';
|
||||
$html .= ' <table border="0" cellpadding="0" cellspacing="0" id="sheet' . $sheetIndex . '" class="sheet' . $sheetIndex . $gridlines . '">' . PHP_EOL;
|
||||
} else {
|
||||
$style = isset($this->_cssStyles['table']) ?
|
||||
$this->_assembleCSS($this->_cssStyles['table']) : '';
|
||||
$style = isset($this->cssStyles['table']) ?
|
||||
$this->assembleCSS($this->cssStyles['table']) : '';
|
||||
|
||||
if ($this->_isPdf && $pSheet->getShowGridlines()) {
|
||||
if ($this->isPdf && $pSheet->getShowGridlines()) {
|
||||
$html .= ' <table border="1" cellpadding="1" id="sheet' . $sheetIndex . '" cellspacing="1" style="' . $style . '">' . PHP_EOL;
|
||||
} else {
|
||||
$html .= ' <table border="0" cellpadding="1" id="sheet' . $sheetIndex . '" cellspacing="0" style="' . $style . '">' . PHP_EOL;
|
||||
@ -1087,12 +1087,12 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
$highestColumnIndex = PHPExcel_Cell::columnIndexFromString($pSheet->getHighestColumn()) - 1;
|
||||
$i = -1;
|
||||
while ($i++ < $highestColumnIndex) {
|
||||
if (!$this->_isPdf) {
|
||||
if (!$this->_useInlineCss) {
|
||||
if (!$this->isPdf) {
|
||||
if (!$this->useInlineCss) {
|
||||
$html .= ' <col class="col' . $i . '">' . PHP_EOL;
|
||||
} else {
|
||||
$style = isset($this->_cssStyles['table.sheet' . $sheetIndex . ' col.col' . $i]) ?
|
||||
$this->_assembleCSS($this->_cssStyles['table.sheet' . $sheetIndex . ' col.col' . $i]) : '';
|
||||
$style = isset($this->cssStyles['table.sheet' . $sheetIndex . ' col.col' . $i]) ?
|
||||
$this->assembleCSS($this->cssStyles['table.sheet' . $sheetIndex . ' col.col' . $i]) : '';
|
||||
$html .= ' <col style="' . $style . '">' . PHP_EOL;
|
||||
}
|
||||
}
|
||||
@ -1106,7 +1106,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
*
|
||||
* @throws PHPExcel_Writer_Exception
|
||||
*/
|
||||
private function _generateTableFooter()
|
||||
private function generateTableFooter()
|
||||
{
|
||||
$html = ' </table>' . PHP_EOL;
|
||||
|
||||
@ -1122,7 +1122,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
* @return string
|
||||
* @throws PHPExcel_Writer_Exception
|
||||
*/
|
||||
private function _generateRow(PHPExcel_Worksheet $pSheet, $pValues = null, $pRow = 0, $cellType = 'td')
|
||||
private function generateRow(PHPExcel_Worksheet $pSheet, $pValues = null, $pRow = 0, $cellType = 'td')
|
||||
{
|
||||
if (is_array($pValues)) {
|
||||
// Construct HTML
|
||||
@ -1132,28 +1132,28 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
$sheetIndex = $pSheet->getParent()->getIndex($pSheet);
|
||||
|
||||
// DomPDF and breaks
|
||||
if ($this->_isPdf && count($pSheet->getBreaks()) > 0) {
|
||||
if ($this->isPdf && count($pSheet->getBreaks()) > 0) {
|
||||
$breaks = $pSheet->getBreaks();
|
||||
|
||||
// check if a break is needed before this row
|
||||
if (isset($breaks['A' . $pRow])) {
|
||||
// close table: </table>
|
||||
$html .= $this->_generateTableFooter();
|
||||
$html .= $this->generateTableFooter();
|
||||
|
||||
// insert page break
|
||||
$html .= '<div style="page-break-before:always" />';
|
||||
|
||||
// open table again: <table> + <col> etc.
|
||||
$html .= $this->_generateTableHeader($pSheet);
|
||||
$html .= $this->generateTableHeader($pSheet);
|
||||
}
|
||||
}
|
||||
|
||||
// Write row start
|
||||
if (!$this->_useInlineCss) {
|
||||
if (!$this->useInlineCss) {
|
||||
$html .= ' <tr class="row' . $pRow . '">' . PHP_EOL;
|
||||
} else {
|
||||
$style = isset($this->_cssStyles['table.sheet' . $sheetIndex . ' tr.row' . $pRow])
|
||||
? $this->_assembleCSS($this->_cssStyles['table.sheet' . $sheetIndex . ' tr.row' . $pRow]) : '';
|
||||
$style = isset($this->cssStyles['table.sheet' . $sheetIndex . ' tr.row' . $pRow])
|
||||
? $this->assembleCSS($this->cssStyles['table.sheet' . $sheetIndex . ' tr.row' . $pRow]) : '';
|
||||
|
||||
$html .= ' <tr style="' . $style . '">' . PHP_EOL;
|
||||
}
|
||||
@ -1163,18 +1163,18 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
foreach ($pValues as $cellAddress) {
|
||||
$cell = ($cellAddress > '') ? $pSheet->getCell($cellAddress) : '';
|
||||
$coordinate = PHPExcel_Cell::stringFromColumnIndex($colNum) . ($pRow + 1);
|
||||
if (!$this->_useInlineCss) {
|
||||
if (!$this->useInlineCss) {
|
||||
$cssClass = '';
|
||||
$cssClass = 'column' . $colNum;
|
||||
} else {
|
||||
$cssClass = array();
|
||||
if ($cellType == 'th') {
|
||||
if (isset($this->_cssStyles['table.sheet' . $sheetIndex . ' th.column' . $colNum])) {
|
||||
$this->_cssStyles['table.sheet' . $sheetIndex . ' th.column' . $colNum];
|
||||
if (isset($this->cssStyles['table.sheet' . $sheetIndex . ' th.column' . $colNum])) {
|
||||
$this->cssStyles['table.sheet' . $sheetIndex . ' th.column' . $colNum];
|
||||
}
|
||||
} else {
|
||||
if (isset($this->_cssStyles['table.sheet' . $sheetIndex . ' td.column' . $colNum])) {
|
||||
$this->_cssStyles['table.sheet' . $sheetIndex . ' td.column' . $colNum];
|
||||
if (isset($this->cssStyles['table.sheet' . $sheetIndex . ' td.column' . $colNum])) {
|
||||
$this->cssStyles['table.sheet' . $sheetIndex . ' td.column' . $colNum];
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1197,7 +1197,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
foreach ($elements as $element) {
|
||||
// Rich text start?
|
||||
if ($element instanceof PHPExcel_RichText_Run) {
|
||||
$cellData .= '<span style="' . $this->_assembleCSS($this->_createCSSStyleFont($element->getFont())) . '">';
|
||||
$cellData .= '<span style="' . $this->assembleCSS($this->createCSSStyleFont($element->getFont())) . '">';
|
||||
|
||||
if ($element->getFont()->getSuperScript()) {
|
||||
$cellData .= '<sup>';
|
||||
@ -1250,25 +1250,25 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
$cellData = nl2br($cellData);
|
||||
|
||||
// Extend CSS class?
|
||||
if (!$this->_useInlineCss) {
|
||||
if (!$this->useInlineCss) {
|
||||
$cssClass .= ' style' . $cell->getXfIndex();
|
||||
$cssClass .= ' ' . $cell->getDataType();
|
||||
} else {
|
||||
if ($cellType == 'th') {
|
||||
if (isset($this->_cssStyles['th.style' . $cell->getXfIndex()])) {
|
||||
$cssClass = array_merge($cssClass, $this->_cssStyles['th.style' . $cell->getXfIndex()]);
|
||||
if (isset($this->cssStyles['th.style' . $cell->getXfIndex()])) {
|
||||
$cssClass = array_merge($cssClass, $this->cssStyles['th.style' . $cell->getXfIndex()]);
|
||||
}
|
||||
} else {
|
||||
if (isset($this->_cssStyles['td.style' . $cell->getXfIndex()])) {
|
||||
$cssClass = array_merge($cssClass, $this->_cssStyles['td.style' . $cell->getXfIndex()]);
|
||||
if (isset($this->cssStyles['td.style' . $cell->getXfIndex()])) {
|
||||
$cssClass = array_merge($cssClass, $this->cssStyles['td.style' . $cell->getXfIndex()]);
|
||||
}
|
||||
}
|
||||
|
||||
// General horizontal alignment: Actual horizontal alignment depends on dataType
|
||||
$sharedStyle = $pSheet->getParent()->getCellXfByIndex($cell->getXfIndex());
|
||||
if ($sharedStyle->getAlignment()->getHorizontal() == PHPExcel_Style_Alignment::HORIZONTAL_GENERAL
|
||||
&& isset($this->_cssStyles['.' . $cell->getDataType()]['text-align'])) {
|
||||
$cssClass['text-align'] = $this->_cssStyles['.' . $cell->getDataType()]['text-align'];
|
||||
&& isset($this->cssStyles['.' . $cell->getDataType()]['text-align'])) {
|
||||
$cssClass['text-align'] = $this->cssStyles['.' . $cell->getDataType()]['text-align'];
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1279,21 +1279,21 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
}
|
||||
|
||||
// Should the cell be written or is it swallowed by a rowspan or colspan?
|
||||
$writeCell = !(isset($this->_isSpannedCell[$pSheet->getParent()->getIndex($pSheet)][$pRow + 1][$colNum])
|
||||
&& $this->_isSpannedCell[$pSheet->getParent()->getIndex($pSheet)][$pRow + 1][$colNum]);
|
||||
$writeCell = !(isset($this->isSpannedCell[$pSheet->getParent()->getIndex($pSheet)][$pRow + 1][$colNum])
|
||||
&& $this->isSpannedCell[$pSheet->getParent()->getIndex($pSheet)][$pRow + 1][$colNum]);
|
||||
|
||||
// Colspan and Rowspan
|
||||
$colspan = 1;
|
||||
$rowspan = 1;
|
||||
if (isset($this->_isBaseCell[$pSheet->getParent()->getIndex($pSheet)][$pRow + 1][$colNum])) {
|
||||
$spans = $this->_isBaseCell[$pSheet->getParent()->getIndex($pSheet)][$pRow + 1][$colNum];
|
||||
if (isset($this->isBaseCell[$pSheet->getParent()->getIndex($pSheet)][$pRow + 1][$colNum])) {
|
||||
$spans = $this->isBaseCell[$pSheet->getParent()->getIndex($pSheet)][$pRow + 1][$colNum];
|
||||
$rowSpan = $spans['rowspan'];
|
||||
$colSpan = $spans['colspan'];
|
||||
|
||||
// Also apply style from last cell in merge to fix borders -
|
||||
// relies on !important for non-none border declarations in _createCSSStyleBorder
|
||||
// relies on !important for non-none border declarations in createCSSStyleBorder
|
||||
$endCellCoord = PHPExcel_Cell::stringFromColumnIndex($colNum + $colSpan - 1) . ($pRow + $rowSpan);
|
||||
if (!$this->_useInlineCss) {
|
||||
if (!$this->useInlineCss) {
|
||||
$cssClass .= ' style' . $pSheet->getCell($endCellCoord)->getXfIndex();
|
||||
}
|
||||
}
|
||||
@ -1302,7 +1302,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
if ($writeCell) {
|
||||
// Column start
|
||||
$html .= ' <' . $cellType;
|
||||
if (!$this->_useInlineCss) {
|
||||
if (!$this->useInlineCss) {
|
||||
$html .= ' class="' . $cssClass . '"';
|
||||
} else {
|
||||
//** Necessary redundant code for the sake of PHPExcel_Writer_PDF **
|
||||
@ -1312,21 +1312,21 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
$i = $colNum - 1;
|
||||
$e = $colNum + $colSpan - 1;
|
||||
while ($i++ < $e) {
|
||||
if (isset($this->_columnWidths[$sheetIndex][$i])) {
|
||||
$width += $this->_columnWidths[$sheetIndex][$i];
|
||||
if (isset($this->columnWidths[$sheetIndex][$i])) {
|
||||
$width += $this->columnWidths[$sheetIndex][$i];
|
||||
}
|
||||
}
|
||||
$cssClass['width'] = $width . 'pt';
|
||||
|
||||
// We must also explicitly write the height of the <td> element because TCPDF
|
||||
// does not recognize e.g. <tr style="height:50pt">
|
||||
if (isset($this->_cssStyles['table.sheet' . $sheetIndex . ' tr.row' . $pRow]['height'])) {
|
||||
$height = $this->_cssStyles['table.sheet' . $sheetIndex . ' tr.row' . $pRow]['height'];
|
||||
if (isset($this->cssStyles['table.sheet' . $sheetIndex . ' tr.row' . $pRow]['height'])) {
|
||||
$height = $this->cssStyles['table.sheet' . $sheetIndex . ' tr.row' . $pRow]['height'];
|
||||
$cssClass['height'] = $height;
|
||||
}
|
||||
//** end of redundant code **
|
||||
|
||||
$html .= ' style="' . $this->_assembleCSS($cssClass) . '"';
|
||||
$html .= ' style="' . $this->assembleCSS($cssClass) . '"';
|
||||
}
|
||||
if ($colSpan > 1) {
|
||||
$html .= ' colspan="' . $colSpan . '"';
|
||||
@ -1337,11 +1337,11 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
$html .= '>';
|
||||
|
||||
// Image?
|
||||
$html .= $this->_writeImageInCell($pSheet, $coordinate);
|
||||
$html .= $this->writeImageInCell($pSheet, $coordinate);
|
||||
|
||||
// Chart?
|
||||
if ($this->_includeCharts) {
|
||||
$html .= $this->_writeChartInCell($pSheet, $coordinate);
|
||||
if ($this->includeCharts) {
|
||||
$html .= $this->writeChartInCell($pSheet, $coordinate);
|
||||
}
|
||||
|
||||
// Cell data
|
||||
@ -1371,7 +1371,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
* @param array
|
||||
* @return string
|
||||
*/
|
||||
private function _assembleCSS($pValue = array())
|
||||
private function assembleCSS($pValue = array())
|
||||
{
|
||||
$pairs = array();
|
||||
foreach ($pValue as $property => $value) {
|
||||
@ -1389,7 +1389,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
*/
|
||||
public function getImagesRoot()
|
||||
{
|
||||
return $this->_imagesRoot;
|
||||
return $this->imagesRoot;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1400,7 +1400,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
*/
|
||||
public function setImagesRoot($pValue = '.')
|
||||
{
|
||||
$this->_imagesRoot = $pValue;
|
||||
$this->imagesRoot = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -1411,7 +1411,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
*/
|
||||
public function getEmbedImages()
|
||||
{
|
||||
return $this->_embedImages;
|
||||
return $this->embedImages;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1422,7 +1422,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
*/
|
||||
public function setEmbedImages($pValue = '.')
|
||||
{
|
||||
$this->_embedImages = $pValue;
|
||||
$this->embedImages = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -1433,7 +1433,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
*/
|
||||
public function getUseInlineCss()
|
||||
{
|
||||
return $this->_useInlineCss;
|
||||
return $this->useInlineCss;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1444,7 +1444,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
*/
|
||||
public function setUseInlineCss($pValue = false)
|
||||
{
|
||||
$this->_useInlineCss = $pValue;
|
||||
$this->useInlineCss = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -1482,22 +1482,22 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
/**
|
||||
* Calculate information about HTML colspan and rowspan which is not always the same as Excel's
|
||||
*/
|
||||
private function _calculateSpans()
|
||||
private function calculateSpans()
|
||||
{
|
||||
// Identify all cells that should be omitted in HTML due to cell merge.
|
||||
// In HTML only the upper-left cell should be written and it should have
|
||||
// appropriate rowspan / colspan attribute
|
||||
$sheetIndexes = $this->_sheetIndex !== null ?
|
||||
array($this->_sheetIndex) : range(0, $this->_phpExcel->getSheetCount() - 1);
|
||||
$sheetIndexes = $this->sheetIndex !== null ?
|
||||
array($this->sheetIndex) : range(0, $this->phpExcel->getSheetCount() - 1);
|
||||
|
||||
foreach ($sheetIndexes as $sheetIndex) {
|
||||
$sheet = $this->_phpExcel->getSheet($sheetIndex);
|
||||
$sheet = $this->phpExcel->getSheet($sheetIndex);
|
||||
|
||||
$candidateSpannedRow = array();
|
||||
|
||||
// loop through all Excel merged cells
|
||||
foreach ($sheet->getMergeCells() as $cells) {
|
||||
list($cells, ) = PHPExcel_Cell::splitRange($cells);
|
||||
list($cells,) = PHPExcel_Cell::splitRange($cells);
|
||||
$first = $cells[0];
|
||||
$last = $cells[1];
|
||||
|
||||
@ -1517,12 +1517,12 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
while ($c++ < $lc) {
|
||||
if (!($c == $fc && $r == $fr)) {
|
||||
// not the upper-left cell (should not be written in HTML)
|
||||
$this->_isSpannedCell[$sheetIndex][$r][$c] = array(
|
||||
$this->isSpannedCell[$sheetIndex][$r][$c] = array(
|
||||
'baseCell' => array($fr, $fc),
|
||||
);
|
||||
} else {
|
||||
// upper-left is the base cell that should hold the colspan/rowspan attribute
|
||||
$this->_isBaseCell[$sheetIndex][$r][$c] = array(
|
||||
$this->isBaseCell[$sheetIndex][$r][$c] = array(
|
||||
'xlrowspan' => $lr - $fr + 1, // Excel rowspan
|
||||
'rowspan' => $lr - $fr + 1, // HTML rowspan, value may change
|
||||
'xlcolspan' => $lc - $fc + 1, // Excel colspan
|
||||
@ -1537,25 +1537,25 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
// participate in a merge and the where base cells are somewhere above.
|
||||
$countColumns = PHPExcel_Cell::columnIndexFromString($sheet->getHighestColumn());
|
||||
foreach ($candidateSpannedRow as $rowIndex) {
|
||||
if (isset($this->_isSpannedCell[$sheetIndex][$rowIndex])) {
|
||||
if (count($this->_isSpannedCell[$sheetIndex][$rowIndex]) == $countColumns) {
|
||||
$this->_isSpannedRow[$sheetIndex][$rowIndex] = $rowIndex;
|
||||
if (isset($this->isSpannedCell[$sheetIndex][$rowIndex])) {
|
||||
if (count($this->isSpannedCell[$sheetIndex][$rowIndex]) == $countColumns) {
|
||||
$this->isSpannedRow[$sheetIndex][$rowIndex] = $rowIndex;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// For each of the omitted rows we found above, the affected rowspans should be subtracted by 1
|
||||
if (isset($this->_isSpannedRow[$sheetIndex])) {
|
||||
foreach ($this->_isSpannedRow[$sheetIndex] as $rowIndex) {
|
||||
if (isset($this->isSpannedRow[$sheetIndex])) {
|
||||
foreach ($this->isSpannedRow[$sheetIndex] as $rowIndex) {
|
||||
$adjustedBaseCells = array();
|
||||
$c = -1;
|
||||
$e = $countColumns - 1;
|
||||
while ($c++ < $e) {
|
||||
$baseCell = $this->_isSpannedCell[$sheetIndex][$rowIndex][$c]['baseCell'];
|
||||
$baseCell = $this->isSpannedCell[$sheetIndex][$rowIndex][$c]['baseCell'];
|
||||
|
||||
if (!in_array($baseCell, $adjustedBaseCells)) {
|
||||
// subtract rowspan by 1
|
||||
--$this->_isBaseCell[$sheetIndex][ $baseCell[0] ][ $baseCell[1] ]['rowspan'];
|
||||
--$this->isBaseCell[$sheetIndex][ $baseCell[0] ][ $baseCell[1] ]['rowspan'];
|
||||
$adjustedBaseCells[] = $baseCell;
|
||||
}
|
||||
}
|
||||
@ -1566,10 +1566,10 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
|
||||
}
|
||||
|
||||
// We have calculated the spans
|
||||
$this->_spansAreCalculated = true;
|
||||
$this->spansAreCalculated = true;
|
||||
}
|
||||
|
||||
private function _setMargins(PHPExcel_Worksheet $pSheet)
|
||||
private function setMargins(PHPExcel_Worksheet $pSheet)
|
||||
{
|
||||
$htmlPage = '@page { ';
|
||||
$htmlBody = 'body { ';
|
||||
|
@ -320,7 +320,7 @@ abstract class PHPExcel_Writer_PDF_Core extends PHPExcel_Writer_HTML
|
||||
protected function prepareForSave($pFilename = null)
|
||||
{
|
||||
// garbage collect
|
||||
$this->_phpExcel->garbageCollect();
|
||||
$this->phpExcel->garbageCollect();
|
||||
|
||||
$this->saveArrayReturnType = PHPExcel_Calculation::getArrayReturnType();
|
||||
PHPExcel_Calculation::setArrayReturnType(PHPExcel_Calculation::RETURN_ARRAY_AS_VALUE);
|
||||
@ -332,7 +332,7 @@ abstract class PHPExcel_Writer_PDF_Core extends PHPExcel_Writer_HTML
|
||||
}
|
||||
|
||||
// Set PDF
|
||||
$this->_isPdf = true;
|
||||
$this->isPdf = true;
|
||||
// Build CSS
|
||||
$this->buildCSS(true);
|
||||
|
||||
|
@ -60,15 +60,15 @@ class PHPExcel_Writer_PDF_DomPDF extends PHPExcel_Writer_PDF_Core implements PHP
|
||||
|
||||
// Check for paper size and page orientation
|
||||
if (is_null($this->getSheetIndex())) {
|
||||
$orientation = ($this->_phpExcel->getSheet(0)->getPageSetup()->getOrientation()
|
||||
$orientation = ($this->phpExcel->getSheet(0)->getPageSetup()->getOrientation()
|
||||
== PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P';
|
||||
$printPaperSize = $this->_phpExcel->getSheet(0)->getPageSetup()->getPaperSize();
|
||||
$printMargins = $this->_phpExcel->getSheet(0)->getPageMargins();
|
||||
$printPaperSize = $this->phpExcel->getSheet(0)->getPageSetup()->getPaperSize();
|
||||
$printMargins = $this->phpExcel->getSheet(0)->getPageMargins();
|
||||
} else {
|
||||
$orientation = ($this->_phpExcel->getSheet($this->getSheetIndex())->getPageSetup()->getOrientation()
|
||||
$orientation = ($this->phpExcel->getSheet($this->getSheetIndex())->getPageSetup()->getOrientation()
|
||||
== PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P';
|
||||
$printPaperSize = $this->_phpExcel->getSheet($this->getSheetIndex())->getPageSetup()->getPaperSize();
|
||||
$printMargins = $this->_phpExcel->getSheet($this->getSheetIndex())->getPageMargins();
|
||||
$printPaperSize = $this->phpExcel->getSheet($this->getSheetIndex())->getPageSetup()->getPaperSize();
|
||||
$printMargins = $this->phpExcel->getSheet($this->getSheetIndex())->getPageMargins();
|
||||
}
|
||||
|
||||
$orientation = ($orientation == 'L') ? 'landscape' : 'portrait';
|
||||
|
@ -60,15 +60,15 @@ class PHPExcel_Writer_PDF_mPDF extends PHPExcel_Writer_PDF_Core implements PHPEx
|
||||
|
||||
// Check for paper size and page orientation
|
||||
if (is_null($this->getSheetIndex())) {
|
||||
$orientation = ($this->_phpExcel->getSheet(0)->getPageSetup()->getOrientation()
|
||||
$orientation = ($this->phpExcel->getSheet(0)->getPageSetup()->getOrientation()
|
||||
== PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P';
|
||||
$printPaperSize = $this->_phpExcel->getSheet(0)->getPageSetup()->getPaperSize();
|
||||
$printMargins = $this->_phpExcel->getSheet(0)->getPageMargins();
|
||||
$printPaperSize = $this->phpExcel->getSheet(0)->getPageSetup()->getPaperSize();
|
||||
$printMargins = $this->phpExcel->getSheet(0)->getPageMargins();
|
||||
} else {
|
||||
$orientation = ($this->_phpExcel->getSheet($this->getSheetIndex())->getPageSetup()->getOrientation()
|
||||
$orientation = ($this->phpExcel->getSheet($this->getSheetIndex())->getPageSetup()->getOrientation()
|
||||
== PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P';
|
||||
$printPaperSize = $this->_phpExcel->getSheet($this->getSheetIndex())->getPageSetup()->getPaperSize();
|
||||
$printMargins = $this->_phpExcel->getSheet($this->getSheetIndex())->getPageMargins();
|
||||
$printPaperSize = $this->phpExcel->getSheet($this->getSheetIndex())->getPageSetup()->getPaperSize();
|
||||
$printMargins = $this->phpExcel->getSheet($this->getSheetIndex())->getPageMargins();
|
||||
}
|
||||
$this->setOrientation($orientation);
|
||||
|
||||
@ -98,11 +98,11 @@ class PHPExcel_Writer_PDF_mPDF extends PHPExcel_Writer_PDF_Core implements PHPEx
|
||||
$pdf->AddPage($orientation);
|
||||
|
||||
// Document info
|
||||
$pdf->SetTitle($this->_phpExcel->getProperties()->getTitle());
|
||||
$pdf->SetAuthor($this->_phpExcel->getProperties()->getCreator());
|
||||
$pdf->SetSubject($this->_phpExcel->getProperties()->getSubject());
|
||||
$pdf->SetKeywords($this->_phpExcel->getProperties()->getKeywords());
|
||||
$pdf->SetCreator($this->_phpExcel->getProperties()->getCreator());
|
||||
$pdf->SetTitle($this->phpExcel->getProperties()->getTitle());
|
||||
$pdf->SetAuthor($this->phpExcel->getProperties()->getCreator());
|
||||
$pdf->SetSubject($this->phpExcel->getProperties()->getSubject());
|
||||
$pdf->SetKeywords($this->phpExcel->getProperties()->getKeywords());
|
||||
$pdf->SetCreator($this->phpExcel->getProperties()->getCreator());
|
||||
|
||||
$pdf->WriteHTML(
|
||||
$this->generateHTMLHeader(false) .
|
||||
|
@ -61,15 +61,15 @@ class PHPExcel_Writer_PDF_tcPDF extends PHPExcel_Writer_PDF_Core implements PHPE
|
||||
|
||||
// Check for paper size and page orientation
|
||||
if (is_null($this->getSheetIndex())) {
|
||||
$orientation = ($this->_phpExcel->getSheet(0)->getPageSetup()->getOrientation()
|
||||
$orientation = ($this->phpExcel->getSheet(0)->getPageSetup()->getOrientation()
|
||||
== PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P';
|
||||
$printPaperSize = $this->_phpExcel->getSheet(0)->getPageSetup()->getPaperSize();
|
||||
$printMargins = $this->_phpExcel->getSheet(0)->getPageMargins();
|
||||
$printPaperSize = $this->phpExcel->getSheet(0)->getPageSetup()->getPaperSize();
|
||||
$printMargins = $this->phpExcel->getSheet(0)->getPageMargins();
|
||||
} else {
|
||||
$orientation = ($this->_phpExcel->getSheet($this->getSheetIndex())->getPageSetup()->getOrientation()
|
||||
$orientation = ($this->phpExcel->getSheet($this->getSheetIndex())->getPageSetup()->getOrientation()
|
||||
== PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P';
|
||||
$printPaperSize = $this->_phpExcel->getSheet($this->getSheetIndex())->getPageSetup()->getPaperSize();
|
||||
$printMargins = $this->_phpExcel->getSheet($this->getSheetIndex())->getPageMargins();
|
||||
$printPaperSize = $this->phpExcel->getSheet($this->getSheetIndex())->getPageSetup()->getPaperSize();
|
||||
$printMargins = $this->phpExcel->getSheet($this->getSheetIndex())->getPageMargins();
|
||||
}
|
||||
|
||||
// Override Page Orientation
|
||||
@ -109,11 +109,11 @@ class PHPExcel_Writer_PDF_tcPDF extends PHPExcel_Writer_PDF_Core implements PHPE
|
||||
);
|
||||
|
||||
// Document info
|
||||
$pdf->SetTitle($this->_phpExcel->getProperties()->getTitle());
|
||||
$pdf->SetAuthor($this->_phpExcel->getProperties()->getCreator());
|
||||
$pdf->SetSubject($this->_phpExcel->getProperties()->getSubject());
|
||||
$pdf->SetKeywords($this->_phpExcel->getProperties()->getKeywords());
|
||||
$pdf->SetCreator($this->_phpExcel->getProperties()->getCreator());
|
||||
$pdf->SetTitle($this->phpExcel->getProperties()->getTitle());
|
||||
$pdf->SetAuthor($this->phpExcel->getProperties()->getCreator());
|
||||
$pdf->SetSubject($this->phpExcel->getProperties()->getSubject());
|
||||
$pdf->SetKeywords($this->phpExcel->getProperties()->getKeywords());
|
||||
$pdf->SetCreator($this->phpExcel->getProperties()->getCreator());
|
||||
|
||||
// Write to file
|
||||
fwrite($fileHandle, $pdf->output($pFilename, 'S'));
|
||||
|
@ -3,4 +3,4 @@
|
||||
-10, 3, -3
|
||||
10, 2.2, 4
|
||||
5.5, 2.667, 2
|
||||
-7, 2, -4
|
||||
-7, 2, -3
|
||||
|
Loading…
Reference in New Issue
Block a user