Merge pull request #269 from bolovincev/patch-1

Update Worksheet.php getStyleByColumnAndRow()
This commit is contained in:
Mark Baker 2014-07-27 13:07:19 +01:00
commit 983843d50c
1 changed files with 11 additions and 2 deletions

View File

@ -1488,11 +1488,20 @@ class PHPExcel_Worksheet implements PHPExcel_IComparable
*
* @param int $pColumn Numeric column coordinate of the cell
* @param int $pRow Numeric row coordinate of the cell
* @param int pColumn2 Numeric column coordinate of the range cell
* @param int pRow2 Numeric row coordinate of the range cell
* @return PHPExcel_Style
*/
public function getStyleByColumnAndRow($pColumn = 0, $pRow = 1)
public function getStyleByColumnAndRow($pColumn = 0, $pRow = 1, $pColumn2=null, $pRow2=null)
{
return $this->getStyle(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow);
if(!is_null($pColumn2) && !is_null($pRow2))
{
$cellRange = PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow . ':' . PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2;
return $this->getStyle($cellRange);
}
return $this->getStyle(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow);
}
/**