Skip to content

Commit

Permalink
PHPOfficeGH-78 replace Exception with PHPExcel_Exception in all Works…
Browse files Browse the repository at this point in the history
…heet classes
  • Loading branch information
Dominik Bonsch committed Nov 19, 2012
1 parent 10c3ba8 commit 2b27211
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 46 deletions.
10 changes: 5 additions & 5 deletions Classes/PHPExcel/Worksheet/AutoFilter/Column.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public function getColumnIndex() {
* Set AutoFilter Column Index
*
* @param string $pColumn Column (e.g. A)
* @throws Exception
* @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_AutoFilter_Column
*/
public function setColumnIndex($pColumn) {
Expand Down Expand Up @@ -183,7 +183,7 @@ public function getFilterType() {
* Set AutoFilter Type
*
* @param string $pFilterType
* @throws Exception
* @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_AutoFilter_Column
*/
public function setFilterType($pFilterType = self::AUTOFILTER_FILTERTYPE_FILTER) {
Expand All @@ -209,7 +209,7 @@ public function getJoin() {
* Set AutoFilter Multiple Rules And/Or
*
* @param string $pJoin And/Or
* @throws Exception
* @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_AutoFilter_Column
*/
public function setJoin($pJoin = self::AUTOFILTER_COLUMN_JOIN_OR) {
Expand All @@ -228,7 +228,7 @@ public function setJoin($pJoin = self::AUTOFILTER_COLUMN_JOIN_OR) {
* Set AutoFilter Attributes
*
* @param string[] $pAttributes
* @throws Exception
* @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_AutoFilter_Column
*/
public function setAttributes($pAttributes = array()) {
Expand All @@ -242,7 +242,7 @@ public function setAttributes($pAttributes = array()) {
*
* @param string $pName Attribute Name
* @param string $pValue Attribute Value
* @throws Exception
* @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_AutoFilter_Column
*/
public function setAttribute($pName, $pValue) {
Expand Down
10 changes: 5 additions & 5 deletions Classes/PHPExcel/Worksheet/AutoFilter/Column/Rule.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ public function getRuleType() {
* Set AutoFilter Rule Type
*
* @param string $pRuleType
* @throws Exception
* @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_AutoFilter_Column
*/
public function setRuleType($pRuleType = self::AUTOFILTER_RULETYPE_FILTER) {
Expand All @@ -314,7 +314,7 @@ public function getValue() {
* Set AutoFilter Rule Value
*
* @param string|string[] $pValue
* @throws Exception
* @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_AutoFilter_Column_Rule
*/
public function setValue($pValue = '') {
Expand Down Expand Up @@ -354,7 +354,7 @@ public function getOperator() {
* Set AutoFilter Rule Operator
*
* @param string $pOperator
* @throws Exception
* @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_AutoFilter_Column_Rule
*/
public function setOperator($pOperator = self::AUTOFILTER_COLUMN_RULE_EQUAL) {
Expand Down Expand Up @@ -382,7 +382,7 @@ public function getGrouping() {
* Set AutoFilter Rule Grouping
*
* @param string $pGrouping
* @throws Exception
* @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_AutoFilter_Column_Rule
*/
public function setGrouping($pGrouping = NULL) {
Expand All @@ -404,7 +404,7 @@ public function setGrouping($pGrouping = NULL) {
* @param string $pOperator
* @param string|string[] $pValue
* @param string $pGrouping
* @throws Exception
* @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_AutoFilter_Column_Rule
*/
public function setRule($pOperator = self::AUTOFILTER_COLUMN_RULE_EQUAL, $pValue = '', $pGrouping = NULL) {
Expand Down
6 changes: 3 additions & 3 deletions Classes/PHPExcel/Worksheet/BaseDrawing.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public function getWorksheet() {
*
* @param PHPExcel_Worksheet $pValue
* @param bool $pOverrideOld If a Worksheet has already been assigned, overwrite it and remove image from old Worksheet?
* @throws Exception
* @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_BaseDrawing
*/
public function setWorksheet(PHPExcel_Worksheet $pValue = null, $pOverrideOld = false) {
Expand All @@ -237,7 +237,7 @@ public function setWorksheet(PHPExcel_Worksheet $pValue = null, $pOverrideOld =
// Set new PHPExcel_Worksheet
$this->setWorksheet($pValue);
} else {
throw new 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;
Expand Down Expand Up @@ -440,7 +440,7 @@ public function getShadow() {
* Set Shadow
*
* @param PHPExcel_Worksheet_Drawing_Shadow $pValue
* @throws Exception
* @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_BaseDrawing
*/
public function setShadow(PHPExcel_Worksheet_Drawing_Shadow $pValue = null) {
Expand Down
4 changes: 2 additions & 2 deletions Classes/PHPExcel/Worksheet/ColumnDimension.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,12 @@ public function getOutlineLevel() {
* Value must be between 0 and 7
*
* @param int $pValue
* @throws Exception
* @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_ColumnDimension
*/
public function setOutlineLevel($pValue) {
if ($pValue < 0 || $pValue > 7) {
throw new Exception("Outline level must range between 0 and 7.");
throw new PHPExcel_Exception("Outline level must range between 0 and 7.");
}

$this->_outlineLevel = $pValue;
Expand Down
4 changes: 2 additions & 2 deletions Classes/PHPExcel/Worksheet/Drawing.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public function getPath() {
*
* @param string $pValue File path
* @param boolean $pVerifyFile Verify file
* @throws Exception
* @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_Drawing
*/
public function setPath($pValue = '', $pVerifyFile = true) {
Expand All @@ -111,7 +111,7 @@ public function setPath($pValue = '', $pVerifyFile = true) {
list($this->_width, $this->_height) = getimagesize($pValue);
}
} else {
throw new Exception("File $pValue not found!");
throw new PHPExcel_Exception("File $pValue not found!");
}
} else {
$this->_path = $pValue;
Expand Down
1 change: 0 additions & 1 deletion Classes/PHPExcel/Worksheet/Drawing/Shadow.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ public function getColor() {
* Set Color
*
* @param PHPExcel_Style_Color $pValue
* @throws Exception
* @return PHPExcel_Worksheet_Drawing_Shadow
*/
public function setColor(PHPExcel_Style_Color $pValue = null) {
Expand Down
8 changes: 4 additions & 4 deletions Classes/PHPExcel/Worksheet/HeaderFooter.php
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ public function setAlignWithMargins($pValue = true) {
*
* @param PHPExcel_Worksheet_HeaderFooterDrawing $image
* @param string $location
* @throws Exception
* @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_HeaderFooter
*/
public function addImage(PHPExcel_Worksheet_HeaderFooterDrawing $image = null, $location = self::IMAGE_HEADER_LEFT) {
Expand All @@ -404,7 +404,7 @@ public function addImage(PHPExcel_Worksheet_HeaderFooterDrawing $image = null, $
* Remove header/footer image
*
* @param string $location
* @throws Exception
* @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_HeaderFooter
*/
public function removeImage($location = self::IMAGE_HEADER_LEFT) {
Expand All @@ -418,12 +418,12 @@ public function removeImage($location = self::IMAGE_HEADER_LEFT) {
* Set header/footer images
*
* @param PHPExcel_Worksheet_HeaderFooterDrawing[] $images
* @throws Exception
* @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_HeaderFooter
*/
public function setImages($images) {
if (!is_array($images)) {
throw new Exception('Invalid parameter!');
throw new PHPExcel_Exception('Invalid parameter!');
}

$this->_headerFooterImages = $images;
Expand Down
4 changes: 2 additions & 2 deletions Classes/PHPExcel/Worksheet/HeaderFooterDrawing.php
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ public function getPath() {
*
* @param string $pValue File path
* @param boolean $pVerifyFile Verify file
* @throws Exception
* @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_HeaderFooterDrawing
*/
public function setPath($pValue = '', $pVerifyFile = true) {
Expand All @@ -309,7 +309,7 @@ public function setPath($pValue = '', $pVerifyFile = true) {
list($this->_width, $this->_height) = getimagesize($pValue);
}
} else {
throw new Exception("File $pValue not found!");
throw new PHPExcel_Exception("File $pValue not found!");
}
} else {
$this->_path = $pValue;
Expand Down
28 changes: 14 additions & 14 deletions Classes/PHPExcel/Worksheet/PageSetup.php
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ public function getScale() {
* @param int? $pValue
* @param boolean $pUpdate Update fitToPage so scaling applies rather than fitToHeight / fitToWidth
* @return PHPExcel_Worksheet_PageSetup
* @throws Exception
* @throws PHPExcel_Exception
*/
public function setScale($pValue = 100, $pUpdate = true) {
// Microsoft Office Excel 2007 only allows setting a scale between 10 and 400 via the user interface,
Expand All @@ -350,7 +350,7 @@ public function setScale($pValue = 100, $pUpdate = true) {
$this->_fitToPage = false;
}
} else {
throw new Exception("Scale must not be negative");
throw new PHPExcel_Exception("Scale must not be negative");
}
return $this;
}
Expand Down Expand Up @@ -568,7 +568,7 @@ public function setVerticalCentered($value = false) {
* 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 Exception
* @throws PHPExcel_Exception
* @return string
*/
public function getPrintArea($index = 0) {
Expand All @@ -579,7 +579,7 @@ public function getPrintArea($index = 0) {
if (isset($printAreas[$index-1])) {
return $printAreas[$index-1];
}
throw new Exception("Requested Print Area does not exist");
throw new PHPExcel_Exception("Requested Print Area does not exist");
}

/**
Expand Down Expand Up @@ -640,15 +640,15 @@ public function clearPrintArea($index = 0) {
* Default behaviour, or the "O" method, overwrites existing print area
* The "I" method, inserts the new print area before any specified index, or at the end of the list
* @return PHPExcel_Worksheet_PageSetup
* @throws Exception
* @throws PHPExcel_Exception
*/
public function setPrintArea($value, $index = 0, $method = self::SETPRINTRANGE_OVERWRITE) {
if (strpos($value,'!') !== false) {
throw new 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 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 Exception('Cell coordinate must not be absolute.');
throw new PHPExcel_Exception('Cell coordinate must not be absolute.');
}
$value = strtoupper($value);

Expand All @@ -661,7 +661,7 @@ public function setPrintArea($value, $index = 0, $method = self::SETPRINTRANGE_O
$index = count($printAreas) - abs($index) + 1;
}
if (($index <= 0) || ($index > count($printAreas))) {
throw new 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);
Expand All @@ -675,13 +675,13 @@ public function setPrintArea($value, $index = 0, $method = self::SETPRINTRANGE_O
$index = abs($index) - 1;
}
if ($index > count($printAreas)) {
throw new 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 Exception('Invalid method for setting print range.');
throw new PHPExcel_Exception('Invalid method for setting print range.');
}

return $this;
Expand All @@ -698,7 +698,7 @@ public function setPrintArea($value, $index = 0, $method = self::SETPRINTRANGE_O
* list.
* Print areas are numbered from 1
* @return PHPExcel_Worksheet_PageSetup
* @throws Exception
* @throws PHPExcel_Exception
*/
public function addPrintArea($value, $index = -1) {
return $this->setPrintArea($value, $index, self::SETPRINTRANGE_INSERT);
Expand All @@ -725,7 +725,7 @@ public function addPrintArea($value, $index = -1) {
* Default behaviour, or the "O" method, overwrites existing print area
* The "I" method, inserts the new print area before any specified index, or at the end of the list
* @return PHPExcel_Worksheet_PageSetup
* @throws Exception
* @throws PHPExcel_Exception
*/
public function setPrintAreaByColumnAndRow($column1, $row1, $column2, $row2, $index = 0, $method = self::SETPRINTRANGE_OVERWRITE)
{
Expand All @@ -746,7 +746,7 @@ public function setPrintAreaByColumnAndRow($column1, $row1, $column2, $row2, $in
* list.
* Print areas are numbered from 1
* @return PHPExcel_Worksheet_PageSetup
* @throws Exception
* @throws PHPExcel_Exception
*/
public function addPrintAreaByColumnAndRow($column1, $row1, $column2, $row2, $index = -1)
{
Expand Down
4 changes: 2 additions & 2 deletions Classes/PHPExcel/Worksheet/RowDimension.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,12 @@ public function getOutlineLevel() {
* Value must be between 0 and 7
*
* @param int $pValue
* @throws Exception
* @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_RowDimension
*/
public function setOutlineLevel($pValue) {
if ($pValue < 0 || $pValue > 7) {
throw new Exception("Outline level must range between 0 and 7.");
throw new PHPExcel_Exception("Outline level must range between 0 and 7.");
}

$this->_outlineLevel = $pValue;
Expand Down
12 changes: 6 additions & 6 deletions Classes/PHPExcel/Worksheet/SheetView.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function getZoomScale() {
* Valid values range from 10 to 400.
*
* @param int $pValue
* @throws Exception
* @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_SheetView
*/
public function setZoomScale($pValue = 100) {
Expand All @@ -105,7 +105,7 @@ public function setZoomScale($pValue = 100) {
if (($pValue >= 1) || is_null($pValue)) {
$this->_zoomScale = $pValue;
} else {
throw new 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;
}
Expand All @@ -125,14 +125,14 @@ public function getZoomScaleNormal() {
* Valid values range from 10 to 400.
*
* @param int $pValue
* @throws Exception
* @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_SheetView
*/
public function setZoomScaleNormal($pValue = 100) {
if (($pValue >= 1) || is_null($pValue)) {
$this->_zoomScaleNormal = $pValue;
} else {
throw new 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;
}
Expand All @@ -155,7 +155,7 @@ public function getView() {
* 'pageBreakPreview' self::SHEETVIEW_PAGE_BREAK_PREVIEW
*
* @param string $pValue
* @throws Exception
* @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_SheetView
*/
public function setView($pValue = NULL) {
Expand All @@ -166,7 +166,7 @@ public function setView($pValue = NULL) {
if (in_array($pValue, self::$_sheetViewTypes)) {
$this->_sheetviewType = $pValue;
} else {
throw new Exception("Invalid sheetview layout type.");
throw new PHPExcel_Exception("Invalid sheetview layout type.");
}

return $this;
Expand Down

0 comments on commit 2b27211

Please sign in to comment.