minor architecture improvement
- used strtoupper to get rid of case sensitive name checks - added "else if", it's not nessecary to check for the second "if", if the first one was allready true
This commit is contained in:
parent
aadc933827
commit
acca05f1cf
@ -251,19 +251,22 @@ class PHPExcel_Shared_OLERead {
|
|||||||
|
|
||||||
$name = str_replace("\x00", "", substr($d,0,$nameSize));
|
$name = str_replace("\x00", "", substr($d,0,$nameSize));
|
||||||
|
|
||||||
|
|
||||||
$this->props[] = array (
|
$this->props[] = array (
|
||||||
'name' => $name,
|
'name' => $name,
|
||||||
'type' => $type,
|
'type' => $type,
|
||||||
'startBlock' => $startBlock,
|
'startBlock' => $startBlock,
|
||||||
'size' => $size);
|
'size' => $size);
|
||||||
|
|
||||||
|
// tmp helper to simplify checks
|
||||||
|
$upName = strtoupper($name);
|
||||||
|
|
||||||
// Workbook directory entry (BIFF5 uses Book, BIFF8 uses Workbook)
|
// Workbook directory entry (BIFF5 uses Book, BIFF8 uses Workbook)
|
||||||
if (($name == 'Workbook') || ($name == 'Book') || ($name == 'WORKBOOK') || ($name == 'BOOK')) {
|
if (($upName === 'WORKBOOK') || ($upName === 'BOOK')) {
|
||||||
$this->wrkbook = count($this->props) - 1;
|
$this->wrkbook = count($this->props) - 1;
|
||||||
}
|
}
|
||||||
|
else if ( $upName === 'ROOT ENTRY' || $upName === 'R') {
|
||||||
// Root entry
|
// Root entry
|
||||||
if ($name == 'Root Entry' || $name == 'ROOT ENTRY' || $name == 'R') {
|
|
||||||
$this->rootentry = count($this->props) - 1;
|
$this->rootentry = count($this->props) - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user