More namespacing work
This commit is contained in:
parent
0dafaea059
commit
54d2f72a0a
|
@ -781,7 +781,7 @@ class Worksheet implements IComparable
|
|||
* @param PHPExcel $parent
|
||||
* @return Worksheet
|
||||
*/
|
||||
public function rebindParent(PHPExcel $parent)
|
||||
public function rebindParent(Spreadsheet $parent)
|
||||
{
|
||||
if ($this->parent !== null) {
|
||||
$namedRanges = $this->parent->getNamedRanges();
|
||||
|
|
|
@ -32,7 +32,7 @@ class AutoFilter
|
|||
/**
|
||||
* Autofilter Worksheet
|
||||
*
|
||||
* @var PHPExcel_Worksheet
|
||||
* @var \PHPExcel\Worksheet
|
||||
*/
|
||||
private $workSheet;
|
||||
|
||||
|
@ -48,16 +48,16 @@ class AutoFilter
|
|||
/**
|
||||
* Autofilter Column Ruleset
|
||||
*
|
||||
* @var array of PHPExcel_Worksheet_AutoFilter_Column
|
||||
* @var AutoFilter\Column[]
|
||||
*/
|
||||
private $columns = array();
|
||||
|
||||
|
||||
/**
|
||||
* Create a new PHPExcel_Worksheet_AutoFilter
|
||||
* Create a new AutoFilter
|
||||
*
|
||||
* @param string $pRange Cell range (i.e. A1:E10)
|
||||
* @param PHPExcel_Worksheet $pSheet
|
||||
* @param string $pRange Cell range (i.e. A1:E10)
|
||||
* @param \PHPExcel\Worksheet $pSheet
|
||||
*/
|
||||
public function __construct($pRange = '', \PHPExcel\Worksheet $pSheet = null)
|
||||
{
|
||||
|
@ -68,7 +68,7 @@ class AutoFilter
|
|||
/**
|
||||
* Get AutoFilter Parent Worksheet
|
||||
*
|
||||
* @return PHPExcel_Worksheet
|
||||
* @return \PHPExcel\Worksheet
|
||||
*/
|
||||
public function getParent()
|
||||
{
|
||||
|
@ -78,8 +78,8 @@ class AutoFilter
|
|||
/**
|
||||
* Set AutoFilter Parent Worksheet
|
||||
*
|
||||
* @param PHPExcel_Worksheet $pSheet
|
||||
* @return PHPExcel_Worksheet_AutoFilter
|
||||
* @param \PHPExcel\Worksheet $pSheet
|
||||
* @return AutoFilter
|
||||
*/
|
||||
public function setParent(\PHPExcel\Worksheet $pSheet = null)
|
||||
{
|
||||
|
@ -101,9 +101,9 @@ class AutoFilter
|
|||
/**
|
||||
* Set AutoFilter Range
|
||||
*
|
||||
* @param string $pRange Cell range (i.e. A1:E10)
|
||||
* @throws PHPExcel_Exception
|
||||
* @return PHPExcel_Worksheet_AutoFilter
|
||||
* @param string $pRange Cell range (i.e. A1:E10)
|
||||
* @throws \PHPExcel\Exception
|
||||
* @return AutoFilter
|
||||
*/
|
||||
public function setRange($pRange = '')
|
||||
{
|
||||
|
@ -118,7 +118,7 @@ class AutoFilter
|
|||
} elseif (empty($pRange)) {
|
||||
$this->range = '';
|
||||
} else {
|
||||
throw new PHPExcel_Exception('Autofilter must be set on a range of cells.');
|
||||
throw new \PHPExcel\Exception('Autofilter must be set on a range of cells.');
|
||||
}
|
||||
|
||||
if (empty($pRange)) {
|
||||
|
@ -126,9 +126,9 @@ class AutoFilter
|
|||
$this->columns = array();
|
||||
} else {
|
||||
// Discard any column rules that are no longer valid within this range
|
||||
list($rangeStart, $rangeEnd) = PHPExcel_Cell::rangeBoundaries($this->range);
|
||||
list($rangeStart, $rangeEnd) = \PHPExcel\Cell::rangeBoundaries($this->range);
|
||||
foreach ($this->columns as $key => $value) {
|
||||
$colIndex = PHPExcel_Cell::columnIndexFromString($key);
|
||||
$colIndex = \PHPExcel\Cell::columnIndexFromString($key);
|
||||
if (($rangeStart[0] > $colIndex) || ($rangeEnd[0] < $colIndex)) {
|
||||
unset($this->columns[$key]);
|
||||
}
|
||||
|
@ -141,8 +141,8 @@ class AutoFilter
|
|||
/**
|
||||
* Get all AutoFilter Columns
|
||||
*
|
||||
* @throws PHPExcel_Exception
|
||||
* @return array of PHPExcel_Worksheet_AutoFilter_Column
|
||||
* @throws \PHPExcel\Exception
|
||||
* @return AutoFilter\Column[]
|
||||
*/
|
||||
public function getColumns()
|
||||
{
|
||||
|
@ -152,20 +152,20 @@ class AutoFilter
|
|||
/**
|
||||
* Validate that the specified column is in the AutoFilter range
|
||||
*
|
||||
* @param string $column Column name (e.g. A)
|
||||
* @throws PHPExcel_Exception
|
||||
* @param string $column Column name (e.g. A)
|
||||
* @throws \PHPExcel\Exception
|
||||
* @return integer The column offset within the autofilter range
|
||||
*/
|
||||
public function testColumnInRange($column)
|
||||
{
|
||||
if (empty($this->range)) {
|
||||
throw new PHPExcel_Exception("No autofilter range is defined.");
|
||||
throw new \PHPExcel\Exception("No autofilter range is defined.");
|
||||
}
|
||||
|
||||
$columnIndex = PHPExcel_Cell::columnIndexFromString($column);
|
||||
list($rangeStart, $rangeEnd) = PHPExcel_Cell::rangeBoundaries($this->range);
|
||||
$columnIndex = \PHPExcel\Cell::columnIndexFromString($column);
|
||||
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.");
|
||||
throw new \PHPExcel\Exception("Column is outside of current autofilter range.");
|
||||
}
|
||||
|
||||
return $columnIndex - $rangeStart[0];
|
||||
|
@ -175,7 +175,7 @@ class AutoFilter
|
|||
* Get a specified AutoFilter Column Offset within the defined AutoFilter range
|
||||
*
|
||||
* @param string $pColumn Column name (e.g. A)
|
||||
* @throws PHPExcel_Exception
|
||||
* @throws \PHPExcel\Exception
|
||||
* @return integer The offset of the specified column within the autofilter range
|
||||
*/
|
||||
public function getColumnOffset($pColumn)
|
||||
|
@ -187,15 +187,15 @@ class AutoFilter
|
|||
* Get a specified AutoFilter Column
|
||||
*
|
||||
* @param string $pColumn Column name (e.g. A)
|
||||
* @throws PHPExcel_Exception
|
||||
* @return PHPExcel_Worksheet_AutoFilter_Column
|
||||
* @throws \PHPExcel\Exception
|
||||
* @return AutoFilter\Column
|
||||
*/
|
||||
public function getColumn($pColumn)
|
||||
{
|
||||
$this->testColumnInRange($pColumn);
|
||||
|
||||
if (!isset($this->columns[$pColumn])) {
|
||||
$this->columns[$pColumn] = new PHPExcel_Worksheet_AutoFilter_Column($pColumn, $this);
|
||||
$this->columns[$pColumn] = new AutoFilter\Column($pColumn, $this);
|
||||
}
|
||||
|
||||
return $this->columns[$pColumn];
|
||||
|
@ -205,13 +205,13 @@ class AutoFilter
|
|||
* Get a specified AutoFilter Column by it's offset
|
||||
*
|
||||
* @param integer $pColumnOffset Column offset within range (starting from 0)
|
||||
* @throws PHPExcel_Exception
|
||||
* @return PHPExcel_Worksheet_AutoFilter_Column
|
||||
* @throws \PHPExcel\Exception
|
||||
* @return AutoFilter\Column
|
||||
*/
|
||||
public function getColumnByOffset($pColumnOffset = 0)
|
||||
{
|
||||
list($rangeStart, $rangeEnd) = PHPExcel_Cell::rangeBoundaries($this->range);
|
||||
$pColumn = PHPExcel_Cell::stringFromColumnIndex($rangeStart[0] + $pColumnOffset - 1);
|
||||
list($rangeStart, $rangeEnd) = \PHPExcel\Cell::rangeBoundaries($this->range);
|
||||
$pColumn = \PHPExcel\Cell::stringFromColumnIndex($rangeStart[0] + $pColumnOffset - 1);
|
||||
|
||||
return $this->getColumn($pColumn);
|
||||
}
|
||||
|
@ -219,25 +219,25 @@ class AutoFilter
|
|||
/**
|
||||
* Set AutoFilter
|
||||
*
|
||||
* @param PHPExcel_Worksheet_AutoFilter_Column|string $pColumn
|
||||
* @param AutoFilter\Column|string $pColumn
|
||||
* A simple string containing a Column ID like 'A' is permitted
|
||||
* @throws PHPExcel_Exception
|
||||
* @return PHPExcel_Worksheet_AutoFilter
|
||||
* @throws \PHPExcel\Exception
|
||||
* @return AutoFilter
|
||||
*/
|
||||
public function setColumn($pColumn)
|
||||
{
|
||||
if ((is_string($pColumn)) && (!empty($pColumn))) {
|
||||
$column = $pColumn;
|
||||
} elseif (is_object($pColumn) && ($pColumn instanceof PHPExcel_Worksheet_AutoFilter_Column)) {
|
||||
} elseif (is_object($pColumn) && ($pColumn instanceof AutoFilter\Column)) {
|
||||
$column = $pColumn->getColumnIndex();
|
||||
} else {
|
||||
throw new PHPExcel_Exception("Column is not within the autofilter range.");
|
||||
throw new \PHPExcel\Exception("Column is not within the autofilter range.");
|
||||
}
|
||||
$this->testColumnInRange($column);
|
||||
|
||||
if (is_string($pColumn)) {
|
||||
$this->columns[$pColumn] = new PHPExcel_Worksheet_AutoFilter_Column($pColumn, $this);
|
||||
} elseif (is_object($pColumn) && ($pColumn instanceof PHPExcel_Worksheet_AutoFilter_Column)) {
|
||||
$this->columns[$pColumn] = new AutoFilter\Column($pColumn, $this);
|
||||
} elseif (is_object($pColumn) && ($pColumn instanceof AutoFilter\Column)) {
|
||||
$pColumn->setParent($this);
|
||||
$this->columns[$column] = $pColumn;
|
||||
}
|
||||
|
@ -249,9 +249,9 @@ class AutoFilter
|
|||
/**
|
||||
* Clear a specified AutoFilter Column
|
||||
*
|
||||
* @param string $pColumn Column name (e.g. A)
|
||||
* @throws PHPExcel_Exception
|
||||
* @return PHPExcel_Worksheet_AutoFilter
|
||||
* @param string $pColumn Column name (e.g. A)
|
||||
* @throws \PHPExcel\Exception
|
||||
* @return AutoFilter
|
||||
*/
|
||||
public function clearColumn($pColumn)
|
||||
{
|
||||
|
@ -273,7 +273,7 @@ class AutoFilter
|
|||
*
|
||||
* @param string $fromColumn Column name (e.g. A)
|
||||
* @param string $toColumn Column name (e.g. B)
|
||||
* @return PHPExcel_Worksheet_AutoFilter
|
||||
* @return AutoFilter
|
||||
*/
|
||||
public function shiftColumn($fromColumn = null, $toColumn = null)
|
||||
{
|
||||
|
@ -327,7 +327,7 @@ class AutoFilter
|
|||
}
|
||||
|
||||
if (is_numeric($cellValue)) {
|
||||
$dateValue = PHPExcel_Shared_Date::ExcelToPHP($cellValue);
|
||||
$dateValue = \PHPExcel\Shared\Date::ExcelToPHP($cellValue);
|
||||
if ($cellValue < 1) {
|
||||
// Just the time part
|
||||
$dtVal = date('His', $dateValue);
|
||||
|
@ -370,36 +370,36 @@ class AutoFilter
|
|||
return false;
|
||||
}
|
||||
}
|
||||
$returnVal = ($join == PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_COLUMN_JOIN_AND);
|
||||
$returnVal = ($join == AutoFilter\Column::AUTOFILTER_COLUMN_JOIN_AND);
|
||||
foreach ($dataSet as $rule) {
|
||||
if (is_numeric($rule['value'])) {
|
||||
// Numeric values are tested using the appropriate operator
|
||||
switch ($rule['operator']) {
|
||||
case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_EQUAL:
|
||||
case AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL:
|
||||
$retVal = ($cellValue == $rule['value']);
|
||||
break;
|
||||
case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_NOTEQUAL:
|
||||
case AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_NOTEQUAL:
|
||||
$retVal = ($cellValue != $rule['value']);
|
||||
break;
|
||||
case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_GREATERTHAN:
|
||||
case AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_GREATERTHAN:
|
||||
$retVal = ($cellValue > $rule['value']);
|
||||
break;
|
||||
case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_GREATERTHANOREQUAL:
|
||||
case AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_GREATERTHANOREQUAL:
|
||||
$retVal = ($cellValue >= $rule['value']);
|
||||
break;
|
||||
case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_LESSTHAN:
|
||||
case AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_LESSTHAN:
|
||||
$retVal = ($cellValue < $rule['value']);
|
||||
break;
|
||||
case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_LESSTHANOREQUAL:
|
||||
case AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_LESSTHANOREQUAL:
|
||||
$retVal = ($cellValue <= $rule['value']);
|
||||
break;
|
||||
}
|
||||
} elseif ($rule['value'] == '') {
|
||||
switch ($rule['operator']) {
|
||||
case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_EQUAL:
|
||||
case AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL:
|
||||
$retVal = (($cellValue == '') || ($cellValue === null));
|
||||
break;
|
||||
case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_NOTEQUAL:
|
||||
case AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_NOTEQUAL:
|
||||
$retVal = (($cellValue != '') && ($cellValue !== null));
|
||||
break;
|
||||
default:
|
||||
|
@ -412,7 +412,7 @@ class AutoFilter
|
|||
}
|
||||
// If there are multiple conditions, then we need to test both using the appropriate join operator
|
||||
switch ($join) {
|
||||
case PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_COLUMN_JOIN_OR:
|
||||
case AutoFilter\Column::AUTOFILTER_COLUMN_JOIN_OR:
|
||||
$returnVal = $returnVal || $retVal;
|
||||
// Break as soon as we have a TRUE match for OR joins,
|
||||
// to avoid unnecessary additional code execution
|
||||
|
@ -420,7 +420,7 @@ class AutoFilter
|
|||
return $returnVal;
|
||||
}
|
||||
break;
|
||||
case PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_COLUMN_JOIN_AND:
|
||||
case AutoFilter\Column::AUTOFILTER_COLUMN_JOIN_AND:
|
||||
$returnVal = $returnVal && $retVal;
|
||||
break;
|
||||
}
|
||||
|
@ -444,7 +444,7 @@ class AutoFilter
|
|||
}
|
||||
|
||||
if (is_numeric($cellValue)) {
|
||||
$dateValue = date('m', PHPExcel_Shared_Date::ExcelToPHP($cellValue));
|
||||
$dateValue = date('m', \PHPExcel\Shared\Date::ExcelToPHP($cellValue));
|
||||
if (in_array($dateValue, $monthSet)) {
|
||||
return true;
|
||||
}
|
||||
|
@ -465,96 +465,96 @@ class AutoFilter
|
|||
/**
|
||||
* Convert a dynamic rule daterange to a custom filter range expression for ease of calculation
|
||||
*
|
||||
* @param string $dynamicRuleType
|
||||
* @param PHPExcel_Worksheet_AutoFilter_Column &$filterColumn
|
||||
* @param string $dynamicRuleType
|
||||
* @param AutoFilter\Column &$filterColumn
|
||||
* @return mixed[]
|
||||
*/
|
||||
private function dynamicFilterDateRange($dynamicRuleType, &$filterColumn)
|
||||
{
|
||||
$rDateType = PHPExcel_Calculation_Functions::getReturnDateType();
|
||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
|
||||
$rDateType = \PHPExcel\Calculation\Functions::getReturnDateType();
|
||||
\PHPExcel\Calculation\Functions::setReturnDateType(\PHPExcel\Calculation\Functions::RETURNDATE_PHP_NUMERIC);
|
||||
$val = $maxVal = null;
|
||||
|
||||
$ruleValues = array();
|
||||
$baseDate = PHPExcel_Calculation_DateTime::DATENOW();
|
||||
$baseDate = \PHPExcel\Calculation\DateTime::DATENOW();
|
||||
// Calculate start/end dates for the required date range based on current date
|
||||
switch ($dynamicRuleType) {
|
||||
case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTWEEK:
|
||||
case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTWEEK:
|
||||
$baseDate = strtotime('-7 days', $baseDate);
|
||||
break;
|
||||
case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTWEEK:
|
||||
case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTWEEK:
|
||||
$baseDate = strtotime('-7 days', $baseDate);
|
||||
break;
|
||||
case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTMONTH:
|
||||
case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTMONTH:
|
||||
$baseDate = strtotime('-1 month', gmmktime(0, 0, 0, 1, date('m', $baseDate), date('Y', $baseDate)));
|
||||
break;
|
||||
case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTMONTH:
|
||||
case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTMONTH:
|
||||
$baseDate = strtotime('+1 month', gmmktime(0, 0, 0, 1, date('m', $baseDate), date('Y', $baseDate)));
|
||||
break;
|
||||
case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTQUARTER:
|
||||
case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTQUARTER:
|
||||
$baseDate = strtotime('-3 month', gmmktime(0, 0, 0, 1, date('m', $baseDate), date('Y', $baseDate)));
|
||||
break;
|
||||
case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTQUARTER:
|
||||
case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTQUARTER:
|
||||
$baseDate = strtotime('+3 month', gmmktime(0, 0, 0, 1, date('m', $baseDate), date('Y', $baseDate)));
|
||||
break;
|
||||
case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTYEAR:
|
||||
case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTYEAR:
|
||||
$baseDate = strtotime('-1 year', gmmktime(0, 0, 0, 1, date('m', $baseDate), date('Y', $baseDate)));
|
||||
break;
|
||||
case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTYEAR:
|
||||
case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTYEAR:
|
||||
$baseDate = strtotime('+1 year', gmmktime(0, 0, 0, 1, date('m', $baseDate), date('Y', $baseDate)));
|
||||
break;
|
||||
}
|
||||
|
||||
switch ($dynamicRuleType) {
|
||||
case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_TODAY:
|
||||
case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_YESTERDAY:
|
||||
case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_TOMORROW:
|
||||
$maxVal = (int) PHPExcel_Shared_Date::PHPtoExcel(strtotime('+1 day', $baseDate));
|
||||
$val = (int) PHPExcel_Shared_Date::PHPToExcel($baseDate);
|
||||
case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_TODAY:
|
||||
case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_YESTERDAY:
|
||||
case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_TOMORROW:
|
||||
$maxVal = (int) \PHPExcel\Shared\Date::PHPtoExcel(strtotime('+1 day', $baseDate));
|
||||
$val = (int) \PHPExcel\Shared\Date::PHPToExcel($baseDate);
|
||||
break;
|
||||
case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_YEARTODATE:
|
||||
$maxVal = (int) PHPExcel_Shared_Date::PHPtoExcel(strtotime('+1 day', $baseDate));
|
||||
$val = (int) PHPExcel_Shared_Date::PHPToExcel(gmmktime(0, 0, 0, 1, 1, date('Y', $baseDate)));
|
||||
case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_YEARTODATE:
|
||||
$maxVal = (int) \PHPExcel\Shared\Date::PHPtoExcel(strtotime('+1 day', $baseDate));
|
||||
$val = (int) \PHPExcel\Shared\Date::PHPToExcel(gmmktime(0, 0, 0, 1, 1, date('Y', $baseDate)));
|
||||
break;
|
||||
case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_THISYEAR:
|
||||
case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTYEAR:
|
||||
case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTYEAR:
|
||||
$maxVal = (int) PHPExcel_Shared_Date::PHPToExcel(gmmktime(0, 0, 0, 31, 12, date('Y', $baseDate)));
|
||||
case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_THISYEAR:
|
||||
case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTYEAR:
|
||||
case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTYEAR:
|
||||
$maxVal = (int) \PHPExcel\Shared\Date::PHPToExcel(gmmktime(0, 0, 0, 31, 12, date('Y', $baseDate)));
|
||||
++$maxVal;
|
||||
$val = (int) PHPExcel_Shared_Date::PHPToExcel(gmmktime(0, 0, 0, 1, 1, date('Y', $baseDate)));
|
||||
$val = (int) \PHPExcel\Shared\Date::PHPToExcel(gmmktime(0, 0, 0, 1, 1, date('Y', $baseDate)));
|
||||
break;
|
||||
case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_THISQUARTER:
|
||||
case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTQUARTER:
|
||||
case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTQUARTER:
|
||||
case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_THISQUARTER:
|
||||
case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTQUARTER:
|
||||
case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTQUARTER:
|
||||
$thisMonth = date('m', $baseDate);
|
||||
$thisQuarter = floor(--$thisMonth / 3);
|
||||
$maxVal = (int) PHPExcel_Shared_Date::PHPtoExcel(gmmktime(0, 0, 0, date('t', $baseDate), (1+$thisQuarter)*3, date('Y', $baseDate)));
|
||||
$maxVal = (int) \PHPExcel\Shared\Date::PHPtoExcel(gmmktime(0, 0, 0, date('t', $baseDate), (1+$thisQuarter)*3, date('Y', $baseDate)));
|
||||
++$maxVal;
|
||||
$val = (int) PHPExcel_Shared_Date::PHPToExcel(gmmktime(0, 0, 0, 1, 1+$thisQuarter*3, date('Y', $baseDate)));
|
||||
$val = (int) \PHPExcel\Shared\Date::PHPToExcel(gmmktime(0, 0, 0, 1, 1+$thisQuarter*3, date('Y', $baseDate)));
|
||||
break;
|
||||
case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_THISMONTH:
|
||||
case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTMONTH:
|
||||
case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTMONTH:
|
||||
$maxVal = (int) PHPExcel_Shared_Date::PHPtoExcel(gmmktime(0, 0, 0, date('t', $baseDate), date('m', $baseDate), date('Y', $baseDate)));
|
||||
case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_THISMONTH:
|
||||
case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTMONTH:
|
||||
case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTMONTH:
|
||||
$maxVal = (int) \PHPExcel\Shared\Date::PHPtoExcel(gmmktime(0, 0, 0, date('t', $baseDate), date('m', $baseDate), date('Y', $baseDate)));
|
||||
++$maxVal;
|
||||
$val = (int) PHPExcel_Shared_Date::PHPToExcel(gmmktime(0, 0, 0, 1, date('m', $baseDate), date('Y', $baseDate)));
|
||||
$val = (int) \PHPExcel\Shared\Date::PHPToExcel(gmmktime(0, 0, 0, 1, date('m', $baseDate), date('Y', $baseDate)));
|
||||
break;
|
||||
case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_THISWEEK:
|
||||
case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTWEEK:
|
||||
case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTWEEK:
|
||||
case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_THISWEEK:
|
||||
case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTWEEK:
|
||||
case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTWEEK:
|
||||
$dayOfWeek = date('w', $baseDate);
|
||||
$val = (int) PHPExcel_Shared_Date::PHPToExcel($baseDate) - $dayOfWeek;
|
||||
$val = (int) \PHPExcel\Shared\Date::PHPToExcel($baseDate) - $dayOfWeek;
|
||||
$maxVal = $val + 7;
|
||||
break;
|
||||
}
|
||||
|
||||
switch ($dynamicRuleType) {
|
||||
// Adjust Today dates for Yesterday and Tomorrow
|
||||
case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_YESTERDAY:
|
||||
case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_YESTERDAY:
|
||||
--$maxVal;
|
||||
--$val;
|
||||
break;
|
||||
case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_TOMORROW:
|
||||
case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_TOMORROW:
|
||||
++$maxVal;
|
||||
++$val;
|
||||
break;
|
||||
|
@ -564,20 +564,20 @@ class AutoFilter
|
|||
$filterColumn->setAttributes(array('val' => $val, 'maxVal' => $maxVal));
|
||||
|
||||
// Set the rules for identifying rows for hide/show
|
||||
$ruleValues[] = array('operator' => PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_GREATERTHANOREQUAL, 'value' => $val);
|
||||
$ruleValues[] = array('operator' => PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_LESSTHAN, 'value' => $maxVal);
|
||||
PHPExcel_Calculation_Functions::setReturnDateType($rDateType);
|
||||
$ruleValues[] = array('operator' => AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_GREATERTHANOREQUAL, 'value' => $val);
|
||||
$ruleValues[] = array('operator' => 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' => AutoFilter\Column::AUTOFILTER_COLUMN_JOIN_AND));
|
||||
}
|
||||
|
||||
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) {
|
||||
if ($ruleType == AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_TOP) {
|
||||
rsort($dataValues);
|
||||
} else {
|
||||
sort($dataValues);
|
||||
|
@ -589,12 +589,12 @@ class AutoFilter
|
|||
/**
|
||||
* Apply the AutoFilter rules to the AutoFilter Range
|
||||
*
|
||||
* @throws PHPExcel_Exception
|
||||
* @return PHPExcel_Worksheet_AutoFilter
|
||||
* @throws \PHPExcel\Exception
|
||||
* @return 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;
|
||||
|
@ -604,7 +604,7 @@ class AutoFilter
|
|||
foreach ($this->columns as $columnID => $filterColumn) {
|
||||
$rules = $filterColumn->getRules();
|
||||
switch ($filterColumn->getFilterType()) {
|
||||
case PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_FILTER:
|
||||
case AutoFilter\Column::AUTOFILTER_FILTERTYPE_FILTER:
|
||||
$ruleValues = array();
|
||||
// Build a list of the filter value selections
|
||||
foreach ($rules as $rule) {
|
||||
|
@ -617,7 +617,7 @@ class AutoFilter
|
|||
if (count($ruleValues) != count($ruleDataSet)) {
|
||||
$blanks = true;
|
||||
}
|
||||
if ($ruleType == PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_FILTER) {
|
||||
if ($ruleType == AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_FILTER) {
|
||||
// Filter on absolute values
|
||||
$columnFilterTests[$columnID] = array(
|
||||
'method' => 'filterTestInSimpleDataSet',
|
||||
|
@ -632,29 +632,29 @@ class AutoFilter
|
|||
);
|
||||
foreach ($ruleDataSet as $ruleValue) {
|
||||
$date = $time = '';
|
||||
if ((isset($ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_YEAR])) &&
|
||||
($ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_YEAR] !== '')) {
|
||||
$date .= sprintf('%04d', $ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_YEAR]);
|
||||
if ((isset($ruleValue[AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP_YEAR])) &&
|
||||
($ruleValue[AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP_YEAR] !== '')) {
|
||||
$date .= sprintf('%04d', $ruleValue[AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP_YEAR]);
|
||||
}
|
||||
if ((isset($ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_MONTH])) &&
|
||||
($ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_MONTH] != '')) {
|
||||
$date .= sprintf('%02d', $ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_MONTH]);
|
||||
if ((isset($ruleValue[AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP_MONTH])) &&
|
||||
($ruleValue[AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP_MONTH] != '')) {
|
||||
$date .= sprintf('%02d', $ruleValue[AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP_MONTH]);
|
||||
}
|
||||
if ((isset($ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_DAY])) &&
|
||||
($ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_DAY] !== '')) {
|
||||
$date .= sprintf('%02d', $ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_DAY]);
|
||||
if ((isset($ruleValue[AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP_DAY])) &&
|
||||
($ruleValue[AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP_DAY] !== '')) {
|
||||
$date .= sprintf('%02d', $ruleValue[AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP_DAY]);
|
||||
}
|
||||
if ((isset($ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_HOUR])) &&
|
||||
($ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_HOUR] !== '')) {
|
||||
$time .= sprintf('%02d', $ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_HOUR]);
|
||||
if ((isset($ruleValue[AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP_HOUR])) &&
|
||||
($ruleValue[AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP_HOUR] !== '')) {
|
||||
$time .= sprintf('%02d', $ruleValue[AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP_HOUR]);
|
||||
}
|
||||
if ((isset($ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_MINUTE])) &&
|
||||
($ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_MINUTE] !== '')) {
|
||||
$time .= sprintf('%02d', $ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_MINUTE]);
|
||||
if ((isset($ruleValue[AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP_MINUTE])) &&
|
||||
($ruleValue[AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP_MINUTE] !== '')) {
|
||||
$time .= sprintf('%02d', $ruleValue[AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP_MINUTE]);
|
||||
}
|
||||
if ((isset($ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_SECOND])) &&
|
||||
($ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_SECOND] !== '')) {
|
||||
$time .= sprintf('%02d', $ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_SECOND]);
|
||||
if ((isset($ruleValue[AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP_SECOND])) &&
|
||||
($ruleValue[AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP_SECOND] !== '')) {
|
||||
$time .= sprintf('%02d', $ruleValue[AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP_SECOND]);
|
||||
}
|
||||
$dateTime = $date . $time;
|
||||
$arguments['date'][] = $date;
|
||||
|
@ -671,7 +671,7 @@ class AutoFilter
|
|||
);
|
||||
}
|
||||
break;
|
||||
case PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_CUSTOMFILTER:
|
||||
case AutoFilter\Column::AUTOFILTER_FILTERTYPE_CUSTOMFILTER:
|
||||
$customRuleForBlanks = false;
|
||||
$ruleValues = array();
|
||||
// Build a list of the filter value selections
|
||||
|
@ -695,27 +695,27 @@ class AutoFilter
|
|||
'arguments' => array('filterRules' => $ruleValues, 'join' => $join, 'customRuleForBlanks' => $customRuleForBlanks)
|
||||
);
|
||||
break;
|
||||
case PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_DYNAMICFILTER:
|
||||
case AutoFilter\Column::AUTOFILTER_FILTERTYPE_DYNAMICFILTER:
|
||||
$ruleValues = array();
|
||||
foreach ($rules as $rule) {
|
||||
// We should only ever have one Dynamic Filter Rule anyway
|
||||
$dynamicRuleType = $rule->getGrouping();
|
||||
if (($dynamicRuleType == PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_ABOVEAVERAGE) ||
|
||||
($dynamicRuleType == PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_BELOWAVERAGE)) {
|
||||
if (($dynamicRuleType == AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_ABOVEAVERAGE) ||
|
||||
($dynamicRuleType == AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_BELOWAVERAGE)) {
|
||||
// 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
|
||||
: PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_LESSTHAN;
|
||||
$operator = ($dynamicRuleType === AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_ABOVEAVERAGE)
|
||||
? AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_GREATERTHAN
|
||||
: AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_LESSTHAN;
|
||||
$ruleValues[] = array('operator' => $operator,
|
||||
'value' => $average
|
||||
);
|
||||
$columnFilterTests[$columnID] = array(
|
||||
'method' => 'filterTestInCustomDataSet',
|
||||
'arguments' => array('filterRules' => $ruleValues, 'join' => PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_COLUMN_JOIN_OR)
|
||||
'arguments' => array('filterRules' => $ruleValues, 'join' => AutoFilter\Column::AUTOFILTER_COLUMN_JOIN_OR)
|
||||
);
|
||||
} else {
|
||||
// Date based
|
||||
|
@ -743,7 +743,7 @@ class AutoFilter
|
|||
}
|
||||
}
|
||||
break;
|
||||
case PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_TOPTENFILTER:
|
||||
case AutoFilter\Column::AUTOFILTER_FILTERTYPE_TOPTENFILTER:
|
||||
$ruleValues = array();
|
||||
$dataRowCount = $rangeEnd[1] - $rangeStart[1];
|
||||
foreach ($rules as $rule) {
|
||||
|
@ -752,7 +752,7 @@ class AutoFilter
|
|||
$ruleValue = $rule->getValue();
|
||||
$ruleOperator = $rule->getOperator();
|
||||
}
|
||||
if ($ruleOperator === PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_PERCENT) {
|
||||
if ($ruleOperator === AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_PERCENT) {
|
||||
$ruleValue = floor($ruleValue * ($dataRowCount / 100));
|
||||
}
|
||||
if ($ruleValue < 1) {
|
||||
|
@ -764,13 +764,13 @@ class AutoFilter
|
|||
|
||||
$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;
|
||||
$operator = ($toptenRuleType == AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_TOP)
|
||||
? AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_GREATERTHANOREQUAL
|
||||
: AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_LESSTHANOREQUAL;
|
||||
$ruleValues[] = array('operator' => $operator, 'value' => $maxVal);
|
||||
$columnFilterTests[$columnID] = array(
|
||||
'method' => 'filterTestInCustomDataSet',
|
||||
'arguments' => array('filterRules' => $ruleValues, 'join' => PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_COLUMN_JOIN_OR)
|
||||
'arguments' => array('filterRules' => $ruleValues, 'join' => AutoFilter\Column::AUTOFILTER_COLUMN_JOIN_OR)
|
||||
);
|
||||
$filterColumn->setAttributes(array('maxVal' => $maxVal));
|
||||
break;
|
||||
|
@ -791,7 +791,7 @@ class AutoFilter
|
|||
// Execute the filter test
|
||||
$result = $result &&
|
||||
call_user_func_array(
|
||||
array('PHPExcel_Worksheet_AutoFilter', $columnFilterTest['method']),
|
||||
array('\\PHPExcel\\Worksheet\\AutoFilter', $columnFilterTest['method']),
|
||||
array($cellValue, $columnFilterTest['arguments'])
|
||||
);
|
||||
// echo (($result) ? 'VALID' : 'INVALID'),PHP_EOL;
|
||||
|
@ -824,7 +824,7 @@ class AutoFilter
|
|||
$this->{$key} = clone $value;
|
||||
}
|
||||
} elseif ((is_array($value)) && ($key == 'columns')) {
|
||||
// The columns array of PHPExcel_Worksheet_AutoFilter objects
|
||||
// The columns array of \PHPExcel\Worksheet\AutoFilter objects
|
||||
$this->{$key} = array();
|
||||
foreach ($value as $k => $v) {
|
||||
$this->{$key}[$k] = clone $v;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace PHPExcel\Worksheet\AutoFilter;
|
||||
|
||||
/**
|
||||
* PHPExcel_Worksheet_AutoFilter_Column
|
||||
*
|
||||
|
@ -25,7 +27,7 @@
|
|||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
class PHPExcel_Worksheet_AutoFilter_Column
|
||||
class Column
|
||||
{
|
||||
const AUTOFILTER_FILTERTYPE_FILTER = 'filters';
|
||||
const AUTOFILTER_FILTERTYPE_CUSTOMFILTER = 'customFilters';
|
||||
|
@ -69,7 +71,7 @@ class PHPExcel_Worksheet_AutoFilter_Column
|
|||
/**
|
||||
* Autofilter
|
||||
*
|
||||
* @var PHPExcel_Worksheet_AutoFilter
|
||||
* @var \PHPExcel\Worksheet\AutoFilter
|
||||
*/
|
||||
private $parent;
|
||||
|
||||
|
@ -101,7 +103,7 @@ class PHPExcel_Worksheet_AutoFilter_Column
|
|||
/**
|
||||
* Autofilter Column Rules
|
||||
*
|
||||
* @var array of PHPExcel_Worksheet_AutoFilter_Column_Rule
|
||||
* @var array of Column\Rule
|
||||
*/
|
||||
private $ruleset = array();
|
||||
|
||||
|
@ -115,12 +117,12 @@ class PHPExcel_Worksheet_AutoFilter_Column
|
|||
|
||||
|
||||
/**
|
||||
* Create a new PHPExcel_Worksheet_AutoFilter_Column
|
||||
* Create a new Column
|
||||
*
|
||||
* @param string $pColumn Column (e.g. A)
|
||||
* @param PHPExcel_Worksheet_AutoFilter $pParent Autofilter for this column
|
||||
* @param \PHPExcel\Worksheet\AutoFilter $pParent Autofilter for this column
|
||||
*/
|
||||
public function __construct($pColumn, PHPExcel_Worksheet_AutoFilter $pParent = null)
|
||||
public function __construct($pColumn, \PHPExcel\Worksheet\AutoFilter $pParent = null)
|
||||
{
|
||||
$this->columnIndex = $pColumn;
|
||||
$this->parent = $pParent;
|
||||
|
@ -140,8 +142,8 @@ class PHPExcel_Worksheet_AutoFilter_Column
|
|||
* Set AutoFilter Column Index
|
||||
*
|
||||
* @param string $pColumn Column (e.g. A)
|
||||
* @throws PHPExcel_Exception
|
||||
* @return PHPExcel_Worksheet_AutoFilter_Column
|
||||
* @throws \PHPExcel\Exception
|
||||
* @return Column
|
||||
*/
|
||||
public function setColumnIndex($pColumn)
|
||||
{
|
||||
|
@ -159,7 +161,7 @@ class PHPExcel_Worksheet_AutoFilter_Column
|
|||
/**
|
||||
* Get this Column's AutoFilter Parent
|
||||
*
|
||||
* @return PHPExcel_Worksheet_AutoFilter
|
||||
* @return \PHPExcel\Worksheet\AutoFilter
|
||||
*/
|
||||
public function getParent()
|
||||
{
|
||||
|
@ -169,10 +171,10 @@ class PHPExcel_Worksheet_AutoFilter_Column
|
|||
/**
|
||||
* Set this Column's AutoFilter Parent
|
||||
*
|
||||
* @param PHPExcel_Worksheet_AutoFilter
|
||||
* @return PHPExcel_Worksheet_AutoFilter_Column
|
||||
* @param \PHPExcel\Worksheet\AutoFilter
|
||||
* @return Column
|
||||
*/
|
||||
public function setParent(PHPExcel_Worksheet_AutoFilter $pParent = null)
|
||||
public function setParent(\PHPExcel\Worksheet\AutoFilter $pParent = null)
|
||||
{
|
||||
$this->parent = $pParent;
|
||||
|
||||
|
@ -193,13 +195,13 @@ class PHPExcel_Worksheet_AutoFilter_Column
|
|||
* Set AutoFilter Type
|
||||
*
|
||||
* @param string $pFilterType
|
||||
* @throws PHPExcel_Exception
|
||||
* @return PHPExcel_Worksheet_AutoFilter_Column
|
||||
* @throws \PHPExcel\Exception
|
||||
* @return Column
|
||||
*/
|
||||
public function setFilterType($pFilterType = self::AUTOFILTER_FILTERTYPE_FILTER)
|
||||
{
|
||||
if (!in_array($pFilterType, self::$filterTypes)) {
|
||||
throw new PHPExcel_Exception('Invalid filter type for column AutoFilter.');
|
||||
throw new \PHPExcel\Exception('Invalid filter type for column AutoFilter.');
|
||||
}
|
||||
|
||||
$this->filterType = $pFilterType;
|
||||
|
@ -220,16 +222,16 @@ class PHPExcel_Worksheet_AutoFilter_Column
|
|||
/**
|
||||
* Set AutoFilter Multiple Rules And/Or
|
||||
*
|
||||
* @param string $pJoin And/Or
|
||||
* @throws PHPExcel_Exception
|
||||
* @return PHPExcel_Worksheet_AutoFilter_Column
|
||||
* @param string $pJoin And/Or
|
||||
* @throws \PHPExcel\Exception
|
||||
* @return Column
|
||||
*/
|
||||
public function setJoin($pJoin = self::AUTOFILTER_COLUMN_JOIN_OR)
|
||||
{
|
||||
// Lowercase And/Or
|
||||
$pJoin = strtolower($pJoin);
|
||||
if (!in_array($pJoin, self::$ruleJoins)) {
|
||||
throw new PHPExcel_Exception('Invalid rule connection for column AutoFilter.');
|
||||
throw new \PHPExcel\Exception('Invalid rule connection for column AutoFilter.');
|
||||
}
|
||||
|
||||
$this->join = $pJoin;
|
||||
|
@ -241,8 +243,8 @@ class PHPExcel_Worksheet_AutoFilter_Column
|
|||
* Set AutoFilter Attributes
|
||||
*
|
||||
* @param string[] $pAttributes
|
||||
* @throws PHPExcel_Exception
|
||||
* @return PHPExcel_Worksheet_AutoFilter_Column
|
||||
* @throws \PHPExcel\Exception
|
||||
* @return Column
|
||||
*/
|
||||
public function setAttributes($pAttributes = array())
|
||||
{
|
||||
|
@ -256,8 +258,8 @@ class PHPExcel_Worksheet_AutoFilter_Column
|
|||
*
|
||||
* @param string $pName Attribute Name
|
||||
* @param string $pValue Attribute Value
|
||||
* @throws PHPExcel_Exception
|
||||
* @return PHPExcel_Worksheet_AutoFilter_Column
|
||||
* @throws \PHPExcel\Exception
|
||||
* @return Column
|
||||
*/
|
||||
public function setAttribute($pName, $pValue)
|
||||
{
|
||||
|
@ -293,8 +295,8 @@ class PHPExcel_Worksheet_AutoFilter_Column
|
|||
/**
|
||||
* Get all AutoFilter Column Rules
|
||||
*
|
||||
* @throws PHPExcel_Exception
|
||||
* @return array of PHPExcel_Worksheet_AutoFilter_Column_Rule
|
||||
* @throws \PHPExcel\Exception
|
||||
* @return Column\Rule[]
|
||||
*/
|
||||
public function getRules()
|
||||
{
|
||||
|
@ -305,12 +307,12 @@ class PHPExcel_Worksheet_AutoFilter_Column
|
|||
* Get a specified AutoFilter Column Rule
|
||||
*
|
||||
* @param integer $pIndex Rule index in the ruleset array
|
||||
* @return PHPExcel_Worksheet_AutoFilter_Column_Rule
|
||||
* @return Column\Rule
|
||||
*/
|
||||
public function getRule($pIndex)
|
||||
{
|
||||
if (!isset($this->ruleset[$pIndex])) {
|
||||
$this->ruleset[$pIndex] = new PHPExcel_Worksheet_AutoFilter_Column_Rule($this);
|
||||
$this->ruleset[$pIndex] = new Column\Rule($this);
|
||||
}
|
||||
return $this->ruleset[$pIndex];
|
||||
}
|
||||
|
@ -318,11 +320,11 @@ class PHPExcel_Worksheet_AutoFilter_Column
|
|||
/**
|
||||
* Create a new AutoFilter Column Rule in the ruleset
|
||||
*
|
||||
* @return PHPExcel_Worksheet_AutoFilter_Column_Rule
|
||||
* @return Column\Rule
|
||||
*/
|
||||
public function createRule()
|
||||
{
|
||||
$this->ruleset[] = new PHPExcel_Worksheet_AutoFilter_Column_Rule($this);
|
||||
$this->ruleset[] = new Column\Rule($this);
|
||||
|
||||
return end($this->ruleset);
|
||||
}
|
||||
|
@ -330,11 +332,11 @@ class PHPExcel_Worksheet_AutoFilter_Column
|
|||
/**
|
||||
* Add a new AutoFilter Column Rule to the ruleset
|
||||
*
|
||||
* @param PHPExcel_Worksheet_AutoFilter_Column_Rule $pRule
|
||||
* @param Column\Rule $pRule
|
||||
* @param boolean $returnRule Flag indicating whether the rule object or the column object should be returned
|
||||
* @return PHPExcel_Worksheet_AutoFilter_Column|PHPExcel_Worksheet_AutoFilter_Column_Rule
|
||||
* @return Column|Column\Rule
|
||||
*/
|
||||
public function addRule(PHPExcel_Worksheet_AutoFilter_Column_Rule $pRule, $returnRule = true)
|
||||
public function addRule(Column\Rule $pRule, $returnRule = true)
|
||||
{
|
||||
$pRule->setParent($this);
|
||||
$this->ruleset[] = $pRule;
|
||||
|
@ -347,7 +349,7 @@ class PHPExcel_Worksheet_AutoFilter_Column
|
|||
* If the number of rules is reduced to 1, then we reset And/Or logic to Or
|
||||
*
|
||||
* @param integer $pIndex Rule index in the ruleset array
|
||||
* @return PHPExcel_Worksheet_AutoFilter_Column
|
||||
* @return Column
|
||||
*/
|
||||
public function deleteRule($pIndex)
|
||||
{
|
||||
|
@ -365,7 +367,7 @@ class PHPExcel_Worksheet_AutoFilter_Column
|
|||
/**
|
||||
* Delete all AutoFilter Column Rules
|
||||
*
|
||||
* @return PHPExcel_Worksheet_AutoFilter_Column
|
||||
* @return Column
|
||||
*/
|
||||
public function clearRules()
|
||||
{
|
||||
|
@ -390,7 +392,7 @@ class PHPExcel_Worksheet_AutoFilter_Column
|
|||
$this->$key = clone $value;
|
||||
}
|
||||
} elseif ((is_array($value)) && ($key == 'ruleset')) {
|
||||
// The columns array of PHPExcel_Worksheet_AutoFilter objects
|
||||
// The columns array of \PHPExcel\Worksheet\AutoFilter objects
|
||||
$this->$key = array();
|
||||
foreach ($value as $k => $v) {
|
||||
$this->$key[$k] = clone $v;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace PHPExcel\Worksheet\AutoFilter\Column;
|
||||
|
||||
/**
|
||||
* PHPExcel_Worksheet_AutoFilter_Column_Rule
|
||||
*
|
||||
|
@ -20,12 +22,12 @@
|
|||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_Worksheet
|
||||
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
* @package PHPExcel_Worksheet
|
||||
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
class PHPExcel_Worksheet_AutoFilter_Column_Rule
|
||||
class Rule
|
||||
{
|
||||
const AUTOFILTER_RULETYPE_FILTER = 'filter';
|
||||
const AUTOFILTER_RULETYPE_DATEGROUP = 'dateGroupItem';
|
||||
|
@ -224,7 +226,7 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
|
|||
/**
|
||||
* Autofilter Column
|
||||
*
|
||||
* @var PHPExcel_Worksheet_AutoFilter_Column
|
||||
* @var \PHPExcel\Worksheet\AutoFilter\Column
|
||||
*/
|
||||
private $parent = null;
|
||||
|
||||
|
@ -260,11 +262,11 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
|
|||
|
||||
|
||||
/**
|
||||
* Create a new PHPExcel_Worksheet_AutoFilter_Column_Rule
|
||||
* Create a new Rule
|
||||
*
|
||||
* @param PHPExcel_Worksheet_AutoFilter_Column $pParent
|
||||
* @param \PHPExcel\Worksheet\AutoFilter\Column $pParent
|
||||
*/
|
||||
public function __construct(PHPExcel_Worksheet_AutoFilter_Column $pParent = null)
|
||||
public function __construct(\PHPExcel\Worksheet\AutoFilter\Column $pParent = null)
|
||||
{
|
||||
$this->parent = $pParent;
|
||||
}
|
||||
|
@ -282,14 +284,14 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
|
|||
/**
|
||||
* Set AutoFilter Rule Type
|
||||
*
|
||||
* @param string $pRuleType
|
||||
* @throws PHPExcel_Exception
|
||||
* @return PHPExcel_Worksheet_AutoFilter_Column
|
||||
* @param string $pRuleType
|
||||
* @throws \PHPExcel\Exception
|
||||
* @return \PHPExcel\Worksheet\AutoFilter\Column
|
||||
*/
|
||||
public function setRuleType($pRuleType = self::AUTOFILTER_RULETYPE_FILTER)
|
||||
{
|
||||
if (!in_array($pRuleType, self::$ruleTypes)) {
|
||||
throw new PHPExcel_Exception('Invalid rule type for column AutoFilter Rule.');
|
||||
throw new \PHPExcel\Exception('Invalid rule type for column AutoFilter Rule.');
|
||||
}
|
||||
|
||||
$this->ruleType = $pRuleType;
|
||||
|
@ -311,8 +313,8 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
|
|||
* Set AutoFilter Rule Value
|
||||
*
|
||||
* @param string|string[] $pValue
|
||||
* @throws PHPExcel_Exception
|
||||
* @return PHPExcel_Worksheet_AutoFilter_Column_Rule
|
||||
* @throws \PHPExcel\Exception
|
||||
* @return Rule
|
||||
*/
|
||||
public function setValue($pValue = '')
|
||||
{
|
||||
|
@ -329,7 +331,7 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
|
|||
}
|
||||
}
|
||||
if (count($pValue) == 0) {
|
||||
throw new PHPExcel_Exception('Invalid rule value for column AutoFilter Rule.');
|
||||
throw new \PHPExcel\Exception('Invalid rule value for column AutoFilter Rule.');
|
||||
}
|
||||
// Set the dateTime grouping that we've anticipated
|
||||
$this->setGrouping(self::$dateTimeGroups[$grouping]);
|
||||
|
@ -353,8 +355,8 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
|
|||
* Set AutoFilter Rule Operator
|
||||
*
|
||||
* @param string $pOperator
|
||||
* @throws PHPExcel_Exception
|
||||
* @return PHPExcel_Worksheet_AutoFilter_Column_Rule
|
||||
* @throws \PHPExcel\Exception
|
||||
* @return Rule
|
||||
*/
|
||||
public function setOperator($pOperator = self::AUTOFILTER_COLUMN_RULE_EQUAL)
|
||||
{
|
||||
|
@ -363,7 +365,7 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
|
|||
}
|
||||
if ((!in_array($pOperator, self::$operators)) &&
|
||||
(!in_array($pOperator, self::$topTenValue))) {
|
||||
throw new PHPExcel_Exception('Invalid operator for column AutoFilter Rule.');
|
||||
throw new \PHPExcel\Exception('Invalid operator for column AutoFilter Rule.');
|
||||
}
|
||||
$this->operator = $pOperator;
|
||||
|
||||
|
@ -384,8 +386,8 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
|
|||
* Set AutoFilter Rule Grouping
|
||||
*
|
||||
* @param string $pGrouping
|
||||
* @throws PHPExcel_Exception
|
||||
* @return PHPExcel_Worksheet_AutoFilter_Column_Rule
|
||||
* @throws \PHPExcel\Exception
|
||||
* @return Rule
|
||||
*/
|
||||
public function setGrouping($pGrouping = null)
|
||||
{
|
||||
|
@ -393,7 +395,7 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
|
|||
(!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.');
|
||||
throw new \PHPExcel\Exception('Invalid rule type for column AutoFilter Rule.');
|
||||
}
|
||||
$this->grouping = $pGrouping;
|
||||
|
||||
|
@ -406,16 +408,16 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
|
|||
* @param string $pOperator
|
||||
* @param string|string[] $pValue
|
||||
* @param string $pGrouping
|
||||
* @throws PHPExcel_Exception
|
||||
* @return PHPExcel_Worksheet_AutoFilter_Column_Rule
|
||||
* @throws \PHPExcel\Exception
|
||||
* @return Rule
|
||||
*/
|
||||
public function setRule($pOperator = self::AUTOFILTER_COLUMN_RULE_EQUAL, $pValue = '', $pGrouping = null)
|
||||
{
|
||||
$this->setOperator($pOperator);
|
||||
$this->setValue($pValue);
|
||||
// Only set grouping if it's been passed in as a user-supplied argument,
|
||||
// otherwise we're calculating it when we setValue() and don't want to overwrite that
|
||||
// If the user supplies an argumnet for grouping, then on their own head be it
|
||||
// Only set grouping if it's been passed in as a user-supplied argument,
|
||||
// otherwise we're calculating it when we setValue() and don't want to overwrite that
|
||||
// If the user supplies an argumnet for grouping, then on their own head be it
|
||||
if ($pGrouping !== null) {
|
||||
$this->setGrouping($pGrouping);
|
||||
}
|
||||
|
@ -426,7 +428,7 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
|
|||
/**
|
||||
* Get this Rule's AutoFilter Column Parent
|
||||
*
|
||||
* @return PHPExcel_Worksheet_AutoFilter_Column
|
||||
* @return \PHPExcel\Worksheet\AutoFilter\Column
|
||||
*/
|
||||
public function getParent()
|
||||
{
|
||||
|
@ -436,10 +438,10 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
|
|||
/**
|
||||
* Set this Rule's AutoFilter Column Parent
|
||||
*
|
||||
* @param PHPExcel_Worksheet_AutoFilter_Column
|
||||
* @return PHPExcel_Worksheet_AutoFilter_Column_Rule
|
||||
* @param \PHPExcel\Worksheet\AutoFilter\Column
|
||||
* @return Rule
|
||||
*/
|
||||
public function setParent(PHPExcel_Worksheet_AutoFilter_Column $pParent = null)
|
||||
public function setParent(\PHPExcel\Worksheet\AutoFilter\Column $pParent = null)
|
||||
{
|
||||
$this->parent = $pParent;
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ class BaseDrawing implements \PHPExcel\IComparable
|
|||
/**
|
||||
* Worksheet
|
||||
*
|
||||
* @var PHPExcel_Worksheet
|
||||
* @var \PHPExcel\Worksheet
|
||||
*/
|
||||
protected $worksheet;
|
||||
|
||||
|
@ -116,12 +116,12 @@ class BaseDrawing implements \PHPExcel\IComparable
|
|||
/**
|
||||
* Shadow
|
||||
*
|
||||
* @var PHPExcel_Worksheet_Drawing_Shadow
|
||||
* @var Drawing\Shadow
|
||||
*/
|
||||
protected $shadow;
|
||||
|
||||
/**
|
||||
* Create a new PHPExcel_Worksheet_BaseDrawing
|
||||
* Create a new BaseDrawing
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
|
@ -136,11 +136,11 @@ class BaseDrawing implements \PHPExcel\IComparable
|
|||
$this->height = 0;
|
||||
$this->resizeProportional = true;
|
||||
$this->rotation = 0;
|
||||
$this->shadow = new PHPExcel_Worksheet_Drawing_Shadow();
|
||||
$this->shadow = new Drawing\Shadow();
|
||||
|
||||
// Set image index
|
||||
self::$imageCounter++;
|
||||
$this->imageIndex = self::$imageCounter;
|
||||
$this->imageIndex = self::$imageCounter;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -167,7 +167,7 @@ class BaseDrawing implements \PHPExcel\IComparable
|
|||
* Set Name
|
||||
*
|
||||
* @param string $pValue
|
||||
* @return PHPExcel_Worksheet_BaseDrawing
|
||||
* @return BaseDrawing
|
||||
*/
|
||||
public function setName($pValue = '')
|
||||
{
|
||||
|
@ -189,7 +189,7 @@ class BaseDrawing implements \PHPExcel\IComparable
|
|||
* Set Description
|
||||
*
|
||||
* @param string $pValue
|
||||
* @return PHPExcel_Worksheet_BaseDrawing
|
||||
* @return BaseDrawing
|
||||
*/
|
||||
public function setDescription($pValue = '')
|
||||
{
|
||||
|
@ -200,7 +200,7 @@ class BaseDrawing implements \PHPExcel\IComparable
|
|||
/**
|
||||
* Get Worksheet
|
||||
*
|
||||
* @return PHPExcel_Worksheet
|
||||
* @return \PHPExcel\Worksheet
|
||||
*/
|
||||
public function getWorksheet()
|
||||
{
|
||||
|
@ -210,21 +210,21 @@ class BaseDrawing implements \PHPExcel\IComparable
|
|||
/**
|
||||
* Set Worksheet
|
||||
*
|
||||
* @param PHPExcel_Worksheet $pValue
|
||||
* @param bool $pOverrideOld If a Worksheet has already been assigned, overwrite it and remove image from old Worksheet?
|
||||
* @throws PHPExcel_Exception
|
||||
* @return PHPExcel_Worksheet_BaseDrawing
|
||||
* @param \PHPExcel\Worksheet $pValue
|
||||
* @param boolean $pOverrideOld If a Worksheet has already been assigned, overwrite it and remove image from old Worksheet?
|
||||
* @throws \PHPExcel\Exception
|
||||
* @return BaseDrawing
|
||||
*/
|
||||
public function setWorksheet(PHPExcel_Worksheet $pValue = null, $pOverrideOld = false)
|
||||
public function setWorksheet(\PHPExcel\Worksheet $pValue = null, $pOverrideOld = false)
|
||||
{
|
||||
if (is_null($this->worksheet)) {
|
||||
// Add drawing to PHPExcel_Worksheet
|
||||
// Add drawing to \PHPExcel\Worksheet
|
||||
$this->worksheet = $pValue;
|
||||
$this->worksheet->getCell($this->coordinates);
|
||||
$this->worksheet->getDrawingCollection()->append($this);
|
||||
} else {
|
||||
if ($pOverrideOld) {
|
||||
// Remove drawing from old PHPExcel_Worksheet
|
||||
// Remove drawing from old \PHPExcel\Worksheet
|
||||
$iterator = $this->worksheet->getDrawingCollection()->getIterator();
|
||||
|
||||
while ($iterator->valid()) {
|
||||
|
@ -235,10 +235,10 @@ class BaseDrawing implements \PHPExcel\IComparable
|
|||
}
|
||||
}
|
||||
|
||||
// Set new PHPExcel_Worksheet
|
||||
// Set new \PHPExcel\Worksheet
|
||||
$this->setWorksheet($pValue);
|
||||
} else {
|
||||
throw new PHPExcel_Exception("A PHPExcel_Worksheet has already been assigned. Drawings can only exist on one PHPExcel_Worksheet.");
|
||||
throw new \PHPExcel\Exception("A \PHPExcel\Worksheet has already been assigned. Drawings can only exist on one \PHPExcel\Worksheet.");
|
||||
}
|
||||
}
|
||||
return $this;
|
||||
|
@ -258,7 +258,7 @@ class BaseDrawing implements \PHPExcel\IComparable
|
|||
* Set Coordinates
|
||||
*
|
||||
* @param string $pValue
|
||||
* @return PHPExcel_Worksheet_BaseDrawing
|
||||
* @return BaseDrawing
|
||||
*/
|
||||
public function setCoordinates($pValue = 'A1')
|
||||
{
|
||||
|
@ -280,7 +280,7 @@ class BaseDrawing implements \PHPExcel\IComparable
|
|||
* Set OffsetX
|
||||
*
|
||||
* @param int $pValue
|
||||
* @return PHPExcel_Worksheet_BaseDrawing
|
||||
* @return BaseDrawing
|
||||
*/
|
||||
public function setOffsetX($pValue = 0)
|
||||
{
|
||||
|
@ -302,7 +302,7 @@ class BaseDrawing implements \PHPExcel\IComparable
|
|||
* Set OffsetY
|
||||
*
|
||||
* @param int $pValue
|
||||
* @return PHPExcel_Worksheet_BaseDrawing
|
||||
* @return BaseDrawing
|
||||
*/
|
||||
public function setOffsetY($pValue = 0)
|
||||
{
|
||||
|
@ -324,7 +324,7 @@ class BaseDrawing implements \PHPExcel\IComparable
|
|||
* Set Width
|
||||
*
|
||||
* @param int $pValue
|
||||
* @return PHPExcel_Worksheet_BaseDrawing
|
||||
* @return BaseDrawing
|
||||
*/
|
||||
public function setWidth($pValue = 0)
|
||||
{
|
||||
|
@ -354,7 +354,7 @@ class BaseDrawing implements \PHPExcel\IComparable
|
|||
* Set Height
|
||||
*
|
||||
* @param int $pValue
|
||||
* @return PHPExcel_Worksheet_BaseDrawing
|
||||
* @return BaseDrawing
|
||||
*/
|
||||
public function setHeight($pValue = 0)
|
||||
{
|
||||
|
@ -381,7 +381,7 @@ class BaseDrawing implements \PHPExcel\IComparable
|
|||
* @author Vincent@luo MSN:kele_100@hotmail.com
|
||||
* @param int $width
|
||||
* @param int $height
|
||||
* @return PHPExcel_Worksheet_BaseDrawing
|
||||
* @return BaseDrawing
|
||||
*/
|
||||
public function setWidthAndHeight($width = 0, $height = 0)
|
||||
{
|
||||
|
@ -417,7 +417,7 @@ class BaseDrawing implements \PHPExcel\IComparable
|
|||
* Set ResizeProportional
|
||||
*
|
||||
* @param boolean $pValue
|
||||
* @return PHPExcel_Worksheet_BaseDrawing
|
||||
* @return BaseDrawing
|
||||
*/
|
||||
public function setResizeProportional($pValue = true)
|
||||
{
|
||||
|
@ -439,7 +439,7 @@ class BaseDrawing implements \PHPExcel\IComparable
|
|||
* Set Rotation
|
||||
*
|
||||
* @param int $pValue
|
||||
* @return PHPExcel_Worksheet_BaseDrawing
|
||||
* @return BaseDrawing
|
||||
*/
|
||||
public function setRotation($pValue = 0)
|
||||
{
|
||||
|
@ -450,7 +450,7 @@ class BaseDrawing implements \PHPExcel\IComparable
|
|||
/**
|
||||
* Get Shadow
|
||||
*
|
||||
* @return PHPExcel_Worksheet_Drawing_Shadow
|
||||
* @return Drawing\Shadow
|
||||
*/
|
||||
public function getShadow()
|
||||
{
|
||||
|
@ -460,11 +460,11 @@ class BaseDrawing implements \PHPExcel\IComparable
|
|||
/**
|
||||
* Set Shadow
|
||||
*
|
||||
* @param PHPExcel_Worksheet_Drawing_Shadow $pValue
|
||||
* @throws PHPExcel_Exception
|
||||
* @return PHPExcel_Worksheet_BaseDrawing
|
||||
* @param Drawing\Shadow $pValue
|
||||
* @throws \PHPExcel\Exception
|
||||
* @return BaseDrawing
|
||||
*/
|
||||
public function setShadow(PHPExcel_Worksheet_Drawing_Shadow $pValue = null)
|
||||
public function setShadow(Drawing\Shadow $pValue = null)
|
||||
{
|
||||
$this->shadow = $pValue;
|
||||
return $this;
|
||||
|
|
|
@ -30,9 +30,9 @@ namespace PHPExcel\Worksheet;
|
|||
abstract class CellIterator
|
||||
{
|
||||
/**
|
||||
* PHPExcel_Worksheet to iterate
|
||||
* \PHPExcel\Worksheet to iterate
|
||||
*
|
||||
* @var PHPExcel_Worksheet
|
||||
* @var \PHPExcel\Worksheet
|
||||
*/
|
||||
protected $subject;
|
||||
|
||||
|
@ -71,7 +71,7 @@ abstract class CellIterator
|
|||
/**
|
||||
* Validate start/end values for "IterateOnlyExistingCells" mode, and adjust if necessary
|
||||
*
|
||||
* @throws PHPExcel_Exception
|
||||
* @throws \PHPExcel\Exception
|
||||
*/
|
||||
abstract protected function adjustForExistingOnlyRange();
|
||||
|
||||
|
@ -79,7 +79,7 @@ abstract class CellIterator
|
|||
* Set the iterator to loop only existing cells
|
||||
*
|
||||
* @param boolean $value
|
||||
* @throws PHPExcel_Exception
|
||||
* @throws \PHPExcel\Exception
|
||||
*/
|
||||
public function setIterateOnlyExistingCells($value = true)
|
||||
{
|
||||
|
|
|
@ -30,9 +30,9 @@ namespace PHPExcel\Worksheet;
|
|||
class Column
|
||||
{
|
||||
/**
|
||||
* PHPExcel_Worksheet
|
||||
* \PHPExcel\Worksheet
|
||||
*
|
||||
* @var PHPExcel_Worksheet
|
||||
* @var \PHPExcel\Worksheet
|
||||
*/
|
||||
private $parent;
|
||||
|
||||
|
@ -46,10 +46,10 @@ class Column
|
|||
/**
|
||||
* Create a new column
|
||||
*
|
||||
* @param PHPExcel_Worksheet $parent
|
||||
* @param \PHPExcel\Worksheet $parent
|
||||
* @param string $columnIndex
|
||||
*/
|
||||
public function __construct(PHPExcel_Worksheet $parent = null, $columnIndex = 'A')
|
||||
public function __construct(\PHPExcel\Worksheet $parent = null, $columnIndex = 'A')
|
||||
{
|
||||
// Set parent and column index
|
||||
$this->parent = $parent;
|
||||
|
@ -79,10 +79,10 @@ class Column
|
|||
*
|
||||
* @param integer $startRow The row number at which to start iterating
|
||||
* @param integer $endRow Optionally, the row number at which to stop iterating
|
||||
* @return PHPExcel_Worksheet_CellIterator
|
||||
* @return ColumnCellIterator
|
||||
*/
|
||||
public function getCellIterator($startRow = 1, $endRow = null)
|
||||
{
|
||||
return new PHPExcel_Worksheet_ColumnCellIterator($this->parent, $this->columnIndex, $startRow, $endRow);
|
||||
return new ColumnCellIterator($this->parent, $this->columnIndex, $startRow, $endRow);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,16 +53,16 @@ class ColumnCellIterator extends CellIterator implements \Iterator
|
|||
/**
|
||||
* Create a new row iterator
|
||||
*
|
||||
* @param PHPExcel_Worksheet $subject The worksheet to iterate over
|
||||
* @param string $columnIndex The column that we want to iterate
|
||||
* @param \PHPExcel\Worksheet $subject The worksheet to iterate over
|
||||
* @param string $columnIndex The column that we want to iterate
|
||||
* @param integer $startRow The row number at which to start iterating
|
||||
* @param integer $endRow Optionally, the row number at which to stop iterating
|
||||
*/
|
||||
public function __construct(PHPExcel_Worksheet $subject = null, $columnIndex = 'A', $startRow = 1, $endRow = null)
|
||||
public function __construct(\PHPExcel\Worksheet $subject = null, $columnIndex = 'A', $startRow = 1, $endRow = null)
|
||||
{
|
||||
// Set subject
|
||||
$this->subject = $subject;
|
||||
$this->columnIndex = PHPExcel_Cell::columnIndexFromString($columnIndex) - 1;
|
||||
$this->columnIndex = \PHPExcel\Cell::columnIndexFromString($columnIndex) - 1;
|
||||
$this->resetEnd($endRow);
|
||||
$this->resetStart($startRow);
|
||||
}
|
||||
|
@ -79,8 +79,8 @@ class ColumnCellIterator extends CellIterator implements \Iterator
|
|||
* (Re)Set the start row and the current row pointer
|
||||
*
|
||||
* @param integer $startRow The row number at which to start iterating
|
||||
* @return PHPExcel_Worksheet_ColumnCellIterator
|
||||
* @throws PHPExcel_Exception
|
||||
* @return ColumnCellIterator
|
||||
* @throws \PHPExcel\Exception
|
||||
*/
|
||||
public function resetStart($startRow = 1)
|
||||
{
|
||||
|
@ -95,8 +95,8 @@ class ColumnCellIterator extends CellIterator implements \Iterator
|
|||
* (Re)Set the end row
|
||||
*
|
||||
* @param integer $endRow The row number at which to stop iterating
|
||||
* @return PHPExcel_Worksheet_ColumnCellIterator
|
||||
* @throws PHPExcel_Exception
|
||||
* @return ColumnCellIterator
|
||||
* @throws \PHPExcel\Exception
|
||||
*/
|
||||
public function resetEnd($endRow = null)
|
||||
{
|
||||
|
@ -110,15 +110,15 @@ class ColumnCellIterator extends CellIterator implements \Iterator
|
|||
* Set the row pointer to the selected row
|
||||
*
|
||||
* @param integer $row The row number to set the current pointer at
|
||||
* @return PHPExcel_Worksheet_ColumnCellIterator
|
||||
* @throws PHPExcel_Exception
|
||||
* @return ColumnCellIterator
|
||||
* @throws \PHPExcel\Exception
|
||||
*/
|
||||
public function seek($row = 1)
|
||||
{
|
||||
if (($row < $this->startRow) || ($row > $this->endRow)) {
|
||||
throw new PHPExcel_Exception("Row $row is out of range ({$this->startRow} - {$this->endRow})");
|
||||
throw new \PHPExcel\Exception("Row $row is out of range ({$this->startRow} - {$this->endRow})");
|
||||
} elseif ($this->onlyExistingCells && !($this->subject->cellExistsByColumnAndRow($this->columnIndex, $row))) {
|
||||
throw new PHPExcel_Exception('In "IterateOnlyExistingCells" mode and Cell does not exist');
|
||||
throw new \PHPExcel\Exception('In "IterateOnlyExistingCells" mode and Cell does not exist');
|
||||
}
|
||||
$this->position = $row;
|
||||
|
||||
|
@ -136,7 +136,7 @@ class ColumnCellIterator extends CellIterator implements \Iterator
|
|||
/**
|
||||
* Return the current cell in this worksheet column
|
||||
*
|
||||
* @return PHPExcel_Worksheet_Row
|
||||
* @return Row
|
||||
*/
|
||||
public function current()
|
||||
{
|
||||
|
@ -171,7 +171,7 @@ class ColumnCellIterator extends CellIterator implements \Iterator
|
|||
public function prev()
|
||||
{
|
||||
if ($this->position <= $this->startRow) {
|
||||
throw new PHPExcel_Exception("Row is already at the beginning of range ({$this->startRow} - {$this->endRow})");
|
||||
throw new \PHPExcel\Exception("Row is already at the beginning of range ({$this->startRow} - {$this->endRow})");
|
||||
}
|
||||
|
||||
do {
|
||||
|
@ -194,7 +194,7 @@ class ColumnCellIterator extends CellIterator implements \Iterator
|
|||
/**
|
||||
* Validate start/end values for "IterateOnlyExistingCells" mode, and adjust if necessary
|
||||
*
|
||||
* @throws PHPExcel_Exception
|
||||
* @throws \PHPExcel\Exception
|
||||
*/
|
||||
protected function adjustForExistingOnlyRange()
|
||||
{
|
||||
|
@ -204,14 +204,14 @@ class ColumnCellIterator extends CellIterator implements \Iterator
|
|||
++$this->startRow;
|
||||
}
|
||||
if ($this->startRow > $this->endRow) {
|
||||
throw new PHPExcel_Exception('No cells exist within the specified range');
|
||||
throw new \PHPExcel\Exception('No cells exist within the specified range');
|
||||
}
|
||||
while ((!$this->subject->cellExistsByColumnAndRow($this->columnIndex, $this->endRow)) &&
|
||||
($this->endRow >= $this->startRow)) {
|
||||
--$this->endRow;
|
||||
}
|
||||
if ($this->endRow < $this->startRow) {
|
||||
throw new PHPExcel_Exception('No cells exist within the specified range');
|
||||
throw new \PHPExcel\Exception('No cells exist within the specified range');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ class ColumnDimension extends Dimension
|
|||
private $autoSize = false;
|
||||
|
||||
/**
|
||||
* Create a new PHPExcel_Worksheet_ColumnDimension
|
||||
* Create a new ColumnDimension
|
||||
*
|
||||
* @param string $pIndex Character column index
|
||||
*/
|
||||
|
@ -80,7 +80,7 @@ class ColumnDimension extends Dimension
|
|||
* Set ColumnIndex
|
||||
*
|
||||
* @param string $pValue
|
||||
* @return PHPExcel_Worksheet_ColumnDimension
|
||||
* @return ColumnDimension
|
||||
*/
|
||||
public function setColumnIndex($pValue)
|
||||
{
|
||||
|
@ -102,7 +102,7 @@ class ColumnDimension extends Dimension
|
|||
* Set Width
|
||||
*
|
||||
* @param double $pValue
|
||||
* @return PHPExcel_Worksheet_ColumnDimension
|
||||
* @return ColumnDimension
|
||||
*/
|
||||
public function setWidth($pValue = -1)
|
||||
{
|
||||
|
@ -124,7 +124,7 @@ class ColumnDimension extends Dimension
|
|||
* Set Auto Size
|
||||
*
|
||||
* @param bool $pValue
|
||||
* @return PHPExcel_Worksheet_ColumnDimension
|
||||
* @return ColumnDimension
|
||||
*/
|
||||
public function setAutoSize($pValue = false)
|
||||
{
|
||||
|
|
|
@ -30,9 +30,9 @@ namespace PHPExcel\Worksheet;
|
|||
class ColumnIterator implements \Iterator
|
||||
{
|
||||
/**
|
||||
* PHPExcel_Worksheet to iterate
|
||||
* \PHPExcel\Worksheet to iterate
|
||||
*
|
||||
* @var PHPExcel_Worksheet
|
||||
* @var \PHPExcel\Worksheet
|
||||
*/
|
||||
private $subject;
|
||||
|
||||
|
@ -62,11 +62,11 @@ class ColumnIterator implements \Iterator
|
|||
/**
|
||||
* Create a new column iterator
|
||||
*
|
||||
* @param PHPExcel_Worksheet $subject The worksheet to iterate over
|
||||
* @param string $startColumn The column address at which to start iterating
|
||||
* @param string $endColumn Optionally, the column address at which to stop iterating
|
||||
* @param \PHPExcel\Worksheet $subject The worksheet to iterate over
|
||||
* @param string $startColumn The column address at which to start iterating
|
||||
* @param string $endColumn Optionally, the column address at which to stop iterating
|
||||
*/
|
||||
public function __construct(PHPExcel_Worksheet $subject = null, $startColumn = 'A', $endColumn = null)
|
||||
public function __construct(\PHPExcel\Worksheet $subject = null, $startColumn = 'A', $endColumn = null)
|
||||
{
|
||||
// Set subject
|
||||
$this->subject = $subject;
|
||||
|
@ -86,11 +86,11 @@ class ColumnIterator implements \Iterator
|
|||
* (Re)Set the start column and the current column pointer
|
||||
*
|
||||
* @param integer $startColumn The column address at which to start iterating
|
||||
* @return PHPExcel_Worksheet_ColumnIterator
|
||||
* @return ColumnIterator
|
||||
*/
|
||||
public function resetStart($startColumn = 'A')
|
||||
{
|
||||
$startColumnIndex = PHPExcel_Cell::columnIndexFromString($startColumn) - 1;
|
||||
$startColumnIndex = \PHPExcel\Cell::columnIndexFromString($startColumn) - 1;
|
||||
$this->startColumn = $startColumnIndex;
|
||||
$this->seek($startColumn);
|
||||
|
||||
|
@ -101,12 +101,12 @@ class ColumnIterator implements \Iterator
|
|||
* (Re)Set the end column
|
||||
*
|
||||
* @param string $endColumn The column address at which to stop iterating
|
||||
* @return PHPExcel_Worksheet_ColumnIterator
|
||||
* @return ColumnIterator
|
||||
*/
|
||||
public function resetEnd($endColumn = null)
|
||||
{
|
||||
$endColumn = ($endColumn) ? $endColumn : $this->subject->getHighestColumn();
|
||||
$this->endColumn = PHPExcel_Cell::columnIndexFromString($endColumn) - 1;
|
||||
$this->endColumn = \PHPExcel\Cell::columnIndexFromString($endColumn) - 1;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
@ -114,15 +114,15 @@ class ColumnIterator implements \Iterator
|
|||
/**
|
||||
* Set the column pointer to the selected column
|
||||
*
|
||||
* @param string $column The column address to set the current pointer at
|
||||
* @return PHPExcel_Worksheet_ColumnIterator
|
||||
* @throws PHPExcel_Exception
|
||||
* @param string $column The column address to set the current pointer at
|
||||
* @return ColumnIterator
|
||||
* @throws \PHPExcel\Exception
|
||||
*/
|
||||
public function seek($column = 'A')
|
||||
{
|
||||
$column = PHPExcel_Cell::columnIndexFromString($column) - 1;
|
||||
$column = \PHPExcel\Cell::columnIndexFromString($column) - 1;
|
||||
if (($column < $this->startColumn) || ($column > $this->endColumn)) {
|
||||
throw new PHPExcel_Exception("Column $column is out of range ({$this->startColumn} - {$this->endColumn})");
|
||||
throw new \PHPExcel\Exception("Column $column is out of range ({$this->startColumn} - {$this->endColumn})");
|
||||
}
|
||||
$this->position = $column;
|
||||
|
||||
|
@ -140,11 +140,11 @@ class ColumnIterator implements \Iterator
|
|||
/**
|
||||
* Return the current column in this worksheet
|
||||
*
|
||||
* @return PHPExcel_Worksheet_Column
|
||||
* @return Column
|
||||
*/
|
||||
public function current()
|
||||
{
|
||||
return new PHPExcel_Worksheet_Column($this->subject, PHPExcel_Cell::stringFromColumnIndex($this->position));
|
||||
return new Column($this->subject, \PHPExcel\Cell::stringFromColumnIndex($this->position));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -154,7 +154,7 @@ class ColumnIterator implements \Iterator
|
|||
*/
|
||||
public function key()
|
||||
{
|
||||
return PHPExcel_Cell::stringFromColumnIndex($this->position);
|
||||
return \PHPExcel\Cell::stringFromColumnIndex($this->position);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -168,15 +168,15 @@ class ColumnIterator implements \Iterator
|
|||
/**
|
||||
* Set the iterator to its previous value
|
||||
*
|
||||
* @throws PHPExcel_Exception
|
||||
* @throws \PHPExcel\Exception
|
||||
*/
|
||||
public function prev()
|
||||
{
|
||||
if ($this->position <= $this->startColumn) {
|
||||
throw new PHPExcel_Exception(
|
||||
throw new \PHPExcel\Exception(
|
||||
"Column is already at the beginning of range (" .
|
||||
PHPExcel_Cell::stringFromColumnIndex($this->endColumn) . " - " .
|
||||
PHPExcel_Cell::stringFromColumnIndex($this->endColumn) . ")"
|
||||
\PHPExcel\Cell::stringFromColumnIndex($this->endColumn) . " - " .
|
||||
\PHPExcel\Cell::stringFromColumnIndex($this->endColumn) . ")"
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ abstract class Dimension
|
|||
private $xfIndex;
|
||||
|
||||
/**
|
||||
* Create a new PHPExcel_Worksheet_Dimension
|
||||
* Create a new Dimension
|
||||
*
|
||||
* @param int $pIndex Numeric row index
|
||||
*/
|
||||
|
@ -82,7 +82,7 @@ abstract class Dimension
|
|||
* Set Visible
|
||||
*
|
||||
* @param bool $pValue
|
||||
* @return PHPExcel_Worksheet_Dimension
|
||||
* @return Dimension
|
||||
*/
|
||||
public function setVisible($pValue = true)
|
||||
{
|
||||
|
@ -105,14 +105,14 @@ abstract class Dimension
|
|||
*
|
||||
* Value must be between 0 and 7
|
||||
*
|
||||
* @param int $pValue
|
||||
* @throws PHPExcel_Exception
|
||||
* @return PHPExcel_Worksheet_Dimension
|
||||
* @param integer $pValue
|
||||
* @throws \PHPExcel\Exception
|
||||
* @return Dimension
|
||||
*/
|
||||
public function setOutlineLevel($pValue)
|
||||
{
|
||||
if ($pValue < 0 || $pValue > 7) {
|
||||
throw new PHPExcel_Exception("Outline level must range between 0 and 7.");
|
||||
throw new \PHPExcel\Exception("Outline level must range between 0 and 7.");
|
||||
}
|
||||
|
||||
$this->outlineLevel = $pValue;
|
||||
|
@ -132,8 +132,8 @@ abstract class Dimension
|
|||
/**
|
||||
* Set Collapsed
|
||||
*
|
||||
* @param bool $pValue
|
||||
* @return PHPExcel_Worksheet_Dimension
|
||||
* @param boolean $pValue
|
||||
* @return Dimension
|
||||
*/
|
||||
public function setCollapsed($pValue = true)
|
||||
{
|
||||
|
@ -154,8 +154,8 @@ abstract class Dimension
|
|||
/**
|
||||
* Set index to cellXf
|
||||
*
|
||||
* @param int $pValue
|
||||
* @return PHPExcel_Worksheet_Dimension
|
||||
* @param integer $pValue
|
||||
* @return Dimension
|
||||
*/
|
||||
public function setXfIndex($pValue = 0)
|
||||
{
|
||||
|
|
|
@ -37,7 +37,7 @@ class Drawing extends BaseDrawing implements \PHPExcel\IComparable
|
|||
private $path;
|
||||
|
||||
/**
|
||||
* Create a new PHPExcel_Worksheet_Drawing
|
||||
* Create a new Drawing
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
|
@ -94,10 +94,10 @@ class Drawing extends BaseDrawing implements \PHPExcel\IComparable
|
|||
/**
|
||||
* Set Path
|
||||
*
|
||||
* @param string $pValue File path
|
||||
* @param boolean $pVerifyFile Verify file
|
||||
* @throws PHPExcel_Exception
|
||||
* @return PHPExcel_Worksheet_Drawing
|
||||
* @param string $pValue File path
|
||||
* @param boolean $pVerifyFile Verify file
|
||||
* @throws \PHPExcel\Exception
|
||||
* @return Drawing
|
||||
*/
|
||||
public function setPath($pValue = '', $pVerifyFile = true)
|
||||
{
|
||||
|
@ -110,7 +110,7 @@ class Drawing extends BaseDrawing implements \PHPExcel\IComparable
|
|||
list($this->width, $this->height) = getimagesize($pValue);
|
||||
}
|
||||
} else {
|
||||
throw new PHPExcel_Exception("File $pValue not found!");
|
||||
throw new \PHPExcel\Exception("File $pValue not found!");
|
||||
}
|
||||
} else {
|
||||
$this->path = $pValue;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace PHPExcel\Worksheet\Drawing;
|
||||
|
||||
/**
|
||||
* PHPExcel_Worksheet_Drawing_Shadow
|
||||
*
|
||||
|
@ -25,7 +27,7 @@
|
|||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
class PHPExcel_Worksheet_Drawing_Shadow implements PHPExcel_IComparable
|
||||
class Shadow implements \PHPExcel\IComparable
|
||||
{
|
||||
/* Shadow alignment */
|
||||
const SHADOW_BOTTOM = 'b';
|
||||
|
@ -79,7 +81,7 @@ class PHPExcel_Worksheet_Drawing_Shadow implements PHPExcel_IComparable
|
|||
/**
|
||||
* Color
|
||||
*
|
||||
* @var PHPExcel_Style_Color
|
||||
* @var \PHPExcel\Style\Color
|
||||
*/
|
||||
private $color;
|
||||
|
||||
|
@ -91,7 +93,7 @@ class PHPExcel_Worksheet_Drawing_Shadow implements PHPExcel_IComparable
|
|||
private $alpha;
|
||||
|
||||
/**
|
||||
* Create a new PHPExcel_Worksheet_Drawing_Shadow
|
||||
* Create a new Shadow
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
|
@ -100,8 +102,8 @@ class PHPExcel_Worksheet_Drawing_Shadow implements PHPExcel_IComparable
|
|||
$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->alignment = self::SHADOW_BOTTOM_RIGHT;
|
||||
$this->color = new \PHPExcel\Style\Color(\PHPExcel\Style\Color::COLOR_BLACK);
|
||||
$this->alpha = 50;
|
||||
}
|
||||
|
||||
|
@ -119,7 +121,7 @@ class PHPExcel_Worksheet_Drawing_Shadow implements PHPExcel_IComparable
|
|||
* Set Visible
|
||||
*
|
||||
* @param boolean $pValue
|
||||
* @return PHPExcel_Worksheet_Drawing_Shadow
|
||||
* @return Shadow
|
||||
*/
|
||||
public function setVisible($pValue = false)
|
||||
{
|
||||
|
@ -141,7 +143,7 @@ class PHPExcel_Worksheet_Drawing_Shadow implements PHPExcel_IComparable
|
|||
* Set Blur radius
|
||||
*
|
||||
* @param int $pValue
|
||||
* @return PHPExcel_Worksheet_Drawing_Shadow
|
||||
* @return Shadow
|
||||
*/
|
||||
public function setBlurRadius($pValue = 6)
|
||||
{
|
||||
|
@ -163,7 +165,7 @@ class PHPExcel_Worksheet_Drawing_Shadow implements PHPExcel_IComparable
|
|||
* Set Shadow distance
|
||||
*
|
||||
* @param int $pValue
|
||||
* @return PHPExcel_Worksheet_Drawing_Shadow
|
||||
* @return Shadow
|
||||
*/
|
||||
public function setDistance($pValue = 2)
|
||||
{
|
||||
|
@ -185,7 +187,7 @@ class PHPExcel_Worksheet_Drawing_Shadow implements PHPExcel_IComparable
|
|||
* Set Shadow direction (in degrees)
|
||||
*
|
||||
* @param int $pValue
|
||||
* @return PHPExcel_Worksheet_Drawing_Shadow
|
||||
* @return Shadow
|
||||
*/
|
||||
public function setDirection($pValue = 0)
|
||||
{
|
||||
|
@ -207,7 +209,7 @@ class PHPExcel_Worksheet_Drawing_Shadow implements PHPExcel_IComparable
|
|||
* Set Shadow alignment
|
||||
*
|
||||
* @param int $pValue
|
||||
* @return PHPExcel_Worksheet_Drawing_Shadow
|
||||
* @return Shadow
|
||||
*/
|
||||
public function setAlignment($pValue = 0)
|
||||
{
|
||||
|
@ -218,7 +220,7 @@ class PHPExcel_Worksheet_Drawing_Shadow implements PHPExcel_IComparable
|
|||
/**
|
||||
* Get Color
|
||||
*
|
||||
* @return PHPExcel_Style_Color
|
||||
* @return \PHPExcel\Style\Color
|
||||
*/
|
||||
public function getColor()
|
||||
{
|
||||
|
@ -228,11 +230,11 @@ class PHPExcel_Worksheet_Drawing_Shadow implements PHPExcel_IComparable
|
|||
/**
|
||||
* Set Color
|
||||
*
|
||||
* @param PHPExcel_Style_Color $pValue
|
||||
* @throws PHPExcel_Exception
|
||||
* @return PHPExcel_Worksheet_Drawing_Shadow
|
||||
* @param \PHPExcel\Style_Color $pValue
|
||||
* @throws \PHPExcel\Exception
|
||||
* @return Shadow
|
||||
*/
|
||||
public function setColor(PHPExcel_Style_Color $pValue = null)
|
||||
public function setColor(\PHPExcel\Style\Color $pValue = null)
|
||||
{
|
||||
$this->color = $pValue;
|
||||
return $this;
|
||||
|
@ -252,7 +254,7 @@ class PHPExcel_Worksheet_Drawing_Shadow implements PHPExcel_IComparable
|
|||
* Set Alpha
|
||||
*
|
||||
* @param int $pValue
|
||||
* @return PHPExcel_Worksheet_Drawing_Shadow
|
||||
* @return Shadow
|
||||
*/
|
||||
public function setAlpha($pValue = 0)
|
||||
{
|
||||
|
|
|
@ -171,12 +171,12 @@ class HeaderFooter
|
|||
/**
|
||||
* Header/footer images
|
||||
*
|
||||
* @var PHPExcel_Worksheet_HeaderFooterDrawing[]
|
||||
* @var HeaderFooterDrawing[]
|
||||
*/
|
||||
private $headerFooterImages = array();
|
||||
|
||||
/**
|
||||
* Create a new PHPExcel_Worksheet_HeaderFooter
|
||||
* Create a new HeaderFooter
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
|
@ -195,8 +195,8 @@ class HeaderFooter
|
|||
/**
|
||||
* Set OddHeader
|
||||
*
|
||||
* @param string $pValue
|
||||
* @return PHPExcel_Worksheet_HeaderFooter
|
||||
* @param string $pValue
|
||||
* @return HeaderFooter
|
||||
*/
|
||||
public function setOddHeader($pValue)
|
||||
{
|
||||
|
@ -217,8 +217,8 @@ class HeaderFooter
|
|||
/**
|
||||
* Set OddFooter
|
||||
*
|
||||
* @param string $pValue
|
||||
* @return PHPExcel_Worksheet_HeaderFooter
|
||||
* @param string $pValue
|
||||
* @return HeaderFooter
|
||||
*/
|
||||
public function setOddFooter($pValue)
|
||||
{
|
||||
|
@ -239,8 +239,8 @@ class HeaderFooter
|
|||
/**
|
||||
* Set EvenHeader
|
||||
*
|
||||
* @param string $pValue
|
||||
* @return PHPExcel_Worksheet_HeaderFooter
|
||||
* @param string $pValue
|
||||
* @return HeaderFooter
|
||||
*/
|
||||
public function setEvenHeader($pValue)
|
||||
{
|
||||
|
@ -261,8 +261,8 @@ class HeaderFooter
|
|||
/**
|
||||
* Set EvenFooter
|
||||
*
|
||||
* @param string $pValue
|
||||
* @return PHPExcel_Worksheet_HeaderFooter
|
||||
* @param string $pValue
|
||||
* @return HeaderFooter
|
||||
*/
|
||||
public function setEvenFooter($pValue)
|
||||
{
|
||||
|
@ -283,8 +283,8 @@ class HeaderFooter
|
|||
/**
|
||||
* Set FirstHeader
|
||||
*
|
||||
* @param string $pValue
|
||||
* @return PHPExcel_Worksheet_HeaderFooter
|
||||
* @param string $pValue
|
||||
* @return HeaderFooter
|
||||
*/
|
||||
public function setFirstHeader($pValue)
|
||||
{
|
||||
|
@ -306,7 +306,7 @@ class HeaderFooter
|
|||
* Set FirstFooter
|
||||
*
|
||||
* @param string $pValue
|
||||
* @return PHPExcel_Worksheet_HeaderFooter
|
||||
* @return HeaderFooter
|
||||
*/
|
||||
public function setFirstFooter($pValue)
|
||||
{
|
||||
|
@ -328,7 +328,7 @@ class HeaderFooter
|
|||
* Set DifferentOddEven
|
||||
*
|
||||
* @param boolean $pValue
|
||||
* @return PHPExcel_Worksheet_HeaderFooter
|
||||
* @return HeaderFooter
|
||||
*/
|
||||
public function setDifferentOddEven($pValue = false)
|
||||
{
|
||||
|
@ -350,7 +350,7 @@ class HeaderFooter
|
|||
* Set DifferentFirst
|
||||
*
|
||||
* @param boolean $pValue
|
||||
* @return PHPExcel_Worksheet_HeaderFooter
|
||||
* @return HeaderFooter
|
||||
*/
|
||||
public function setDifferentFirst($pValue = false)
|
||||
{
|
||||
|
@ -372,7 +372,7 @@ class HeaderFooter
|
|||
* Set ScaleWithDocument
|
||||
*
|
||||
* @param boolean $pValue
|
||||
* @return PHPExcel_Worksheet_HeaderFooter
|
||||
* @return HeaderFooter
|
||||
*/
|
||||
public function setScaleWithDocument($pValue = true)
|
||||
{
|
||||
|
@ -394,7 +394,7 @@ class HeaderFooter
|
|||
* Set AlignWithMargins
|
||||
*
|
||||
* @param boolean $pValue
|
||||
* @return PHPExcel_Worksheet_HeaderFooter
|
||||
* @return HeaderFooter
|
||||
*/
|
||||
public function setAlignWithMargins($pValue = true)
|
||||
{
|
||||
|
@ -405,12 +405,12 @@ class HeaderFooter
|
|||
/**
|
||||
* Add header/footer image
|
||||
*
|
||||
* @param PHPExcel_Worksheet_HeaderFooterDrawing $image
|
||||
* @param string $location
|
||||
* @throws PHPExcel_Exception
|
||||
* @return PHPExcel_Worksheet_HeaderFooter
|
||||
* @param HeaderFooterDrawing $image
|
||||
* @param string $location
|
||||
* @throws \PHPExcel\Exception
|
||||
* @return HeaderFooter
|
||||
*/
|
||||
public function addImage(PHPExcel_Worksheet_HeaderFooterDrawing $image = null, $location = self::IMAGE_HEADER_LEFT)
|
||||
public function addImage(HeaderFooterDrawing $image = null, $location = self::IMAGE_HEADER_LEFT)
|
||||
{
|
||||
$this->headerFooterImages[$location] = $image;
|
||||
return $this;
|
||||
|
@ -420,8 +420,8 @@ class HeaderFooter
|
|||
* Remove header/footer image
|
||||
*
|
||||
* @param string $location
|
||||
* @throws PHPExcel_Exception
|
||||
* @return PHPExcel_Worksheet_HeaderFooter
|
||||
* @throws \PHPExcel\Exception
|
||||
* @return HeaderFooter
|
||||
*/
|
||||
public function removeImage($location = self::IMAGE_HEADER_LEFT)
|
||||
{
|
||||
|
@ -434,14 +434,14 @@ class HeaderFooter
|
|||
/**
|
||||
* Set header/footer images
|
||||
*
|
||||
* @param PHPExcel_Worksheet_HeaderFooterDrawing[] $images
|
||||
* @throws PHPExcel_Exception
|
||||
* @return PHPExcel_Worksheet_HeaderFooter
|
||||
* @param HeaderFooterDrawing[] $images
|
||||
* @throws \PHPExcel\Exception
|
||||
* @return HeaderFooter
|
||||
*/
|
||||
public function setImages($images)
|
||||
{
|
||||
if (!is_array($images)) {
|
||||
throw new PHPExcel_Exception('Invalid parameter!');
|
||||
throw new \PHPExcel\Exception('Invalid parameter!');
|
||||
}
|
||||
|
||||
$this->headerFooterImages = $images;
|
||||
|
@ -451,7 +451,7 @@ class HeaderFooter
|
|||
/**
|
||||
* Get header/footer images
|
||||
*
|
||||
* @return PHPExcel_Worksheet_HeaderFooterDrawing[]
|
||||
* @return HeaderFooterDrawing[]
|
||||
*/
|
||||
public function getImages()
|
||||
{
|
||||
|
|
|
@ -79,7 +79,7 @@ class HeaderFooterDrawing extends Drawing implements \PHPExcel\IComparable
|
|||
protected $resizeProportional;
|
||||
|
||||
/**
|
||||
* Create a new PHPExcel_Worksheet_HeaderFooterDrawing
|
||||
* Create a new HeaderFooterDrawing
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
|
@ -107,7 +107,7 @@ class HeaderFooterDrawing extends Drawing implements \PHPExcel\IComparable
|
|||
* Set Name
|
||||
*
|
||||
* @param string $pValue
|
||||
* @return PHPExcel_Worksheet_HeaderFooterDrawing
|
||||
* @return HeaderFooterDrawing
|
||||
*/
|
||||
public function setName($pValue = '')
|
||||
{
|
||||
|
@ -129,7 +129,7 @@ class HeaderFooterDrawing extends Drawing implements \PHPExcel\IComparable
|
|||
* Set OffsetX
|
||||
*
|
||||
* @param int $pValue
|
||||
* @return PHPExcel_Worksheet_HeaderFooterDrawing
|
||||
* @return HeaderFooterDrawing
|
||||
*/
|
||||
public function setOffsetX($pValue = 0)
|
||||
{
|
||||
|
@ -151,7 +151,7 @@ class HeaderFooterDrawing extends Drawing implements \PHPExcel\IComparable
|
|||
* Set OffsetY
|
||||
*
|
||||
* @param int $pValue
|
||||
* @return PHPExcel_Worksheet_HeaderFooterDrawing
|
||||
* @return HeaderFooterDrawing
|
||||
*/
|
||||
public function setOffsetY($pValue = 0)
|
||||
{
|
||||
|
@ -173,7 +173,7 @@ class HeaderFooterDrawing extends Drawing implements \PHPExcel\IComparable
|
|||
* Set Width
|
||||
*
|
||||
* @param int $pValue
|
||||
* @return PHPExcel_Worksheet_HeaderFooterDrawing
|
||||
* @return HeaderFooterDrawing
|
||||
*/
|
||||
public function setWidth($pValue = 0)
|
||||
{
|
||||
|
@ -203,7 +203,7 @@ class HeaderFooterDrawing extends Drawing implements \PHPExcel\IComparable
|
|||
* Set Height
|
||||
*
|
||||
* @param int $pValue
|
||||
* @return PHPExcel_Worksheet_HeaderFooterDrawing
|
||||
* @return HeaderFooterDrawing
|
||||
*/
|
||||
public function setHeight($pValue = 0)
|
||||
{
|
||||
|
@ -230,7 +230,7 @@ class HeaderFooterDrawing extends Drawing implements \PHPExcel\IComparable
|
|||
* @author Vincent@luo MSN:kele_100@hotmail.com
|
||||
* @param int $width
|
||||
* @param int $height
|
||||
* @return PHPExcel_Worksheet_HeaderFooterDrawing
|
||||
* @return HeaderFooterDrawing
|
||||
*/
|
||||
public function setWidthAndHeight($width = 0, $height = 0)
|
||||
{
|
||||
|
@ -262,7 +262,7 @@ class HeaderFooterDrawing extends Drawing implements \PHPExcel\IComparable
|
|||
* Set ResizeProportional
|
||||
*
|
||||
* @param boolean $pValue
|
||||
* @return PHPExcel_Worksheet_HeaderFooterDrawing
|
||||
* @return HeaderFooterDrawing
|
||||
*/
|
||||
public function setResizeProportional($pValue = true)
|
||||
{
|
||||
|
@ -304,10 +304,10 @@ class HeaderFooterDrawing extends Drawing implements \PHPExcel\IComparable
|
|||
/**
|
||||
* Set Path
|
||||
*
|
||||
* @param string $pValue File path
|
||||
* @param boolean $pVerifyFile Verify file
|
||||
* @throws PHPExcel_Exception
|
||||
* @return PHPExcel_Worksheet_HeaderFooterDrawing
|
||||
* @param string $pValue File path
|
||||
* @param boolean $pVerifyFile Verify file
|
||||
* @throws \PHPExcel\Exception
|
||||
* @return HeaderFooterDrawing
|
||||
*/
|
||||
public function setPath($pValue = '', $pVerifyFile = true)
|
||||
{
|
||||
|
@ -320,7 +320,7 @@ class HeaderFooterDrawing extends Drawing implements \PHPExcel\IComparable
|
|||
list($this->width, $this->height) = getimagesize($pValue);
|
||||
}
|
||||
} else {
|
||||
throw new PHPExcel_Exception("File $pValue not found!");
|
||||
throw new \PHPExcel\Exception("File $pValue not found!");
|
||||
}
|
||||
} else {
|
||||
$this->path = $pValue;
|
||||
|
|
|
@ -70,7 +70,7 @@ class MemoryDrawing extends BaseDrawing implements \PHPExcel\IComparable
|
|||
private $uniqueName;
|
||||
|
||||
/**
|
||||
* Create a new PHPExcel_Worksheet_MemoryDrawing
|
||||
* Create a new MemoryDrawing
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
|
@ -98,7 +98,7 @@ class MemoryDrawing extends BaseDrawing implements \PHPExcel\IComparable
|
|||
* Set image resource
|
||||
*
|
||||
* @param $value resource
|
||||
* @return PHPExcel_Worksheet_MemoryDrawing
|
||||
* @return MemoryDrawing
|
||||
*/
|
||||
public function setImageResource($value = null)
|
||||
{
|
||||
|
@ -126,9 +126,9 @@ class MemoryDrawing extends BaseDrawing implements \PHPExcel\IComparable
|
|||
* Set rendering function
|
||||
*
|
||||
* @param string $value
|
||||
* @return PHPExcel_Worksheet_MemoryDrawing
|
||||
* @return MemoryDrawing
|
||||
*/
|
||||
public function setRenderingFunction($value = PHPExcel_Worksheet_MemoryDrawing::RENDERING_DEFAULT)
|
||||
public function setRenderingFunction($value = self::RENDERING_DEFAULT)
|
||||
{
|
||||
$this->renderingFunction = $value;
|
||||
return $this;
|
||||
|
@ -148,9 +148,9 @@ class MemoryDrawing extends BaseDrawing implements \PHPExcel\IComparable
|
|||
* Set mime type
|
||||
*
|
||||
* @param string $value
|
||||
* @return PHPExcel_Worksheet_MemoryDrawing
|
||||
* @return MemoryDrawing
|
||||
*/
|
||||
public function setMimeType($value = PHPExcel_Worksheet_MemoryDrawing::MIMETYPE_DEFAULT)
|
||||
public function setMimeType($value = self::MIMETYPE_DEFAULT)
|
||||
{
|
||||
$this->mimeType = $value;
|
||||
return $this;
|
||||
|
|
|
@ -72,7 +72,7 @@ class PageMargins
|
|||
private $footer = 0.3;
|
||||
|
||||
/**
|
||||
* Create a new PHPExcel_Worksheet_PageMargins
|
||||
* Create a new PageMargins
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
|
@ -92,7 +92,7 @@ class PageMargins
|
|||
* Set Left
|
||||
*
|
||||
* @param double $pValue
|
||||
* @return PHPExcel_Worksheet_PageMargins
|
||||
* @return PageMargins
|
||||
*/
|
||||
public function setLeft($pValue)
|
||||
{
|
||||
|
@ -114,7 +114,7 @@ class PageMargins
|
|||
* Set Right
|
||||
*
|
||||
* @param double $pValue
|
||||
* @return PHPExcel_Worksheet_PageMargins
|
||||
* @return PageMargins
|
||||
*/
|
||||
public function setRight($pValue)
|
||||
{
|
||||
|
@ -136,7 +136,7 @@ class PageMargins
|
|||
* Set Top
|
||||
*
|
||||
* @param double $pValue
|
||||
* @return PHPExcel_Worksheet_PageMargins
|
||||
* @return PageMargins
|
||||
*/
|
||||
public function setTop($pValue)
|
||||
{
|
||||
|
@ -158,7 +158,7 @@ class PageMargins
|
|||
* Set Bottom
|
||||
*
|
||||
* @param double $pValue
|
||||
* @return PHPExcel_Worksheet_PageMargins
|
||||
* @return PageMargins
|
||||
*/
|
||||
public function setBottom($pValue)
|
||||
{
|
||||
|
@ -180,7 +180,7 @@ class PageMargins
|
|||
* Set Header
|
||||
*
|
||||
* @param double $pValue
|
||||
* @return PHPExcel_Worksheet_PageMargins
|
||||
* @return PageMargins
|
||||
*/
|
||||
public function setHeader($pValue)
|
||||
{
|
||||
|
@ -202,7 +202,7 @@ class PageMargins
|
|||
* Set Footer
|
||||
*
|
||||
* @param double $pValue
|
||||
* @return PHPExcel_Worksheet_PageMargins
|
||||
* @return PageMargins
|
||||
*/
|
||||
public function setFooter($pValue)
|
||||
{
|
||||
|
|
|
@ -590,7 +590,7 @@ class PageSetup
|
|||
* Default behaviour, or a index value of 0, will return all ranges as a comma-separated string
|
||||
* Otherwise, the specific range identified by the value of $index will be returned
|
||||
* Print areas are numbered from 1
|
||||
* @throws PHPExcel_Exception
|
||||
* @throws \PHPExcel\Exception
|
||||
* @return string
|
||||
*/
|
||||
public function getPrintArea($index = 0)
|
||||
|
@ -602,7 +602,7 @@ class PageSetup
|
|||
if (isset($printAreas[$index-1])) {
|
||||
return $printAreas[$index-1];
|
||||
}
|
||||
throw new PHPExcel_Exception("Requested Print Area does not exist");
|
||||
throw new \PHPExcel\Exception("Requested Print Area does not exist");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -670,11 +670,11 @@ class PageSetup
|
|||
public function setPrintArea($value, $index = 0, $method = self::SETPRINTRANGE_OVERWRITE)
|
||||
{
|
||||
if (strpos($value, '!') !== false) {
|
||||
throw new PHPExcel_Exception('Cell coordinate must not specify a worksheet.');
|
||||
throw new \PHPExcel\Exception('Cell coordinate must not specify a worksheet.');
|
||||
} elseif (strpos($value, ':') === false) {
|
||||
throw new PHPExcel_Exception('Cell coordinate must be a range of cells.');
|
||||
throw new \PHPExcel\Exception('Cell coordinate must be a range of cells.');
|
||||
} elseif (strpos($value, '$') !== false) {
|
||||
throw new PHPExcel_Exception('Cell coordinate must not be absolute.');
|
||||
throw new \PHPExcel\Exception('Cell coordinate must not be absolute.');
|
||||
}
|
||||
$value = strtoupper($value);
|
||||
|
||||
|
@ -687,7 +687,7 @@ class PageSetup
|
|||
$index = count($printAreas) - abs($index) + 1;
|
||||
}
|
||||
if (($index <= 0) || ($index > count($printAreas))) {
|
||||
throw new PHPExcel_Exception('Invalid index for setting print range.');
|
||||
throw new \PHPExcel\Exception('Invalid index for setting print range.');
|
||||
}
|
||||
$printAreas[$index-1] = $value;
|
||||
$this->printArea = implode(',', $printAreas);
|
||||
|
@ -701,13 +701,13 @@ class PageSetup
|
|||
$index = abs($index) - 1;
|
||||
}
|
||||
if ($index > count($printAreas)) {
|
||||
throw new PHPExcel_Exception('Invalid index for setting print range.');
|
||||
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);
|
||||
}
|
||||
} else {
|
||||
throw new PHPExcel_Exception('Invalid method for setting print range.');
|
||||
throw new \PHPExcel\Exception('Invalid method for setting print range.');
|
||||
}
|
||||
|
||||
return $this;
|
||||
|
@ -757,7 +757,7 @@ class 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,
|
||||
\PHPExcel\Cell::stringFromColumnIndex($column1) . $row1 . ':' . \PHPExcel\Cell::stringFromColumnIndex($column2) . $row2,
|
||||
$index,
|
||||
$method
|
||||
);
|
||||
|
@ -782,7 +782,7 @@ class PageSetup
|
|||
public function addPrintAreaByColumnAndRow($column1, $row1, $column2, $row2, $index = -1)
|
||||
{
|
||||
return $this->setPrintArea(
|
||||
PHPExcel_Cell::stringFromColumnIndex($column1) . $row1 . ':' . PHPExcel_Cell::stringFromColumnIndex($column2) . $row2,
|
||||
\PHPExcel\Cell::stringFromColumnIndex($column1) . $row1 . ':' . \PHPExcel\Cell::stringFromColumnIndex($column2) . $row2,
|
||||
$index,
|
||||
self::SETPRINTRANGE_INSERT
|
||||
);
|
||||
|
@ -802,7 +802,7 @@ class PageSetup
|
|||
* Set first page number
|
||||
*
|
||||
* @param int $value
|
||||
* @return PHPExcel_Worksheet_HeaderFooter
|
||||
* @return HeaderFooter
|
||||
*/
|
||||
public function setFirstPageNumber($value = null)
|
||||
{
|
||||
|
@ -813,7 +813,7 @@ class PageSetup
|
|||
/**
|
||||
* Reset first page number
|
||||
*
|
||||
* @return PHPExcel_Worksheet_HeaderFooter
|
||||
* @return HeaderFooter
|
||||
*/
|
||||
public function resetFirstPageNumber()
|
||||
{
|
||||
|
|
|
@ -149,7 +149,7 @@ class Protection
|
|||
private $password = '';
|
||||
|
||||
/**
|
||||
* Create a new PHPExcel_Worksheet_Protection
|
||||
* Create a new Protection
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
|
@ -194,7 +194,7 @@ class Protection
|
|||
* Set Sheet
|
||||
*
|
||||
* @param boolean $pValue
|
||||
* @return PHPExcel_Worksheet_Protection
|
||||
* @return Protection
|
||||
*/
|
||||
public function setSheet($pValue = false)
|
||||
{
|
||||
|
@ -216,7 +216,7 @@ class Protection
|
|||
* Set Objects
|
||||
*
|
||||
* @param boolean $pValue
|
||||
* @return PHPExcel_Worksheet_Protection
|
||||
* @return Protection
|
||||
*/
|
||||
public function setObjects($pValue = false)
|
||||
{
|
||||
|
@ -238,7 +238,7 @@ class Protection
|
|||
* Set Scenarios
|
||||
*
|
||||
* @param boolean $pValue
|
||||
* @return PHPExcel_Worksheet_Protection
|
||||
* @return Protection
|
||||
*/
|
||||
public function setScenarios($pValue = false)
|
||||
{
|
||||
|
@ -260,7 +260,7 @@ class Protection
|
|||
* Set FormatCells
|
||||
*
|
||||
* @param boolean $pValue
|
||||
* @return PHPExcel_Worksheet_Protection
|
||||
* @return Protection
|
||||
*/
|
||||
public function setFormatCells($pValue = false)
|
||||
{
|
||||
|
@ -282,7 +282,7 @@ class Protection
|
|||
* Set FormatColumns
|
||||
*
|
||||
* @param boolean $pValue
|
||||
* @return PHPExcel_Worksheet_Protection
|
||||
* @return Protection
|
||||
*/
|
||||
public function setFormatColumns($pValue = false)
|
||||
{
|
||||
|
@ -304,7 +304,7 @@ class Protection
|
|||
* Set FormatRows
|
||||
*
|
||||
* @param boolean $pValue
|
||||
* @return PHPExcel_Worksheet_Protection
|
||||
* @return Protection
|
||||
*/
|
||||
public function setFormatRows($pValue = false)
|
||||
{
|
||||
|
@ -326,7 +326,7 @@ class Protection
|
|||
* Set InsertColumns
|
||||
*
|
||||
* @param boolean $pValue
|
||||
* @return PHPExcel_Worksheet_Protection
|
||||
* @return Protection
|
||||
*/
|
||||
public function setInsertColumns($pValue = false)
|
||||
{
|
||||
|
@ -348,7 +348,7 @@ class Protection
|
|||
* Set InsertRows
|
||||
*
|
||||
* @param boolean $pValue
|
||||
* @return PHPExcel_Worksheet_Protection
|
||||
* @return Protection
|
||||
*/
|
||||
public function setInsertRows($pValue = false)
|
||||
{
|
||||
|
@ -370,7 +370,7 @@ class Protection
|
|||
* Set InsertHyperlinks
|
||||
*
|
||||
* @param boolean $pValue
|
||||
* @return PHPExcel_Worksheet_Protection
|
||||
* @return Protection
|
||||
*/
|
||||
public function setInsertHyperlinks($pValue = false)
|
||||
{
|
||||
|
@ -392,7 +392,7 @@ class Protection
|
|||
* Set DeleteColumns
|
||||
*
|
||||
* @param boolean $pValue
|
||||
* @return PHPExcel_Worksheet_Protection
|
||||
* @return Protection
|
||||
*/
|
||||
public function setDeleteColumns($pValue = false)
|
||||
{
|
||||
|
@ -414,7 +414,7 @@ class Protection
|
|||
* Set DeleteRows
|
||||
*
|
||||
* @param boolean $pValue
|
||||
* @return PHPExcel_Worksheet_Protection
|
||||
* @return Protection
|
||||
*/
|
||||
public function setDeleteRows($pValue = false)
|
||||
{
|
||||
|
@ -436,7 +436,7 @@ class Protection
|
|||
* Set SelectLockedCells
|
||||
*
|
||||
* @param boolean $pValue
|
||||
* @return PHPExcel_Worksheet_Protection
|
||||
* @return Protection
|
||||
*/
|
||||
public function setSelectLockedCells($pValue = false)
|
||||
{
|
||||
|
@ -458,7 +458,7 @@ class Protection
|
|||
* Set Sort
|
||||
*
|
||||
* @param boolean $pValue
|
||||
* @return PHPExcel_Worksheet_Protection
|
||||
* @return Protection
|
||||
*/
|
||||
public function setSort($pValue = false)
|
||||
{
|
||||
|
@ -480,7 +480,7 @@ class Protection
|
|||
* Set AutoFilter
|
||||
*
|
||||
* @param boolean $pValue
|
||||
* @return PHPExcel_Worksheet_Protection
|
||||
* @return Protection
|
||||
*/
|
||||
public function setAutoFilter($pValue = false)
|
||||
{
|
||||
|
@ -502,7 +502,7 @@ class Protection
|
|||
* Set PivotTables
|
||||
*
|
||||
* @param boolean $pValue
|
||||
* @return PHPExcel_Worksheet_Protection
|
||||
* @return Protection
|
||||
*/
|
||||
public function setPivotTables($pValue = false)
|
||||
{
|
||||
|
@ -524,7 +524,7 @@ class Protection
|
|||
* Set SelectUnlockedCells
|
||||
*
|
||||
* @param boolean $pValue
|
||||
* @return PHPExcel_Worksheet_Protection
|
||||
* @return Protection
|
||||
*/
|
||||
public function setSelectUnlockedCells($pValue = false)
|
||||
{
|
||||
|
@ -547,12 +547,12 @@ class Protection
|
|||
*
|
||||
* @param string $pValue
|
||||
* @param boolean $pAlreadyHashed If the password has already been hashed, set this to true
|
||||
* @return PHPExcel_Worksheet_Protection
|
||||
* @return Protection
|
||||
*/
|
||||
public function setPassword($pValue = '', $pAlreadyHashed = false)
|
||||
{
|
||||
if (!$pAlreadyHashed) {
|
||||
$pValue = PHPExcel_Shared_PasswordHasher::hashPassword($pValue);
|
||||
$pValue = \PHPExcel\Shared\PasswordHasher::hashPassword($pValue);
|
||||
}
|
||||
$this->password = $pValue;
|
||||
return $this;
|
||||
|
|
|
@ -30,9 +30,9 @@ namespace PHPExcel\Worksheet;
|
|||
class Row
|
||||
{
|
||||
/**
|
||||
* PHPExcel_Worksheet
|
||||
* \PHPExcel\Worksheet
|
||||
*
|
||||
* @var PHPExcel_Worksheet
|
||||
* @var \PHPExcel\Worksheet
|
||||
*/
|
||||
private $parent;
|
||||
|
||||
|
@ -46,10 +46,10 @@ class Row
|
|||
/**
|
||||
* Create a new row
|
||||
*
|
||||
* @param PHPExcel_Worksheet $parent
|
||||
* @param \PHPExcel\Worksheet $parent
|
||||
* @param int $rowIndex
|
||||
*/
|
||||
public function __construct(PHPExcel_Worksheet $parent = null, $rowIndex = 1)
|
||||
public function __construct(\PHPExcel\Worksheet $parent = null, $rowIndex = 1)
|
||||
{
|
||||
// Set parent and row index
|
||||
$this->parent = $parent;
|
||||
|
@ -79,10 +79,10 @@ class Row
|
|||
*
|
||||
* @param string $startColumn The column address at which to start iterating
|
||||
* @param string $endColumn Optionally, the column address at which to stop iterating
|
||||
* @return PHPExcel_Worksheet_CellIterator
|
||||
* @return RowCellIterator
|
||||
*/
|
||||
public function getCellIterator($startColumn = 'A', $endColumn = null)
|
||||
{
|
||||
return new PHPExcel_Worksheet_RowCellIterator($this->parent, $this->rowIndex, $startColumn, $endColumn);
|
||||
return new RowCellIterator($this->parent, $this->rowIndex, $startColumn, $endColumn);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,12 +53,12 @@ class RowCellIterator extends CellIterator implements \Iterator
|
|||
/**
|
||||
* Create a new column iterator
|
||||
*
|
||||
* @param PHPExcel_Worksheet $subject The worksheet to iterate over
|
||||
* @param integer $rowIndex The row that we want to iterate
|
||||
* @param string $startColumn The column address at which to start iterating
|
||||
* @param string $endColumn Optionally, the column address at which to stop iterating
|
||||
* @param \PHPExcel\Worksheet $subject The worksheet to iterate over
|
||||
* @param integer $rowIndex The row that we want to iterate
|
||||
* @param string $startColumn The column address at which to start iterating
|
||||
* @param string $endColumn Optionally, the column address at which to stop iterating
|
||||
*/
|
||||
public function __construct(PHPExcel_Worksheet $subject = null, $rowIndex = 1, $startColumn = 'A', $endColumn = null)
|
||||
public function __construct(\PHPExcel\Worksheet $subject = null, $rowIndex = 1, $startColumn = 'A', $endColumn = null)
|
||||
{
|
||||
// Set subject and row index
|
||||
$this->subject = $subject;
|
||||
|
@ -79,15 +79,15 @@ class RowCellIterator extends CellIterator implements \Iterator
|
|||
* (Re)Set the start column and the current column pointer
|
||||
*
|
||||
* @param integer $startColumn The column address at which to start iterating
|
||||
* @return PHPExcel_Worksheet_RowCellIterator
|
||||
* @throws PHPExcel_Exception
|
||||
* @return RowCellIterator
|
||||
* @throws \PHPExcel\Exception
|
||||
*/
|
||||
public function resetStart($startColumn = 'A')
|
||||
{
|
||||
$startColumnIndex = PHPExcel_Cell::columnIndexFromString($startColumn) - 1;
|
||||
$startColumnIndex = \PHPExcel\Cell::columnIndexFromString($startColumn) - 1;
|
||||
$this->startColumn = $startColumnIndex;
|
||||
$this->adjustForExistingOnlyRange();
|
||||
$this->seek(PHPExcel_Cell::stringFromColumnIndex($this->startColumn));
|
||||
$this->seek(\PHPExcel\Cell::stringFromColumnIndex($this->startColumn));
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
@ -96,13 +96,13 @@ class RowCellIterator extends CellIterator implements \Iterator
|
|||
* (Re)Set the end column
|
||||
*
|
||||
* @param string $endColumn The column address at which to stop iterating
|
||||
* @return PHPExcel_Worksheet_RowCellIterator
|
||||
* @throws PHPExcel_Exception
|
||||
* @return RowCellIterator
|
||||
* @throws \PHPExcel\Exception
|
||||
*/
|
||||
public function resetEnd($endColumn = null)
|
||||
{
|
||||
$endColumn = ($endColumn) ? $endColumn : $this->subject->getHighestColumn();
|
||||
$this->endColumn = PHPExcel_Cell::columnIndexFromString($endColumn) - 1;
|
||||
$this->endColumn = \PHPExcel\Cell::columnIndexFromString($endColumn) - 1;
|
||||
$this->adjustForExistingOnlyRange();
|
||||
|
||||
return $this;
|
||||
|
@ -112,16 +112,16 @@ class RowCellIterator extends CellIterator implements \Iterator
|
|||
* Set the column pointer to the selected column
|
||||
*
|
||||
* @param string $column The column address to set the current pointer at
|
||||
* @return PHPExcel_Worksheet_RowCellIterator
|
||||
* @throws PHPExcel_Exception
|
||||
* @return RowCellIterator
|
||||
* @throws \PHPExcel\Exception
|
||||
*/
|
||||
public function seek($column = 'A')
|
||||
{
|
||||
$column = PHPExcel_Cell::columnIndexFromString($column) - 1;
|
||||
$column = \PHPExcel\Cell::columnIndexFromString($column) - 1;
|
||||
if (($column < $this->startColumn) || ($column > $this->endColumn)) {
|
||||
throw new PHPExcel_Exception("Column $column is out of range ({$this->startColumn} - {$this->endColumn})");
|
||||
throw new \PHPExcel\Exception("Column $column is out of range ({$this->startColumn} - {$this->endColumn})");
|
||||
} elseif ($this->onlyExistingCells && !($this->subject->cellExistsByColumnAndRow($column, $this->rowIndex))) {
|
||||
throw new PHPExcel_Exception('In "IterateOnlyExistingCells" mode and Cell does not exist');
|
||||
throw new \PHPExcel\Exception('In "IterateOnlyExistingCells" mode and Cell does not exist');
|
||||
}
|
||||
$this->position = $column;
|
||||
|
||||
|
@ -139,7 +139,7 @@ class RowCellIterator extends CellIterator implements \Iterator
|
|||
/**
|
||||
* Return the current cell in this worksheet row
|
||||
*
|
||||
* @return PHPExcel_Cell
|
||||
* @return \PHPExcel\Cell
|
||||
*/
|
||||
public function current()
|
||||
{
|
||||
|
@ -153,7 +153,7 @@ class RowCellIterator extends CellIterator implements \Iterator
|
|||
*/
|
||||
public function key()
|
||||
{
|
||||
return PHPExcel_Cell::stringFromColumnIndex($this->position);
|
||||
return \PHPExcel\Cell::stringFromColumnIndex($this->position);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -171,15 +171,15 @@ class RowCellIterator extends CellIterator implements \Iterator
|
|||
/**
|
||||
* Set the iterator to its previous value
|
||||
*
|
||||
* @throws PHPExcel_Exception
|
||||
* @throws \PHPExcel\Exception
|
||||
*/
|
||||
public function prev()
|
||||
{
|
||||
if ($this->position <= $this->startColumn) {
|
||||
throw new PHPExcel_Exception(
|
||||
throw new \PHPExcel\Exception(
|
||||
"Column is already at the beginning of range (" .
|
||||
PHPExcel_Cell::stringFromColumnIndex($this->endColumn) . " - " .
|
||||
PHPExcel_Cell::stringFromColumnIndex($this->endColumn) . ")"
|
||||
\PHPExcel\Cell::stringFromColumnIndex($this->endColumn) . " - " .
|
||||
\PHPExcel\Cell::stringFromColumnIndex($this->endColumn) . ")"
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -203,7 +203,7 @@ class RowCellIterator extends CellIterator implements \Iterator
|
|||
/**
|
||||
* Validate start/end values for "IterateOnlyExistingCells" mode, and adjust if necessary
|
||||
*
|
||||
* @throws PHPExcel_Exception
|
||||
* @throws \PHPExcel\Exception
|
||||
*/
|
||||
protected function adjustForExistingOnlyRange()
|
||||
{
|
||||
|
@ -213,14 +213,14 @@ class RowCellIterator extends CellIterator implements \Iterator
|
|||
++$this->startColumn;
|
||||
}
|
||||
if ($this->startColumn > $this->endColumn) {
|
||||
throw new PHPExcel_Exception('No cells exist within the specified range');
|
||||
throw new \PHPExcel\Exception('No cells exist within the specified range');
|
||||
}
|
||||
while ((!$this->subject->cellExistsByColumnAndRow($this->endColumn, $this->rowIndex)) &&
|
||||
($this->endColumn >= $this->startColumn)) {
|
||||
--$this->endColumn;
|
||||
}
|
||||
if ($this->endColumn < $this->startColumn) {
|
||||
throw new PHPExcel_Exception('No cells exist within the specified range');
|
||||
throw new \PHPExcel\Exception('No cells exist within the specified range');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ class RowDimension extends Dimension
|
|||
private $zeroHeight = false;
|
||||
|
||||
/**
|
||||
* Create a new PHPExcel_Worksheet_RowDimension
|
||||
* Create a new RowDimension
|
||||
*
|
||||
* @param int $pIndex Numeric row index
|
||||
*/
|
||||
|
@ -80,7 +80,7 @@ class RowDimension extends Dimension
|
|||
* Set Row Index
|
||||
*
|
||||
* @param int $pValue
|
||||
* @return PHPExcel_Worksheet_RowDimension
|
||||
* @return RowDimension
|
||||
*/
|
||||
public function setRowIndex($pValue)
|
||||
{
|
||||
|
@ -102,7 +102,7 @@ class RowDimension extends Dimension
|
|||
* Set Row Height
|
||||
*
|
||||
* @param double $pValue
|
||||
* @return PHPExcel_Worksheet_RowDimension
|
||||
* @return RowDimension
|
||||
*/
|
||||
public function setRowHeight($pValue = -1)
|
||||
{
|
||||
|
@ -124,7 +124,7 @@ class RowDimension extends Dimension
|
|||
* Set ZeroHeight
|
||||
*
|
||||
* @param bool $pValue
|
||||
* @return PHPExcel_Worksheet_RowDimension
|
||||
* @return RowDimension
|
||||
*/
|
||||
public function setZeroHeight($pValue = false)
|
||||
{
|
||||
|
|
|
@ -30,9 +30,9 @@ namespace PHPExcel\Worksheet;
|
|||
class RowIterator implements \Iterator
|
||||
{
|
||||
/**
|
||||
* PHPExcel_Worksheet to iterate
|
||||
* \PHPExcel\Worksheet to iterate
|
||||
*
|
||||
* @var PHPExcel_Worksheet
|
||||
* @var \PHPExcel\Worksheet
|
||||
*/
|
||||
private $subject;
|
||||
|
||||
|
@ -62,11 +62,11 @@ class RowIterator implements \Iterator
|
|||
/**
|
||||
* Create a new row iterator
|
||||
*
|
||||
* @param PHPExcel_Worksheet $subject The worksheet to iterate over
|
||||
* @param integer $startRow The row number at which to start iterating
|
||||
* @param integer $endRow Optionally, the row number at which to stop iterating
|
||||
* @param \PHPExcel\Worksheet $subject The worksheet to iterate over
|
||||
* @param integer $startRow The row number at which to start iterating
|
||||
* @param integer $endRow Optionally, the row number at which to stop iterating
|
||||
*/
|
||||
public function __construct(PHPExcel_Worksheet $subject = null, $startRow = 1, $endRow = null)
|
||||
public function __construct(\PHPExcel\Worksheet $subject = null, $startRow = 1, $endRow = null)
|
||||
{
|
||||
// Set subject
|
||||
$this->subject = $subject;
|
||||
|
@ -86,7 +86,7 @@ class RowIterator implements \Iterator
|
|||
* (Re)Set the start row and the current row pointer
|
||||
*
|
||||
* @param integer $startRow The row number at which to start iterating
|
||||
* @return PHPExcel_Worksheet_RowIterator
|
||||
* @return RowIterator
|
||||
*/
|
||||
public function resetStart($startRow = 1)
|
||||
{
|
||||
|
@ -100,7 +100,7 @@ class RowIterator implements \Iterator
|
|||
* (Re)Set the end row
|
||||
*
|
||||
* @param integer $endRow The row number at which to stop iterating
|
||||
* @return PHPExcel_Worksheet_RowIterator
|
||||
* @return RowIterator
|
||||
*/
|
||||
public function resetEnd($endRow = null)
|
||||
{
|
||||
|
@ -113,13 +113,13 @@ class RowIterator implements \Iterator
|
|||
* Set the row pointer to the selected row
|
||||
*
|
||||
* @param integer $row The row number to set the current pointer at
|
||||
* @return PHPExcel_Worksheet_RowIterator
|
||||
* @throws PHPExcel_Exception
|
||||
* @return RowIterator
|
||||
* @throws \PHPExcel\Exception
|
||||
*/
|
||||
public function seek($row = 1)
|
||||
{
|
||||
if (($row < $this->startRow) || ($row > $this->endRow)) {
|
||||
throw new PHPExcel_Exception("Row $row is out of range ({$this->startRow} - {$this->endRow})");
|
||||
throw new \PHPExcel\Exception("Row $row is out of range ({$this->startRow} - {$this->endRow})");
|
||||
}
|
||||
$this->position = $row;
|
||||
|
||||
|
@ -137,11 +137,11 @@ class RowIterator implements \Iterator
|
|||
/**
|
||||
* Return the current row in this worksheet
|
||||
*
|
||||
* @return PHPExcel_Worksheet_Row
|
||||
* @return Row
|
||||
*/
|
||||
public function current()
|
||||
{
|
||||
return new PHPExcel_Worksheet_Row($this->subject, $this->position);
|
||||
return new Row($this->subject, $this->position);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -164,11 +164,13 @@ class RowIterator implements \Iterator
|
|||
|
||||
/**
|
||||
* Set the iterator to its previous value
|
||||
*
|
||||
* @throws \PHPExcel\Exception
|
||||
*/
|
||||
public function prev()
|
||||
{
|
||||
if ($this->position <= $this->startRow) {
|
||||
throw new PHPExcel_Exception("Row is already at the beginning of range ({$this->startRow} - {$this->endRow})");
|
||||
throw new \PHPExcel\Exception("Row is already at the beginning of range ({$this->startRow} - {$this->endRow})");
|
||||
}
|
||||
|
||||
--$this->position;
|
||||
|
|
|
@ -69,7 +69,7 @@ class SheetView
|
|||
private $sheetviewType = self::SHEETVIEW_NORMAL;
|
||||
|
||||
/**
|
||||
* Create a new PHPExcel_Worksheet_SheetView
|
||||
* Create a new SheetView
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
|
@ -90,9 +90,9 @@ class SheetView
|
|||
*
|
||||
* Valid values range from 10 to 400.
|
||||
*
|
||||
* @param int $pValue
|
||||
* @throws PHPExcel_Exception
|
||||
* @return PHPExcel_Worksheet_SheetView
|
||||
* @param int $pValue
|
||||
* @throws \PHPExcel\Exception
|
||||
* @return SheetView
|
||||
*/
|
||||
public function setZoomScale($pValue = 100)
|
||||
{
|
||||
|
@ -101,7 +101,7 @@ class SheetView
|
|||
if (($pValue >= 1) || is_null($pValue)) {
|
||||
$this->zoomScale = $pValue;
|
||||
} else {
|
||||
throw new PHPExcel_Exception("Scale must be greater than or equal to 1.");
|
||||
throw new \PHPExcel\Exception("Scale must be greater than or equal to 1.");
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
@ -121,16 +121,16 @@ class SheetView
|
|||
*
|
||||
* Valid values range from 10 to 400.
|
||||
*
|
||||
* @param int $pValue
|
||||
* @throws PHPExcel_Exception
|
||||
* @return PHPExcel_Worksheet_SheetView
|
||||
* @param int $pValue
|
||||
* @throws \PHPExcel\Exception
|
||||
* @return SheetView
|
||||
*/
|
||||
public function setZoomScaleNormal($pValue = 100)
|
||||
{
|
||||
if (($pValue >= 1) || is_null($pValue)) {
|
||||
$this->zoomScaleNormal = $pValue;
|
||||
} else {
|
||||
throw new PHPExcel_Exception("Scale must be greater than or equal to 1.");
|
||||
throw new \PHPExcel\Exception("Scale must be greater than or equal to 1.");
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
@ -153,9 +153,9 @@ class SheetView
|
|||
* 'pageLayout' self::SHEETVIEW_PAGE_LAYOUT
|
||||
* 'pageBreakPreview' self::SHEETVIEW_PAGE_BREAK_PREVIEW
|
||||
*
|
||||
* @param string $pValue
|
||||
* @throws PHPExcel_Exception
|
||||
* @return PHPExcel_Worksheet_SheetView
|
||||
* @param string $pValue
|
||||
* @throws \PHPExcel\Exception
|
||||
* @return SheetView
|
||||
*/
|
||||
public function setView($pValue = null)
|
||||
{
|
||||
|
@ -166,7 +166,7 @@ class SheetView
|
|||
if (in_array($pValue, self::$sheetViewTypes)) {
|
||||
$this->sheetviewType = $pValue;
|
||||
} else {
|
||||
throw new PHPExcel_Exception("Invalid sheetview layout type.");
|
||||
throw new \PHPExcel\Exception("Invalid sheetview layout type.");
|
||||
}
|
||||
|
||||
return $this;
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace PHPExcel;
|
||||
|
||||
|
||||
require_once 'testDataFileIterator.php';
|
||||
|
||||
class CalculationTest extends \PHPUnit_Framework_TestCase
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace PHPExcel;
|
||||
|
||||
|
||||
require_once 'testDataFileIterator.php';
|
||||
|
||||
class CellTest extends \PHPUnit_Framework_TestCase
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
<?php
|
||||
|
||||
|
||||
namespace PHPExcel;
|
||||
|
||||
|
||||
class ReferenceHelperTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
|
|
|
@ -1,80 +1,78 @@
|
|||
<?php
|
||||
|
||||
namespace PHPExcel\Worksheet;
|
||||
|
||||
class AutoFilterTest extends PHPUnit_Framework_TestCase
|
||||
class AutoFilterTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
private $_testInitialRange = 'H2:O256';
|
||||
private $testInitialRange = 'H2:O256';
|
||||
|
||||
private $_testAutoFilterObject;
|
||||
private $testAutoFilterObject;
|
||||
|
||||
private $mockWorksheetObject;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
if (!defined('PHPEXCEL_ROOT')) {
|
||||
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
|
||||
}
|
||||
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||
|
||||
$this->_mockWorksheetObject = $this->getMockBuilder('PHPExcel_Worksheet')
|
||||
$this->mockWorksheetObject = $this->getMockBuilder('\\PHPExcel\\Worksheet')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
$this->_mockCacheController = $this->getMockBuilder('PHPExcel_CachedObjectStorage_Memory')
|
||||
$this->_mockCacheController = $this->getMockBuilder('\\PHPExcel\\CachedObjectStorage\\Memory')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
$this->_mockWorksheetObject->expects($this->any())
|
||||
$this->mockWorksheetObject->expects($this->any())
|
||||
->method('getCellCacheController')
|
||||
->will($this->returnValue($this->_mockCacheController));
|
||||
|
||||
$this->_testAutoFilterObject = new PHPExcel_Worksheet_AutoFilter(
|
||||
$this->_testInitialRange,
|
||||
$this->_mockWorksheetObject
|
||||
$this->testAutoFilterObject = new AutoFilter(
|
||||
$this->testInitialRange,
|
||||
$this->mockWorksheetObject
|
||||
);
|
||||
}
|
||||
|
||||
public function testToString()
|
||||
{
|
||||
$expectedResult = $this->_testInitialRange;
|
||||
$expectedResult = $this->testInitialRange;
|
||||
|
||||
// magic __toString should return the active autofilter range
|
||||
$result = $this->_testAutoFilterObject;
|
||||
// magic __toString should return the active autofilter range
|
||||
$result = $this->testAutoFilterObject;
|
||||
$this->assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function testGetParent()
|
||||
{
|
||||
$result = $this->_testAutoFilterObject->getParent();
|
||||
$this->assertInstanceOf('PHPExcel_Worksheet', $result);
|
||||
$result = $this->testAutoFilterObject->getParent();
|
||||
$this->assertInstanceOf('\\PHPExcel\\Worksheet', $result);
|
||||
}
|
||||
|
||||
public function testSetParent()
|
||||
{
|
||||
// Setters return the instance to implement the fluent interface
|
||||
$result = $this->_testAutoFilterObject->setParent($this->_mockWorksheetObject);
|
||||
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter', $result);
|
||||
// Setters return the instance to implement the fluent interface
|
||||
$result = $this->testAutoFilterObject->setParent($this->mockWorksheetObject);
|
||||
$this->assertInstanceOf('\\PHPExcel\\Worksheet\\AutoFilter', $result);
|
||||
}
|
||||
|
||||
public function testGetRange()
|
||||
{
|
||||
$expectedResult = $this->_testInitialRange;
|
||||
$expectedResult = $this->testInitialRange;
|
||||
|
||||
// Result should be the active autofilter range
|
||||
$result = $this->_testAutoFilterObject->getRange();
|
||||
// Result should be the active autofilter range
|
||||
$result = $this->testAutoFilterObject->getRange();
|
||||
$this->assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function testSetRange()
|
||||
{
|
||||
$ranges = array('G1:J512' => 'Worksheet1!G1:J512',
|
||||
'K1:N20' => 'K1:N20'
|
||||
);
|
||||
$ranges = [
|
||||
'G1:J512' => 'Worksheet1!G1:J512',
|
||||
'K1:N20' => 'K1:N20'
|
||||
];
|
||||
|
||||
foreach ($ranges as $actualRange => $fullRange) {
|
||||
// Setters return the instance to implement the fluent interface
|
||||
$result = $this->_testAutoFilterObject->setRange($fullRange);
|
||||
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter', $result);
|
||||
// Setters return the instance to implement the fluent interface
|
||||
$result = $this->testAutoFilterObject->setRange($fullRange);
|
||||
$this->assertInstanceOf('\\PHPExcel\\Worksheet\\AutoFilter', $result);
|
||||
|
||||
// Result should be the new autofilter range
|
||||
$result = $this->_testAutoFilterObject->getRange();
|
||||
// Result should be the new autofilter range
|
||||
$result = $this->testAutoFilterObject->getRange();
|
||||
$this->assertEquals($actualRange, $result);
|
||||
}
|
||||
}
|
||||
|
@ -83,141 +81,142 @@ class AutoFilterTest extends PHPUnit_Framework_TestCase
|
|||
{
|
||||
$expectedResult = '';
|
||||
|
||||
// Setters return the instance to implement the fluent interface
|
||||
$result = $this->_testAutoFilterObject->setRange();
|
||||
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter', $result);
|
||||
// Setters return the instance to implement the fluent interface
|
||||
$result = $this->testAutoFilterObject->setRange();
|
||||
$this->assertInstanceOf('\\PHPExcel\\Worksheet\\AutoFilter', $result);
|
||||
|
||||
// Result should be a clear range
|
||||
$result = $this->_testAutoFilterObject->getRange();
|
||||
// Result should be a clear range
|
||||
$result = $this->testAutoFilterObject->getRange();
|
||||
$this->assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException PHPExcel_Exception
|
||||
* @expectedException \PHPExcel\Exception
|
||||
*/
|
||||
public function testSetRangeInvalidRange()
|
||||
{
|
||||
$expectedResult = 'A1';
|
||||
|
||||
$result = $this->_testAutoFilterObject->setRange($expectedResult);
|
||||
$result = $this->testAutoFilterObject->setRange($expectedResult);
|
||||
}
|
||||
|
||||
public function testGetColumnsEmpty()
|
||||
{
|
||||
// There should be no columns yet defined
|
||||
$result = $this->_testAutoFilterObject->getColumns();
|
||||
// There should be no columns yet defined
|
||||
$result = $this->testAutoFilterObject->getColumns();
|
||||
$this->assertInternalType('array', $result);
|
||||
$this->assertEquals(0, count($result));
|
||||
}
|
||||
|
||||
public function testGetColumnOffset()
|
||||
{
|
||||
$columnIndexes = array( 'H' => 0,
|
||||
'K' => 3,
|
||||
'M' => 5
|
||||
);
|
||||
$columnIndexes = [
|
||||
'H' => 0,
|
||||
'K' => 3,
|
||||
'M' => 5
|
||||
];
|
||||
|
||||
// If we request a specific column by its column ID, we should get an
|
||||
// If we request a specific column by its column ID, we should get an
|
||||
// integer returned representing the column offset within the range
|
||||
foreach ($columnIndexes as $columnIndex => $columnOffset) {
|
||||
$result = $this->_testAutoFilterObject->getColumnOffset($columnIndex);
|
||||
$result = $this->testAutoFilterObject->getColumnOffset($columnIndex);
|
||||
$this->assertEquals($columnOffset, $result);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException PHPExcel_Exception
|
||||
* @expectedException \PHPExcel\Exception
|
||||
*/
|
||||
public function testGetInvalidColumnOffset()
|
||||
{
|
||||
$invalidColumn = 'G';
|
||||
|
||||
$result = $this->_testAutoFilterObject->getColumnOffset($invalidColumn);
|
||||
$result = $this->testAutoFilterObject->getColumnOffset($invalidColumn);
|
||||
}
|
||||
|
||||
public function testSetColumnWithString()
|
||||
{
|
||||
$expectedResult = 'L';
|
||||
|
||||
// Setters return the instance to implement the fluent interface
|
||||
$result = $this->_testAutoFilterObject->setColumn($expectedResult);
|
||||
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter', $result);
|
||||
// Setters return the instance to implement the fluent interface
|
||||
$result = $this->testAutoFilterObject->setColumn($expectedResult);
|
||||
$this->assertInstanceOf('\\PHPExcel\\Worksheet\\AutoFilter', $result);
|
||||
|
||||
$result = $this->_testAutoFilterObject->getColumns();
|
||||
// Result should be an array of PHPExcel_Worksheet_AutoFilter_Column
|
||||
$result = $this->testAutoFilterObject->getColumns();
|
||||
// Result should be an array of \PHPExcel\Worksheet\AutoFilter\Column
|
||||
// objects for each column we set indexed by the column ID
|
||||
$this->assertInternalType('array', $result);
|
||||
$this->assertEquals(1, count($result));
|
||||
$this->assertArrayHasKey($expectedResult, $result);
|
||||
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column', $result[$expectedResult]);
|
||||
$this->assertInstanceOf('\\PHPExcel\\Worksheet\\AutoFilter\\Column', $result[$expectedResult]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException PHPExcel_Exception
|
||||
* @expectedException \PHPExcel\Exception
|
||||
*/
|
||||
public function testSetInvalidColumnWithString()
|
||||
{
|
||||
$invalidColumn = 'A';
|
||||
|
||||
$result = $this->_testAutoFilterObject->setColumn($invalidColumn);
|
||||
$result = $this->testAutoFilterObject->setColumn($invalidColumn);
|
||||
}
|
||||
|
||||
public function testSetColumnWithColumnObject()
|
||||
{
|
||||
$expectedResult = 'M';
|
||||
$columnObject = new PHPExcel_Worksheet_AutoFilter_Column($expectedResult);
|
||||
$columnObject = new AutoFilter\Column($expectedResult);
|
||||
|
||||
// Setters return the instance to implement the fluent interface
|
||||
$result = $this->_testAutoFilterObject->setColumn($columnObject);
|
||||
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter', $result);
|
||||
// Setters return the instance to implement the fluent interface
|
||||
$result = $this->testAutoFilterObject->setColumn($columnObject);
|
||||
$this->assertInstanceOf('\\PHPExcel\\Worksheet\\AutoFilter', $result);
|
||||
|
||||
$result = $this->_testAutoFilterObject->getColumns();
|
||||
// Result should be an array of PHPExcel_Worksheet_AutoFilter_Column
|
||||
$result = $this->testAutoFilterObject->getColumns();
|
||||
// Result should be an array of \PHPExcel\Worksheet\AutoFilter\Column
|
||||
// objects for each column we set indexed by the column ID
|
||||
$this->assertInternalType('array', $result);
|
||||
$this->assertEquals(1, count($result));
|
||||
$this->assertArrayHasKey($expectedResult, $result);
|
||||
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column', $result[$expectedResult]);
|
||||
$this->assertInstanceOf('\\PHPExcel\\Worksheet\\AutoFilter\\Column', $result[$expectedResult]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException PHPExcel_Exception
|
||||
* @expectedException \PHPExcel\Exception
|
||||
*/
|
||||
public function testSetInvalidColumnWithObject()
|
||||
{
|
||||
$invalidColumn = 'E';
|
||||
$columnObject = new PHPExcel_Worksheet_AutoFilter_Column($invalidColumn);
|
||||
$columnObject = new AutoFilter\Column($invalidColumn);
|
||||
|
||||
$result = $this->_testAutoFilterObject->setColumn($invalidColumn);
|
||||
$result = $this->testAutoFilterObject->setColumn($invalidColumn);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException PHPExcel_Exception
|
||||
* @expectedException \PHPExcel\Exception
|
||||
*/
|
||||
public function testSetColumnWithInvalidDataType()
|
||||
{
|
||||
$invalidColumn = 123.456;
|
||||
$columnObject = new PHPExcel_Worksheet_AutoFilter_Column($invalidColumn);
|
||||
$columnObject = new AutoFilter\Column($invalidColumn);
|
||||
|
||||
$result = $this->_testAutoFilterObject->setColumn($invalidColumn);
|
||||
$result = $this->testAutoFilterObject->setColumn($invalidColumn);
|
||||
}
|
||||
|
||||
public function testGetColumns()
|
||||
{
|
||||
$columnIndexes = array('L','M');
|
||||
$columnIndexes = ['L','M'];
|
||||
|
||||
foreach ($columnIndexes as $columnIndex) {
|
||||
$this->_testAutoFilterObject->setColumn($columnIndex);
|
||||
$this->testAutoFilterObject->setColumn($columnIndex);
|
||||
}
|
||||
|
||||
$result = $this->_testAutoFilterObject->getColumns();
|
||||
// Result should be an array of PHPExcel_Worksheet_AutoFilter_Column
|
||||
$result = $this->testAutoFilterObject->getColumns();
|
||||
// Result should be an array of \PHPExcel\Worksheet\AutoFilter\Column
|
||||
// objects for each column we set indexed by the column ID
|
||||
$this->assertInternalType('array', $result);
|
||||
$this->assertEquals(count($columnIndexes), count($result));
|
||||
foreach ($columnIndexes as $columnIndex) {
|
||||
$this->assertArrayHasKey($columnIndex, $result);
|
||||
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column', $result[$columnIndex]);
|
||||
$this->assertInstanceOf('\\PHPExcel\\Worksheet\\AutoFilter\\Column', $result[$columnIndex]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -226,71 +225,71 @@ class AutoFilterTest extends PHPUnit_Framework_TestCase
|
|||
$columnIndexes = array('L','M');
|
||||
|
||||
foreach ($columnIndexes as $columnIndex) {
|
||||
$this->_testAutoFilterObject->setColumn($columnIndex);
|
||||
$this->testAutoFilterObject->setColumn($columnIndex);
|
||||
}
|
||||
|
||||
// If we request a specific column by its column ID, we should
|
||||
// get a PHPExcel_Worksheet_AutoFilter_Column object returned
|
||||
// If we request a specific column by its column ID, we should
|
||||
// get a \PHPExcel\Worksheet\AutoFilter\Column object returned
|
||||
foreach ($columnIndexes as $columnIndex) {
|
||||
$result = $this->_testAutoFilterObject->getColumn($columnIndex);
|
||||
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column', $result);
|
||||
$result = $this->testAutoFilterObject->getColumn($columnIndex);
|
||||
$this->assertInstanceOf('\\PHPExcel\\Worksheet\\AutoFilter\\Column', $result);
|
||||
}
|
||||
}
|
||||
|
||||
public function testGetColumnByOffset()
|
||||
{
|
||||
$columnIndexes = array( 0 => 'H',
|
||||
3 => 'K',
|
||||
5 => 'M'
|
||||
);
|
||||
$columnIndexes = [
|
||||
0 => 'H',
|
||||
3 => 'K',
|
||||
5 => 'M'
|
||||
];
|
||||
|
||||
// If we request a specific column by its offset, we should
|
||||
// get a PHPExcel_Worksheet_AutoFilter_Column object returned
|
||||
// If we request a specific column by its offset, we should
|
||||
// get a \PHPExcel\Worksheet\AutoFilter\Column object returned
|
||||
foreach ($columnIndexes as $columnIndex => $columnID) {
|
||||
$result = $this->_testAutoFilterObject->getColumnByOffset($columnIndex);
|
||||
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column', $result);
|
||||
$result = $this->testAutoFilterObject->getColumnByOffset($columnIndex);
|
||||
$this->assertInstanceOf('\\PHPExcel\\Worksheet\\AutoFilter\\Column', $result);
|
||||
$this->assertEquals($result->getColumnIndex(), $columnID);
|
||||
}
|
||||
}
|
||||
|
||||
public function testGetColumnIfNotSet()
|
||||
{
|
||||
// If we request a specific column by its column ID, we should
|
||||
// get a PHPExcel_Worksheet_AutoFilter_Column object returned
|
||||
$result = $this->_testAutoFilterObject->getColumn('K');
|
||||
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column', $result);
|
||||
// If we request a specific column by its column ID, we should
|
||||
// get a \PHPExcel\Worksheet\AutoFilter\Column object returned
|
||||
$result = $this->testAutoFilterObject->getColumn('K');
|
||||
$this->assertInstanceOf('\\PHPExcel\\Worksheet\\AutoFilter\\Column', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException PHPExcel_Exception
|
||||
* @expectedException \PHPExcel\Exception
|
||||
*/
|
||||
public function testGetColumnWithoutRangeSet()
|
||||
{
|
||||
// Clear the range
|
||||
$result = $this->_testAutoFilterObject->setRange();
|
||||
|
||||
$result = $this->_testAutoFilterObject->getColumn('A');
|
||||
// Clear the range
|
||||
$result = $this->testAutoFilterObject->setRange();
|
||||
$result = $this->testAutoFilterObject->getColumn('A');
|
||||
}
|
||||
|
||||
public function testClearRangeWithExistingColumns()
|
||||
{
|
||||
$expectedResult = '';
|
||||
|
||||
$columnIndexes = array('L','M','N');
|
||||
$columnIndexes = ['L','M','N'];
|
||||
foreach ($columnIndexes as $columnIndex) {
|
||||
$this->_testAutoFilterObject->setColumn($columnIndex);
|
||||
$this->testAutoFilterObject->setColumn($columnIndex);
|
||||
}
|
||||
|
||||
// Setters return the instance to implement the fluent interface
|
||||
$result = $this->_testAutoFilterObject->setRange();
|
||||
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter', $result);
|
||||
// Setters return the instance to implement the fluent interface
|
||||
$result = $this->testAutoFilterObject->setRange();
|
||||
$this->assertInstanceOf('\\PHPExcel\\Worksheet\\AutoFilter', $result);
|
||||
|
||||
// Range should be cleared
|
||||
$result = $this->_testAutoFilterObject->getRange();
|
||||
// Range should be cleared
|
||||
$result = $this->testAutoFilterObject->getRange();
|
||||
$this->assertEquals($expectedResult, $result);
|
||||
|
||||
// Column array should be cleared
|
||||
$result = $this->_testAutoFilterObject->getColumns();
|
||||
// Column array should be cleared
|
||||
$result = $this->testAutoFilterObject->getColumns();
|
||||
$this->assertInternalType('array', $result);
|
||||
$this->assertEquals(0, count($result));
|
||||
}
|
||||
|
@ -299,41 +298,41 @@ class AutoFilterTest extends PHPUnit_Framework_TestCase
|
|||
{
|
||||
$expectedResult = 'G1:J512';
|
||||
|
||||
// These columns should be retained
|
||||
$columnIndexes1 = array('I','J');
|
||||
// These columns should be retained
|
||||
$columnIndexes1 = ['I','J'];
|
||||
foreach ($columnIndexes1 as $columnIndex) {
|
||||
$this->_testAutoFilterObject->setColumn($columnIndex);
|
||||
$this->testAutoFilterObject->setColumn($columnIndex);
|
||||
}
|
||||
// These columns should be discarded
|
||||
$columnIndexes2 = array('K','L','M');
|
||||
// These columns should be discarded
|
||||
$columnIndexes2 = ['K','L','M'];
|
||||
foreach ($columnIndexes2 as $columnIndex) {
|
||||
$this->_testAutoFilterObject->setColumn($columnIndex);
|
||||
$this->testAutoFilterObject->setColumn($columnIndex);
|
||||
}
|
||||
|
||||
// Setters return the instance to implement the fluent interface
|
||||
$result = $this->_testAutoFilterObject->setRange($expectedResult);
|
||||
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter', $result);
|
||||
// Setters return the instance to implement the fluent interface
|
||||
$result = $this->testAutoFilterObject->setRange($expectedResult);
|
||||
$this->assertInstanceOf('\\PHPExcel\\Worksheet\\AutoFilter', $result);
|
||||
|
||||
// Range should be correctly set
|
||||
$result = $this->_testAutoFilterObject->getRange();
|
||||
// Range should be correctly set
|
||||
$result = $this->testAutoFilterObject->getRange();
|
||||
$this->assertEquals($expectedResult, $result);
|
||||
|
||||
// Only columns that existed in the original range and that
|
||||
// still fall within the new range should be retained
|
||||
$result = $this->_testAutoFilterObject->getColumns();
|
||||
// Only columns that existed in the original range and that
|
||||
// still fall within the new range should be retained
|
||||
$result = $this->testAutoFilterObject->getColumns();
|
||||
$this->assertInternalType('array', $result);
|
||||
$this->assertEquals(count($columnIndexes1), count($result));
|
||||
}
|
||||
|
||||
public function testClone()
|
||||
{
|
||||
$columnIndexes = array('L','M');
|
||||
$columnIndexes = ['L','M'];
|
||||
|
||||
foreach ($columnIndexes as $columnIndex) {
|
||||
$this->_testAutoFilterObject->setColumn($columnIndex);
|
||||
$this->testAutoFilterObject->setColumn($columnIndex);
|
||||
}
|
||||
|
||||
$result = clone $this->_testAutoFilterObject;
|
||||
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter', $result);
|
||||
$result = clone $this->testAutoFilterObject;
|
||||
$this->assertInstanceOf('\\PHPExcel\\Worksheet\\AutoFilter', $result);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,29 +1,26 @@
|
|||
<?php
|
||||
|
||||
class CellCollectionTest extends PHPUnit_Framework_TestCase
|
||||
namespace PHPExcel\Worksheet;
|
||||
|
||||
class CellCollectionTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
if (!defined('PHPEXCEL_ROOT')) {
|
||||
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
|
||||
}
|
||||
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||
}
|
||||
|
||||
|
||||
public function testCacheLastCell()
|
||||
{
|
||||
$methods = PHPExcel_CachedObjectStorageFactory::getCacheStorageMethods();
|
||||
$methods = \PHPExcel\CachedObjectStorageFactory::getCacheStorageMethods();
|
||||
foreach ($methods as $method) {
|
||||
PHPExcel_CachedObjectStorageFactory::initialize($method);
|
||||
$workbook = new PHPExcel();
|
||||
$cells = array('A1', 'A2');
|
||||
\PHPExcel\CachedObjectStorageFactory::initialize($method);
|
||||
$workbook = new \PHPExcel();
|
||||
$cells = ['A1', 'A2'];
|
||||
$worksheet = $workbook->getActiveSheet();
|
||||
$worksheet->setCellValue('A1', 1);
|
||||
$worksheet->setCellValue('A2', 2);
|
||||
$this->assertEquals($cells, $worksheet->getCellCollection(), "Cache method \"$method\".");
|
||||
PHPExcel_CachedObjectStorageFactory::finalize();
|
||||
\PHPExcel\CachedObjectStorageFactory::finalize();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,22 +1,19 @@
|
|||
<?php
|
||||
|
||||
class ColumnCellIteratorTest extends PHPUnit_Framework_TestCase
|
||||
namespace PHPExcel\Worksheet;
|
||||
|
||||
class ColumnCellIteratorTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public $mockWorksheet;
|
||||
public $mockColumnCell;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
if (!defined('PHPEXCEL_ROOT')) {
|
||||
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
|
||||
}
|
||||
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||
|
||||
$this->mockCell = $this->getMockBuilder('PHPExcel_Cell')
|
||||
$this->mockCell = $this->getMockBuilder('\\PHPExcel\\Cell')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$this->mockWorksheet = $this->getMockBuilder('PHPExcel_Worksheet')
|
||||
$this->mockWorksheet = $this->getMockBuilder('\\PHPExcel\\Worksheet')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
|
@ -31,31 +28,31 @@ class ColumnCellIteratorTest extends PHPUnit_Framework_TestCase
|
|||
|
||||
public function testIteratorFullRange()
|
||||
{
|
||||
$iterator = new PHPExcel_Worksheet_ColumnCellIterator($this->mockWorksheet, 'A');
|
||||
$iterator = new ColumnCellIterator($this->mockWorksheet, 'A');
|
||||
$ColumnCellIndexResult = 1;
|
||||
$this->assertEquals($ColumnCellIndexResult, $iterator->key());
|
||||
|
||||
foreach ($iterator as $key => $ColumnCell) {
|
||||
$this->assertEquals($ColumnCellIndexResult++, $key);
|
||||
$this->assertInstanceOf('PHPExcel_Cell', $ColumnCell);
|
||||
$this->assertInstanceOf('\\PHPExcel\\Cell', $ColumnCell);
|
||||
}
|
||||
}
|
||||
|
||||
public function testIteratorStartEndRange()
|
||||
{
|
||||
$iterator = new PHPExcel_Worksheet_ColumnCellIterator($this->mockWorksheet, 'A', 2, 4);
|
||||
$iterator = new ColumnCellIterator($this->mockWorksheet, 'A', 2, 4);
|
||||
$ColumnCellIndexResult = 2;
|
||||
$this->assertEquals($ColumnCellIndexResult, $iterator->key());
|
||||
|
||||
foreach ($iterator as $key => $ColumnCell) {
|
||||
$this->assertEquals($ColumnCellIndexResult++, $key);
|
||||
$this->assertInstanceOf('PHPExcel_Cell', $ColumnCell);
|
||||
$this->assertInstanceOf('\\PHPExcel\\Cell', $ColumnCell);
|
||||
}
|
||||
}
|
||||
|
||||
public function testIteratorSeekAndPrev()
|
||||
{
|
||||
$iterator = new PHPExcel_Worksheet_ColumnCellIterator($this->mockWorksheet, 'A', 2, 4);
|
||||
$iterator = new ColumnCellIterator($this->mockWorksheet, 'A', 2, 4);
|
||||
$columnIndexResult = 4;
|
||||
$iterator->seek(4);
|
||||
$this->assertEquals($columnIndexResult, $iterator->key());
|
||||
|
@ -67,20 +64,20 @@ class ColumnCellIteratorTest extends PHPUnit_Framework_TestCase
|
|||
}
|
||||
|
||||
/**
|
||||
* @expectedException PHPExcel_Exception
|
||||
* @expectedException \PHPExcel\Exception
|
||||
*/
|
||||
public function testSeekOutOfRange()
|
||||
{
|
||||
$iterator = new PHPExcel_Worksheet_ColumnCellIterator($this->mockWorksheet, 'A', 2, 4);
|
||||
$iterator = new ColumnCellIterator($this->mockWorksheet, 'A', 2, 4);
|
||||
$iterator->seek(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException PHPExcel_Exception
|
||||
* @expectedException \PHPExcel\Exception
|
||||
*/
|
||||
public function testPrevOutOfRange()
|
||||
{
|
||||
$iterator = new PHPExcel_Worksheet_ColumnCellIterator($this->mockWorksheet, 'A', 2, 4);
|
||||
$iterator = new ColumnCellIterator($this->mockWorksheet, 'A', 2, 4);
|
||||
$iterator->prev();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,22 +1,19 @@
|
|||
<?php
|
||||
|
||||
class ColumnIteratorTest extends PHPUnit_Framework_TestCase
|
||||
namespace PHPExcel\Worksheet;
|
||||
|
||||
class ColumnIteratorTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public $mockWorksheet;
|
||||
public $mockColumn;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
if (!defined('PHPEXCEL_ROOT')) {
|
||||
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
|
||||
}
|
||||
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||
|
||||
$this->mockColumn = $this->getMockBuilder('PHPExcel_Worksheet_Column')
|
||||
$this->mockColumn = $this->getMockBuilder('\\PHPExcel\\Worksheet\\Column')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$this->mockWorksheet = $this->getMockBuilder('PHPExcel_Worksheet')
|
||||
$this->mockWorksheet = $this->getMockBuilder('\\PHPExcel\\Worksheet')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
|
@ -31,32 +28,32 @@ class ColumnIteratorTest extends PHPUnit_Framework_TestCase
|
|||
|
||||
public function testIteratorFullRange()
|
||||
{
|
||||
$iterator = new PHPExcel_Worksheet_ColumnIterator($this->mockWorksheet);
|
||||
$iterator = new ColumnIterator($this->mockWorksheet);
|
||||
$columnIndexResult = 'A';
|
||||
$this->assertEquals($columnIndexResult, $iterator->key());
|
||||
|
||||
foreach ($iterator as $key => $column) {
|
||||
$this->assertEquals($columnIndexResult++, $key);
|
||||
$this->assertInstanceOf('PHPExcel_Worksheet_Column', $column);
|
||||
$this->assertInstanceOf('\\PHPExcel\\Worksheet\\Column', $column);
|
||||
}
|
||||
}
|
||||
|
||||
public function testIteratorStartEndRange()
|
||||
{
|
||||
$iterator = new PHPExcel_Worksheet_ColumnIterator($this->mockWorksheet, 'B', 'D');
|
||||
$iterator = new ColumnIterator($this->mockWorksheet, 'B', 'D');
|
||||
$columnIndexResult = 'B';
|
||||
$this->assertEquals($columnIndexResult, $iterator->key());
|
||||
|
||||
foreach ($iterator as $key => $column) {
|
||||
$this->assertEquals($columnIndexResult++, $key);
|
||||
$this->assertInstanceOf('PHPExcel_Worksheet_Column', $column);
|
||||
$this->assertInstanceOf('\\PHPExcel\\Worksheet\\Column', $column);
|
||||
}
|
||||
}
|
||||
|
||||
public function testIteratorSeekAndPrev()
|
||||
{
|
||||
$ranges = range('A', 'E');
|
||||
$iterator = new PHPExcel_Worksheet_ColumnIterator($this->mockWorksheet, 'B', 'D');
|
||||
$iterator = new ColumnIterator($this->mockWorksheet, 'B', 'D');
|
||||
$columnIndexResult = 'D';
|
||||
$iterator->seek('D');
|
||||
$this->assertEquals($columnIndexResult, $iterator->key());
|
||||
|
@ -69,20 +66,20 @@ class ColumnIteratorTest extends PHPUnit_Framework_TestCase
|
|||
}
|
||||
|
||||
/**
|
||||
* @expectedException PHPExcel_Exception
|
||||
* @expectedException \PHPExcel\Exception
|
||||
*/
|
||||
public function testSeekOutOfRange()
|
||||
{
|
||||
$iterator = new PHPExcel_Worksheet_ColumnIterator($this->mockWorksheet, 'B', 'D');
|
||||
$iterator = new ColumnIterator($this->mockWorksheet, 'B', 'D');
|
||||
$iterator->seek('A');
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException PHPExcel_Exception
|
||||
* @expectedException \PHPExcel\Exception
|
||||
*/
|
||||
public function testPrevOutOfRange()
|
||||
{
|
||||
$iterator = new PHPExcel_Worksheet_ColumnIterator($this->mockWorksheet, 'B', 'D');
|
||||
$iterator = new ColumnIterator($this->mockWorksheet, 'B', 'D');
|
||||
$iterator->prev();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue