Fixes to style duplication
This commit is contained in:
parent
b726b23411
commit
44f953b69d
|
@ -422,7 +422,7 @@ class PHPExcel_Style extends PHPExcel_Style_Supervisor implements PHPExcel_IComp
|
|||
$newStyle = clone $style;
|
||||
$newStyle->applyFromArray($pStyles);
|
||||
|
||||
if ($workbook->cellXfExists($newStyle)) {
|
||||
if ($existingStyle = $workbook->getCellXfByHashCode($newStyle->getHashCode())) {
|
||||
// there is already such cell Xf in our collection
|
||||
$newXfIndexes[$oldXfIndex] = $existingStyle->getIndex();
|
||||
} else {
|
||||
|
|
|
@ -1476,9 +1476,9 @@ class PHPExcel_Worksheet implements PHPExcel_IComparable
|
|||
|
||||
// Add the style to the workbook if necessary
|
||||
$workbook = $this->_parent;
|
||||
if ($this->_parent->cellXfExists($pCellStyle)) {
|
||||
// there is already this cell Xf in our collection
|
||||
$xfIndex = $pCellStyle->getIndex();
|
||||
if ($existingStyle = $this->_parent->getCellXfByHashCode($pCellStyle->getHashCode())) {
|
||||
// there is already such cell Xf in our collection
|
||||
$xfIndex = $existingStyle->getIndex();
|
||||
} else {
|
||||
// we don't have such a cell Xf, need to add
|
||||
$workbook->addCellXf($pCellStyle);
|
||||
|
|
Loading…
Reference in New Issue