diff --git a/Classes/PHPExcel/Reader/Abstract.php b/Classes/PHPExcel/Reader/Abstract.php
index 08f8dbd1..5902574b 100644
--- a/Classes/PHPExcel/Reader/Abstract.php
+++ b/Classes/PHPExcel/Reader/Abstract.php
@@ -1,6 +1,7 @@
_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;
}
diff --git a/Classes/PHPExcel/Reader/CSV.php b/Classes/PHPExcel/Reader/CSV.php
index 65e2d3b6..db96b608 100644
--- a/Classes/PHPExcel/Reader/CSV.php
+++ b/Classes/PHPExcel/Reader/CSV.php
@@ -1,6 +1,16 @@
_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);
diff --git a/Classes/PHPExcel/Reader/DefaultReadFilter.php b/Classes/PHPExcel/Reader/DefaultReadFilter.php
index 2e06dcbd..ea25f63c 100644
--- a/Classes/PHPExcel/Reader/DefaultReadFilter.php
+++ b/Classes/PHPExcel/Reader/DefaultReadFilter.php
@@ -1,6 +1,16 @@
_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,'
';
$annotation = strip_tags($node);
// echo 'Annotation: ', $annotation,'
';
- $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;
}
diff --git a/Classes/PHPExcel/Reader/Excel2007.php b/Classes/PHPExcel/Reader/Excel2007.php
index 47a130e3..2903313e 100644
--- a/Classes/PHPExcel/Reader/Excel2007.php
+++ b/Classes/PHPExcel/Reader/Excel2007.php
@@ -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, '
';
@@ -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");
}
diff --git a/Classes/PHPExcel/Reader/Excel5.php b/Classes/PHPExcel/Reader/Excel5.php
index 3728b6cc..50cc87e3 100644
--- a/Classes/PHPExcel/Reader/Excel5.php
+++ b/Classes/PHPExcel/Reader/Excel5.php
@@ -1,6 +1,16 @@
_data
+ * Size in bytes of $this->data
*
* @var int
*/
- private $_dataSize;
+ private $dataSize;
/**
* Current position in stream
*
* @var integer
*/
- private $_pos;
+ private $pos;
/**
* Workbook to be returned by the reader.
*
* @var PHPExcel
*/
- private $_phpExcel;
+ private $phpExcel;
/**
* Worksheet that is currently being built by the reader.
*
* @var PHPExcel_Worksheet
*/
- private $_phpSheet;
+ private $phpSheet;
/**
* BIFF version
*
* @var int
*/
- private $_version;
+ private $version;
/**
* Codepage set in the Excel file being read. Only important for BIFF5 (Excel 5.0 - Excel 95)
@@ -236,147 +226,147 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
*
* @var string
*/
- private $_codepage;
+ private $codepage;
/**
* Shared formats
*
* @var array
*/
- private $_formats;
+ private $formats;
/**
* Shared fonts
*
* @var array
*/
- private $_objFonts;
+ private $objFonts;
/**
* Color palette
*
* @var array
*/
- private $_palette;
+ private $palette;
/**
* Worksheets
*
* @var array
*/
- private $_sheets;
+ private $sheets;
/**
* External books
*
* @var array
*/
- private $_externalBooks;
+ private $externalBooks;
/**
* REF structures. Only applies to BIFF8.
*
* @var array
*/
- private $_ref;
+ private $ref;
/**
* External names
*
* @var array
*/
- private $_externalNames;
+ private $externalNames;
/**
* Defined names
*
* @var array
*/
- private $_definedname;
+ private $definedname;
/**
* Shared strings. Only applies to BIFF8.
*
* @var array
*/
- private $_sst;
+ private $sst;
/**
* Panes are frozen? (in sheet currently being read). See WINDOW2 record.
*
* @var boolean
*/
- private $_frozen;
+ private $frozen;
/**
* Fit printout to number of pages? (in sheet currently being read). See SHEETPR record.
*
* @var boolean
*/
- private $_isFitToPages;
+ private $isFitToPages;
/**
* Objects. One OBJ record contributes with one entry.
*
* @var array
*/
- private $_objs;
+ private $objs;
/**
* Text Objects. One TXO record corresponds with one entry.
*
* @var array
*/
- private $_textObjects;
+ private $textObjects;
/**
* Cell Annotations (BIFF8)
*
* @var array
*/
- private $_cellNotes;
+ private $cellNotes;
/**
* The combined MSODRAWINGGROUP data
*
* @var string
*/
- private $_drawingGroupData;
+ private $drawingGroupData;
/**
* The combined MSODRAWING data (per sheet)
*
* @var string
*/
- private $_drawingData;
+ private $drawingData;
/**
* Keep track of XF index
*
* @var int
*/
- private $_xfIndex;
+ private $xfIndex;
/**
* Mapping of XF index (that is a cell XF) to final index in cellXf collection
*
* @var array
*/
- private $_mapCellXfIndex;
+ private $mapCellXfIndex;
/**
* Mapping of XF index (that is a style XF) to final index in cellStyleXf collection
*
* @var array
*/
- private $_mapCellStyleXfIndex;
+ private $mapCellStyleXfIndex;
/**
* The shared formulas in a sheet. One SHAREDFMLA record contributes with one value.
*
* @var array
*/
- private $_sharedFormulas;
+ private $sharedFormulas;
/**
* The shared formula parts in a sheet. One FORMULA record contributes with one value if it
@@ -384,49 +374,49 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
*
* @var array
*/
- private $_sharedFormulaParts;
+ private $sharedFormulaParts;
/**
* The type of encryption in use
*
* @var int
*/
- private $_encryption = 0;
+ private $encryption = 0;
/**
* The position in the stream after which contents are encrypted
*
* @var int
*/
- private $_encryptionStartPos = false;
+ private $encryptionStartPos = false;
/**
* The current RC4 decryption object
*
* @var PHPExcel_Reader_Excel5_RC4
*/
- private $_rc4Key = null;
+ private $rc4Key = null;
/**
* The position in the stream that the RC4 decryption object was left at
*
* @var int
*/
- private $_rc4Pos = 0;
+ private $rc4Pos = 0;
/**
* The current MD5 context state
*
* @var string
*/
- private $_md5Ctxt = null;
+ private $md5Ctxt = null;
/**
* Create a new PHPExcel_Reader_Excel5 instance
*/
public function __construct()
{
- $this->_readFilter = new PHPExcel_Reader_DefaultReadFilter();
+ $this->readFilter = new PHPExcel_Reader_DefaultReadFilter();
}
/**
@@ -471,35 +461,35 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
$worksheetNames = array();
// Read the OLE file
- $this->_loadOLE($pFilename);
+ $this->loadOLE($pFilename);
// total byte size of Excel data (workbook global substream + sheet substreams)
- $this->_dataSize = strlen($this->_data);
+ $this->dataSize = strlen($this->data);
- $this->_pos = 0;
- $this->_sheets = array();
+ $this->pos = 0;
+ $this->sheets = array();
// Parse Workbook Global Substream
- while ($this->_pos < $this->_dataSize) {
- $code = self::_GetInt2d($this->_data, $this->_pos);
+ while ($this->pos < $this->dataSize) {
+ $code = self::getInt2d($this->data, $this->pos);
switch ($code) {
case self::XLS_Type_BOF:
- $this->_readBof();
+ $this->readBof();
break;
case self::XLS_Type_SHEET:
- $this->_readSheet();
+ $this->readSheet();
break;
case self::XLS_Type_EOF:
- $this->_readDefault();
+ $this->readDefault();
break 2;
default:
- $this->_readDefault();
+ $this->readDefault();
break;
}
}
- foreach ($this->_sheets as $sheet) {
+ foreach ($this->sheets as $sheet) {
if ($sheet['sheetType'] != 0x00) {
// 0x00: Worksheet, 0x02: Chart, 0x06: Visual Basic module
continue;
@@ -528,37 +518,37 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
$worksheetInfo = array();
// Read the OLE file
- $this->_loadOLE($pFilename);
+ $this->loadOLE($pFilename);
// total byte size of Excel data (workbook global substream + sheet substreams)
- $this->_dataSize = strlen($this->_data);
+ $this->dataSize = strlen($this->data);
// initialize
- $this->_pos = 0;
- $this->_sheets = array();
+ $this->pos = 0;
+ $this->sheets = array();
// Parse Workbook Global Substream
- while ($this->_pos < $this->_dataSize) {
- $code = self::_GetInt2d($this->_data, $this->_pos);
+ while ($this->pos < $this->dataSize) {
+ $code = self::getInt2d($this->data, $this->pos);
switch ($code) {
case self::XLS_Type_BOF:
- $this->_readBof();
+ $this->readBof();
break;
case self::XLS_Type_SHEET:
- $this->_readSheet();
+ $this->readSheet();
break;
case self::XLS_Type_EOF:
- $this->_readDefault();
+ $this->readDefault();
break 2;
default:
- $this->_readDefault();
+ $this->readDefault();
break;
}
}
// Parse the individual sheets
- foreach ($this->_sheets as $sheet) {
+ foreach ($this->sheets as $sheet) {
if ($sheet['sheetType'] != 0x00) {
// 0x00: Worksheet
// 0x02: Chart
@@ -573,10 +563,10 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
$tmpInfo['totalRows'] = 0;
$tmpInfo['totalColumns'] = 0;
- $this->_pos = $sheet['offset'];
+ $this->pos = $sheet['offset'];
- while ($this->_pos <= $this->_dataSize - 4) {
- $code = self::_GetInt2d($this->_data, $this->_pos);
+ while ($this->pos <= $this->dataSize - 4) {
+ $code = self::getInt2d($this->data, $this->pos);
switch ($code) {
case self::XLS_Type_RK:
@@ -585,26 +575,26 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
case self::XLS_Type_FORMULA:
case self::XLS_Type_BOOLERR:
case self::XLS_Type_LABEL:
- $length = self::_GetInt2d($this->_data, $this->_pos + 2);
- $recordData = $this->_readRecordData($this->_data, $this->_pos + 4, $length);
+ $length = self::getInt2d($this->data, $this->pos + 2);
+ $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
// move stream pointer to next record
- $this->_pos += 4 + $length;
+ $this->pos += 4 + $length;
- $rowIndex = self::_GetInt2d($recordData, 0) + 1;
- $columnIndex = self::_GetInt2d($recordData, 2);
+ $rowIndex = self::getInt2d($recordData, 0) + 1;
+ $columnIndex = self::getInt2d($recordData, 2);
$tmpInfo['totalRows'] = max($tmpInfo['totalRows'], $rowIndex);
$tmpInfo['lastColumnIndex'] = max($tmpInfo['lastColumnIndex'], $columnIndex);
break;
case self::XLS_Type_BOF:
- $this->_readBof();
+ $this->readBof();
break;
case self::XLS_Type_EOF:
- $this->_readDefault();
+ $this->readDefault();
break 2;
default:
- $this->_readDefault();
+ $this->readDefault();
break;
}
}
@@ -629,126 +619,126 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
public function load($pFilename)
{
// Read the OLE file
- $this->_loadOLE($pFilename);
+ $this->loadOLE($pFilename);
// Initialisations
- $this->_phpExcel = new PHPExcel;
- $this->_phpExcel->removeSheetByIndex(0); // remove 1st sheet
- if (!$this->_readDataOnly) {
- $this->_phpExcel->removeCellStyleXfByIndex(0); // remove the default style
- $this->_phpExcel->removeCellXfByIndex(0); // remove the default style
+ $this->phpExcel = new PHPExcel;
+ $this->phpExcel->removeSheetByIndex(0); // remove 1st sheet
+ if (!$this->readDataOnly) {
+ $this->phpExcel->removeCellStyleXfByIndex(0); // remove the default style
+ $this->phpExcel->removeCellXfByIndex(0); // remove the default style
}
// Read the summary information stream (containing meta data)
- $this->_readSummaryInformation();
+ $this->readSummaryInformation();
// Read the Additional document summary information stream (containing application-specific meta data)
- $this->_readDocumentSummaryInformation();
+ $this->readDocumentSummaryInformation();
// total byte size of Excel data (workbook global substream + sheet substreams)
- $this->_dataSize = strlen($this->_data);
+ $this->dataSize = strlen($this->data);
// initialize
- $this->_pos = 0;
- $this->_codepage = 'CP1252';
- $this->_formats = array();
- $this->_objFonts = array();
- $this->_palette = array();
- $this->_sheets = array();
- $this->_externalBooks = array();
- $this->_ref = array();
- $this->_definedname = array();
- $this->_sst = array();
- $this->_drawingGroupData = '';
- $this->_xfIndex = '';
- $this->_mapCellXfIndex = array();
- $this->_mapCellStyleXfIndex = array();
+ $this->pos = 0;
+ $this->codepage = 'CP1252';
+ $this->formats = array();
+ $this->objFonts = array();
+ $this->palette = array();
+ $this->sheets = array();
+ $this->externalBooks = array();
+ $this->ref = array();
+ $this->definedname = array();
+ $this->sst = array();
+ $this->drawingGroupData = '';
+ $this->xfIndex = '';
+ $this->mapCellXfIndex = array();
+ $this->mapCellStyleXfIndex = array();
// Parse Workbook Global Substream
- while ($this->_pos < $this->_dataSize) {
- $code = self::_GetInt2d($this->_data, $this->_pos);
+ while ($this->pos < $this->dataSize) {
+ $code = self::getInt2d($this->data, $this->pos);
switch ($code) {
case self::XLS_Type_BOF:
- $this->_readBof();
+ $this->readBof();
break;
case self::XLS_Type_FILEPASS:
- $this->_readFilepass();
+ $this->readFilepass();
break;
case self::XLS_Type_CODEPAGE:
- $this->_readCodepage();
+ $this->readCodepage();
break;
case self::XLS_Type_DATEMODE:
- $this->_readDateMode();
+ $this->readDateMode();
break;
case self::XLS_Type_FONT:
- $this->_readFont();
+ $this->readFont();
break;
case self::XLS_Type_FORMAT:
- $this->_readFormat();
+ $this->readFormat();
break;
case self::XLS_Type_XF:
- $this->_readXf();
+ $this->readXf();
break;
case self::XLS_Type_XFEXT:
- $this->_readXfExt();
+ $this->readXfExt();
break;
case self::XLS_Type_STYLE:
- $this->_readStyle();
+ $this->readStyle();
break;
case self::XLS_Type_PALETTE:
- $this->_readPalette();
+ $this->readPalette();
break;
case self::XLS_Type_SHEET:
- $this->_readSheet();
+ $this->readSheet();
break;
case self::XLS_Type_EXTERNALBOOK:
- $this->_readExternalBook();
+ $this->readExternalBook();
break;
case self::XLS_Type_EXTERNNAME:
- $this->_readExternName();
+ $this->readExternName();
break;
case self::XLS_Type_EXTERNSHEET:
- $this->_readExternSheet();
+ $this->readExternSheet();
break;
case self::XLS_Type_DEFINEDNAME:
- $this->_readDefinedName();
+ $this->readDefinedName();
break;
case self::XLS_Type_MSODRAWINGGROUP:
- $this->_readMsoDrawingGroup();
+ $this->readMsoDrawingGroup();
break;
case self::XLS_Type_SST:
- $this->_readSst();
+ $this->readSst();
break;
case self::XLS_Type_EOF:
- $this->_readDefault();
+ $this->readDefault();
break 2;
default:
- $this->_readDefault();
+ $this->readDefault();
break;
}
}
// Resolve indexed colors for font, fill, and border colors
// Cannot be resolved already in XF record, because PALETTE record comes afterwards
- if (!$this->_readDataOnly) {
- foreach ($this->_objFonts as $objFont) {
+ if (!$this->readDataOnly) {
+ foreach ($this->objFonts as $objFont) {
if (isset($objFont->colorIndex)) {
- $color = self::_readColor($objFont->colorIndex, $this->_palette, $this->_version);
+ $color = self::readColor($objFont->colorIndex, $this->palette, $this->version);
$objFont->getColor()->setRGB($color['rgb']);
}
}
- foreach ($this->_phpExcel->getCellXfCollection() as $objStyle) {
+ foreach ($this->phpExcel->getCellXfCollection() as $objStyle) {
// fill start and end color
$fill = $objStyle->getFill();
if (isset($fill->startcolorIndex)) {
- $startColor = self::_readColor($fill->startcolorIndex, $this->_palette, $this->_version);
+ $startColor = self::readColor($fill->startcolorIndex, $this->palette, $this->version);
$fill->getStartColor()->setRGB($startColor['rgb']);
}
if (isset($fill->endcolorIndex)) {
- $endColor = self::_readColor($fill->endcolorIndex, $this->_palette, $this->_version);
+ $endColor = self::readColor($fill->endcolorIndex, $this->palette, $this->version);
$fill->getEndColor()->setRGB($endColor['rgb']);
}
@@ -760,267 +750,267 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
$diagonal = $objStyle->getBorders()->getDiagonal();
if (isset($top->colorIndex)) {
- $borderTopColor = self::_readColor($top->colorIndex, $this->_palette, $this->_version);
+ $borderTopColor = self::readColor($top->colorIndex, $this->palette, $this->version);
$top->getColor()->setRGB($borderTopColor['rgb']);
}
if (isset($right->colorIndex)) {
- $borderRightColor = self::_readColor($right->colorIndex, $this->_palette, $this->_version);
+ $borderRightColor = self::readColor($right->colorIndex, $this->palette, $this->version);
$right->getColor()->setRGB($borderRightColor['rgb']);
}
if (isset($bottom->colorIndex)) {
- $borderBottomColor = self::_readColor($bottom->colorIndex, $this->_palette, $this->_version);
+ $borderBottomColor = self::readColor($bottom->colorIndex, $this->palette, $this->version);
$bottom->getColor()->setRGB($borderBottomColor['rgb']);
}
if (isset($left->colorIndex)) {
- $borderLeftColor = self::_readColor($left->colorIndex, $this->_palette, $this->_version);
+ $borderLeftColor = self::readColor($left->colorIndex, $this->palette, $this->version);
$left->getColor()->setRGB($borderLeftColor['rgb']);
}
if (isset($diagonal->colorIndex)) {
- $borderDiagonalColor = self::_readColor($diagonal->colorIndex, $this->_palette, $this->_version);
+ $borderDiagonalColor = self::readColor($diagonal->colorIndex, $this->palette, $this->version);
$diagonal->getColor()->setRGB($borderDiagonalColor['rgb']);
}
}
}
// treat MSODRAWINGGROUP records, workbook-level Escher
- if (!$this->_readDataOnly && $this->_drawingGroupData) {
+ if (!$this->readDataOnly && $this->drawingGroupData) {
$escherWorkbook = new PHPExcel_Shared_Escher();
$reader = new PHPExcel_Reader_Excel5_Escher($escherWorkbook);
- $escherWorkbook = $reader->load($this->_drawingGroupData);
+ $escherWorkbook = $reader->load($this->drawingGroupData);
// debug Escher stream
//$debug = new Debug_Escher(new PHPExcel_Shared_Escher());
- //$debug->load($this->_drawingGroupData);
+ //$debug->load($this->drawingGroupData);
}
// Parse the individual sheets
- foreach ($this->_sheets as $sheet) {
+ foreach ($this->sheets as $sheet) {
if ($sheet['sheetType'] != 0x00) {
// 0x00: Worksheet, 0x02: Chart, 0x06: Visual Basic module
continue;
}
// check if sheet should be skipped
- if (isset($this->_loadSheetsOnly) && !in_array($sheet['name'], $this->_loadSheetsOnly)) {
+ if (isset($this->loadSheetsOnly) && !in_array($sheet['name'], $this->loadSheetsOnly)) {
continue;
}
// add sheet to PHPExcel object
- $this->_phpSheet = $this->_phpExcel->createSheet();
+ $this->phpSheet = $this->phpExcel->createSheet();
// 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
- $this->_phpSheet->setTitle($sheet['name'], false);
- $this->_phpSheet->setSheetState($sheet['sheetState']);
+ $this->phpSheet->setTitle($sheet['name'], false);
+ $this->phpSheet->setSheetState($sheet['sheetState']);
- $this->_pos = $sheet['offset'];
+ $this->pos = $sheet['offset'];
// Initialize isFitToPages. May change after reading SHEETPR record.
- $this->_isFitToPages = false;
+ $this->isFitToPages = false;
// Initialize drawingData
- $this->_drawingData = '';
+ $this->drawingData = '';
// Initialize objs
- $this->_objs = array();
+ $this->objs = array();
// Initialize shared formula parts
- $this->_sharedFormulaParts = array();
+ $this->sharedFormulaParts = array();
// Initialize shared formulas
- $this->_sharedFormulas = array();
+ $this->sharedFormulas = array();
// Initialize text objs
- $this->_textObjects = array();
+ $this->textObjects = array();
// Initialize cell annotations
- $this->_cellNotes = array();
+ $this->cellNotes = array();
$this->textObjRef = -1;
- while ($this->_pos <= $this->_dataSize - 4) {
- $code = self::_GetInt2d($this->_data, $this->_pos);
+ while ($this->pos <= $this->dataSize - 4) {
+ $code = self::getInt2d($this->data, $this->pos);
switch ($code) {
case self::XLS_Type_BOF:
- $this->_readBof();
+ $this->readBof();
break;
case self::XLS_Type_PRINTGRIDLINES:
- $this->_readPrintGridlines();
+ $this->readPrintGridlines();
break;
case self::XLS_Type_DEFAULTROWHEIGHT:
- $this->_readDefaultRowHeight();
+ $this->readDefaultRowHeight();
break;
case self::XLS_Type_SHEETPR:
- $this->_readSheetPr();
+ $this->readSheetPr();
break;
case self::XLS_Type_HORIZONTALPAGEBREAKS:
- $this->_readHorizontalPageBreaks();
+ $this->readHorizontalPageBreaks();
break;
case self::XLS_Type_VERTICALPAGEBREAKS:
- $this->_readVerticalPageBreaks();
+ $this->readVerticalPageBreaks();
break;
case self::XLS_Type_HEADER:
- $this->_readHeader();
+ $this->readHeader();
break;
case self::XLS_Type_FOOTER:
- $this->_readFooter();
+ $this->readFooter();
break;
case self::XLS_Type_HCENTER:
- $this->_readHcenter();
+ $this->readHcenter();
break;
case self::XLS_Type_VCENTER:
- $this->_readVcenter();
+ $this->readVcenter();
break;
case self::XLS_Type_LEFTMARGIN:
- $this->_readLeftMargin();
+ $this->readLeftMargin();
break;
case self::XLS_Type_RIGHTMARGIN:
- $this->_readRightMargin();
+ $this->readRightMargin();
break;
case self::XLS_Type_TOPMARGIN:
- $this->_readTopMargin();
+ $this->readTopMargin();
break;
case self::XLS_Type_BOTTOMMARGIN:
- $this->_readBottomMargin();
+ $this->readBottomMargin();
break;
case self::XLS_Type_PAGESETUP:
- $this->_readPageSetup();
+ $this->readPageSetup();
break;
case self::XLS_Type_PROTECT:
- $this->_readProtect();
+ $this->readProtect();
break;
case self::XLS_Type_SCENPROTECT:
- $this->_readScenProtect();
+ $this->readScenProtect();
break;
case self::XLS_Type_OBJECTPROTECT:
- $this->_readObjectProtect();
+ $this->readObjectProtect();
break;
case self::XLS_Type_PASSWORD:
- $this->_readPassword();
+ $this->readPassword();
break;
case self::XLS_Type_DEFCOLWIDTH:
- $this->_readDefColWidth();
+ $this->readDefColWidth();
break;
case self::XLS_Type_COLINFO:
- $this->_readColInfo();
+ $this->readColInfo();
break;
case self::XLS_Type_DIMENSION:
- $this->_readDefault();
+ $this->readDefault();
break;
case self::XLS_Type_ROW:
- $this->_readRow();
+ $this->readRow();
break;
case self::XLS_Type_DBCELL:
- $this->_readDefault();
+ $this->readDefault();
break;
case self::XLS_Type_RK:
- $this->_readRk();
+ $this->readRk();
break;
case self::XLS_Type_LABELSST:
- $this->_readLabelSst();
+ $this->readLabelSst();
break;
case self::XLS_Type_MULRK:
- $this->_readMulRk();
+ $this->readMulRk();
break;
case self::XLS_Type_NUMBER:
- $this->_readNumber();
+ $this->readNumber();
break;
case self::XLS_Type_FORMULA:
- $this->_readFormula();
+ $this->readFormula();
break;
case self::XLS_Type_SHAREDFMLA:
- $this->_readSharedFmla();
+ $this->readSharedFmla();
break;
case self::XLS_Type_BOOLERR:
- $this->_readBoolErr();
+ $this->readBoolErr();
break;
case self::XLS_Type_MULBLANK:
- $this->_readMulBlank();
+ $this->readMulBlank();
break;
case self::XLS_Type_LABEL:
- $this->_readLabel();
+ $this->readLabel();
break;
case self::XLS_Type_BLANK:
- $this->_readBlank();
+ $this->readBlank();
break;
case self::XLS_Type_MSODRAWING:
- $this->_readMsoDrawing();
+ $this->readMsoDrawing();
break;
case self::XLS_Type_OBJ:
- $this->_readObj();
+ $this->readObj();
break;
case self::XLS_Type_WINDOW2:
- $this->_readWindow2();
+ $this->readWindow2();
break;
case self::XLS_Type_PAGELAYOUTVIEW:
- $this->_readPageLayoutView();
+ $this->readPageLayoutView();
break;
case self::XLS_Type_SCL:
- $this->_readScl();
+ $this->readScl();
break;
case self::XLS_Type_PANE:
- $this->_readPane();
+ $this->readPane();
break;
case self::XLS_Type_SELECTION:
- $this->_readSelection();
+ $this->readSelection();
break;
case self::XLS_Type_MERGEDCELLS:
- $this->_readMergedCells();
+ $this->readMergedCells();
break;
case self::XLS_Type_HYPERLINK:
- $this->_readHyperLink();
+ $this->readHyperLink();
break;
case self::XLS_Type_DATAVALIDATIONS:
- $this->_readDataValidations();
+ $this->readDataValidations();
break;
case self::XLS_Type_DATAVALIDATION:
- $this->_readDataValidation();
+ $this->readDataValidation();
break;
case self::XLS_Type_SHEETLAYOUT:
- $this->_readSheetLayout();
+ $this->readSheetLayout();
break;
case self::XLS_Type_SHEETPROTECTION:
- $this->_readSheetProtection();
+ $this->readSheetProtection();
break;
case self::XLS_Type_RANGEPROTECTION:
- $this->_readRangeProtection();
+ $this->readRangeProtection();
break;
case self::XLS_Type_NOTE:
- $this->_readNote();
+ $this->readNote();
break;
- //case self::XLS_Type_IMDATA: $this->_readImData(); break;
+ //case self::XLS_Type_IMDATA: $this->readImData(); break;
case self::XLS_Type_TXO:
- $this->_readTextObject();
+ $this->readTextObject();
break;
case self::XLS_Type_CONTINUE:
- $this->_readContinue();
+ $this->readContinue();
break;
case self::XLS_Type_EOF:
- $this->_readDefault();
+ $this->readDefault();
break 2;
default:
- $this->_readDefault();
+ $this->readDefault();
break;
}
}
// treat MSODRAWING records, sheet-level Escher
- if (!$this->_readDataOnly && $this->_drawingData) {
+ if (!$this->readDataOnly && $this->drawingData) {
$escherWorksheet = new PHPExcel_Shared_Escher();
$reader = new PHPExcel_Reader_Excel5_Escher($escherWorksheet);
- $escherWorksheet = $reader->load($this->_drawingData);
+ $escherWorksheet = $reader->load($this->drawingData);
// debug Escher stream
//$debug = new Debug_Escher(new PHPExcel_Shared_Escher());
- //$debug->load($this->_drawingData);
+ //$debug->load($this->drawingData);
// get all spContainers in one long array, so they can be mapped to OBJ records
$allSpContainers = $escherWorksheet->getDgContainer()->getSpgrContainer()->getAllSpContainers();
}
// treat OBJ records
- foreach ($this->_objs as $n => $obj) {
+ foreach ($this->objs as $n => $obj) {
// echo '
';
// 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 'Worksheet: ', $worksheetName,'
';
- 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 '
';
- // 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,'
';
- return $RGB;
+ return $gnmR . $gnmG . $gnmB;
}
}
diff --git a/Classes/PHPExcel/Reader/HTML.php b/Classes/PHPExcel/Reader/HTML.php
index a7272e47..dedc1daa 100644
--- a/Classes/PHPExcel/Reader/HTML.php
+++ b/Classes/PHPExcel/Reader/HTML.php
@@ -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
';
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: ' , '
';
@@ -290,14 +309,14 @@ class PHPExcel_Reader_HTML extends PHPExcel_Reader_Abstract implements PHPExcel_
case 'href':
// echo 'Link to ' , $attributeValue , '
';
$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:' , '
';
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: ' , '
';
- $this->_processDomElement($child, $sheet, $row, $column, $cellContent);
+ $this->processDomElement($child, $sheet, $row, $column, $cellContent);
// echo 'END OF LIST ENTRY:' , '
';
} else {
if ($cellContent > '') {
- $this->_flushCell($sheet, $column, $row, $cellContent);
+ $this->flushCell($sheet, $column, $row, $cellContent);
$row++;
}
// echo 'START OF PARAGRAPH: ' , '
';
- $this->_processDomElement($child, $sheet, $row, $column, $cellContent);
+ $this->processDomElement($child, $sheet, $row, $column, $cellContent);
// echo 'END OF PARAGRAPH:' , '
';
- $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: ' , '
';
- $this->_processDomElement($child, $sheet, $row, $column, $cellContent);
+ $this->processDomElement($child, $sheet, $row, $column, $cellContent);
// echo 'END OF LIST ENTRY:' , '
';
} else {
if ($cellContent > '') {
- $this->_flushCell($sheet, $column, $row, $cellContent);
+ $this->flushCell($sheet, $column, $row, $cellContent);
}
++$row;
// echo 'LIST ENTRY: ' , '
';
- $this->_processDomElement($child, $sheet, $row, $column, $cellContent);
+ $this->processDomElement($child, $sheet, $row, $column, $cellContent);
// echo 'END OF LIST ENTRY:' , '
';
- $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 , '
';
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 , '
';
- $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
';
- $this->_processDomElement($child, $sheet, $row, $column, $cellContent);
+ $this->processDomElement($child, $sheet, $row, $column, $cellContent);
++$row;
// echo 'END OF TABLE ' , $this->_tableLevel , ' ROW
';
break;
case 'th':
case 'td':
// echo 'START OF TABLE ' , $this->_tableLevel , ' CELL
';
- $this->_processDomElement($child, $sheet, $row, $column, $cellContent);
+ $this->processDomElement($child, $sheet, $row, $column, $cellContent);
// echo 'END OF TABLE ' , $this->_tableLevel , ' CELL
';
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;
}
diff --git a/Classes/PHPExcel/Reader/IReadFilter.php b/Classes/PHPExcel/Reader/IReadFilter.php
index 0006cf3d..f7c852d9 100644
--- a/Classes/PHPExcel/Reader/IReadFilter.php
+++ b/Classes/PHPExcel/Reader/IReadFilter.php
@@ -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 = '');
}
diff --git a/Classes/PHPExcel/Reader/IReader.php b/Classes/PHPExcel/Reader/IReader.php
index 79d098f8..90345464 100644
--- a/Classes/PHPExcel/Reader/IReader.php
+++ b/Classes/PHPExcel/Reader/IReader.php
@@ -1,6 +1,7 @@
_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 '
';
- 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);
diff --git a/Classes/PHPExcel/Reader/SYLK.php b/Classes/PHPExcel/Reader/SYLK.php
index a7f3f172..eb7ef1af 100644
--- a/Classes/PHPExcel/Reader/SYLK.php
+++ b/Classes/PHPExcel/Reader/SYLK.php
@@ -1,6 +1,16 @@
_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
diff --git a/Classes/PHPExcel/Shared/CodePage.php b/Classes/PHPExcel/Shared/CodePage.php
index 13c166a3..b9df3b4d 100644
--- a/Classes/PHPExcel/Shared/CodePage.php
+++ b/Classes/PHPExcel/Shared/CodePage.php
@@ -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);
}
diff --git a/Classes/PHPExcel/Shared/OLERead.php b/Classes/PHPExcel/Shared/OLERead.php
index 48b24eed..6b15d970 100644
--- a/Classes/PHPExcel/Shared/OLERead.php
+++ b/Classes/PHPExcel/Shared/OLERead.php
@@ -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
diff --git a/Classes/PHPExcel/Worksheet/AutoFilter.php b/Classes/PHPExcel/Worksheet/AutoFilter.php
index e86f9783..6ec8a446 100644
--- a/Classes/PHPExcel/Worksheet/AutoFilter.php
+++ b/Classes/PHPExcel/Worksheet/AutoFilter.php
@@ -1,6 +1,7 @@
_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;
}
}
diff --git a/Classes/PHPExcel/Worksheet/AutoFilter/Column.php b/Classes/PHPExcel/Worksheet/AutoFilter/Column.php
index e30cb3cd..d64fd816 100644
--- a/Classes/PHPExcel/Worksheet/AutoFilter/Column.php
+++ b/Classes/PHPExcel/Worksheet/AutoFilter/Column.php
@@ -1,6 +1,7 @@
_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) {
diff --git a/Classes/PHPExcel/Worksheet/AutoFilter/Column/Rule.php b/Classes/PHPExcel/Worksheet/AutoFilter/Column/Rule.php
index 2250bcde..39ad18bf 100644
--- a/Classes/PHPExcel/Worksheet/AutoFilter/Column/Rule.php
+++ b/Classes/PHPExcel/Worksheet/AutoFilter/Column/Rule.php
@@ -1,6 +1,7 @@
*
*/
- 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 {
diff --git a/Classes/PHPExcel/Worksheet/BaseDrawing.php b/Classes/PHPExcel/Worksheet/BaseDrawing.php
index 9ae35adc..d63c2821 100644
--- a/Classes/PHPExcel/Worksheet/BaseDrawing.php
+++ b/Classes/PHPExcel/Worksheet/BaseDrawing.php
@@ -1,6 +1,7 @@
_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__
+ );
}
/**
diff --git a/Classes/PHPExcel/Worksheet/Drawing.php b/Classes/PHPExcel/Worksheet/Drawing.php
index 983bda48..e259c3c3 100644
--- a/Classes/PHPExcel/Worksheet/Drawing.php
+++ b/Classes/PHPExcel/Worksheet/Drawing.php
@@ -1,6 +1,7 @@
_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__
);
}
diff --git a/Classes/PHPExcel/Worksheet/Drawing/Shadow.php b/Classes/PHPExcel/Worksheet/Drawing/Shadow.php
index 9806bb90..84db91d5 100644
--- a/Classes/PHPExcel/Worksheet/Drawing/Shadow.php
+++ b/Classes/PHPExcel/Worksheet/Drawing/Shadow.php
@@ -1,6 +1,7 @@
_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__
);
}
diff --git a/Classes/PHPExcel/Worksheet/HeaderFooter.php b/Classes/PHPExcel/Worksheet/HeaderFooter.php
index 394baf7c..3a88923f 100644
--- a/Classes/PHPExcel/Worksheet/HeaderFooter.php
+++ b/Classes/PHPExcel/Worksheet/HeaderFooter.php
@@ -1,6 +1,6 @@
* 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"
*
*
- * @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;
}
/**
diff --git a/Classes/PHPExcel/Worksheet/HeaderFooterDrawing.php b/Classes/PHPExcel/Worksheet/HeaderFooterDrawing.php
index 6c1fa1f2..a491f4ba 100644
--- a/Classes/PHPExcel/Worksheet/HeaderFooterDrawing.php
+++ b/Classes/PHPExcel/Worksheet/HeaderFooterDrawing.php
@@ -1,6 +1,7 @@
_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__
);
}
diff --git a/Classes/PHPExcel/Worksheet/MemoryDrawing.php b/Classes/PHPExcel/Worksheet/MemoryDrawing.php
index 04f8d110..119a7520 100644
--- a/Classes/PHPExcel/Worksheet/MemoryDrawing.php
+++ b/Classes/PHPExcel/Worksheet/MemoryDrawing.php
@@ -1,6 +1,7 @@
_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__
);
}
diff --git a/Classes/PHPExcel/Worksheet/PageSetup.php b/Classes/PHPExcel/Worksheet/PageSetup.php
index 1e9df19e..c67053e6 100644
--- a/Classes/PHPExcel/Worksheet/PageSetup.php
+++ b/Classes/PHPExcel/Worksheet/PageSetup.php
@@ -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;
}
diff --git a/Classes/PHPExcel/Writer/Abstract.php b/Classes/PHPExcel/Writer/Abstract.php
index a0f14100..e6e130de 100644
--- a/Classes/PHPExcel/Writer/Abstract.php
+++ b/Classes/PHPExcel/Writer/Abstract.php
@@ -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;
}
diff --git a/Classes/PHPExcel/Writer/Excel2007.php b/Classes/PHPExcel/Writer/Excel2007.php
index 1b241018..5b812cc1 100644
--- a/Classes/PHPExcel/Writer/Excel2007.php
+++ b/Classes/PHPExcel/Writer/Excel2007.php
@@ -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
diff --git a/Classes/PHPExcel/Writer/HTML.php b/Classes/PHPExcel/Writer/HTML.php
index eecc6ec6..746ec55d 100644
--- a/Classes/PHPExcel/Writer/HTML.php
+++ b/Classes/PHPExcel/Writer/HTML.php
@@ -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 = '' . PHP_EOL;
$html .= '' . PHP_EOL;
$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);
}
// ?
@@ -481,17 +481,17 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
$html .= ' ' . PHP_EOL;
}
}
- $html .= $this->_extendRowsForChartsAndImages($sheet, $row);
+ $html .= $this->extendRowsForChartsAndImages($sheet, $row);
// Close table body.
$html .= ' ' . 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 .= '';
}
}
@@ -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 .= '';
for ($col = 'A'; $col != $colMax; ++$col) {
$html .= '';
- $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 .= ' ';
}
@@ -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 .= '