mirror of
https://github.com/retailcrm/PHPExcel.git
synced 2025-02-16 22:43:21 +03:00
Merge fix to style duplication from the 1.x develop branch
This commit is contained in:
parent
186302db5d
commit
4bd9df5c81
@ -424,7 +424,7 @@ class Style extends Style_Supervisor implements IComparable
|
|||||||
$newStyle = clone $style;
|
$newStyle = clone $style;
|
||||||
$newStyle->applyFromArray($pStyles);
|
$newStyle->applyFromArray($pStyles);
|
||||||
|
|
||||||
if ($workbook->cellXfExists($newStyle)) {
|
if ($existingStyle = $workbook->getCellXfByHashCode($newStyle->getHashCode())) {
|
||||||
// there is already such cell Xf in our collection
|
// there is already such cell Xf in our collection
|
||||||
$newXfIndexes[$oldXfIndex] = $existingStyle->getIndex();
|
$newXfIndexes[$oldXfIndex] = $existingStyle->getIndex();
|
||||||
} else {
|
} else {
|
||||||
@ -597,9 +597,9 @@ class Style extends Style_Supervisor implements IComparable
|
|||||||
*/
|
*/
|
||||||
public function getQuotePrefix()
|
public function getQuotePrefix()
|
||||||
{
|
{
|
||||||
if ($this->_isSupervisor) {
|
if ($this->_isSupervisor) {
|
||||||
return $this->getSharedComponent()->getQuotePrefix();
|
return $this->getSharedComponent()->getQuotePrefix();
|
||||||
}
|
}
|
||||||
return $this->_quotePrefix;
|
return $this->_quotePrefix;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -610,16 +610,16 @@ class Style extends Style_Supervisor implements IComparable
|
|||||||
*/
|
*/
|
||||||
public function setQuotePrefix($pValue)
|
public function setQuotePrefix($pValue)
|
||||||
{
|
{
|
||||||
if ($pValue == '') {
|
if ($pValue == '') {
|
||||||
$pValue = false;
|
$pValue = false;
|
||||||
}
|
}
|
||||||
if ($this->_isSupervisor) {
|
if ($this->_isSupervisor) {
|
||||||
$styleArray = array('quotePrefix' => $pValue);
|
$styleArray = array('quotePrefix' => $pValue);
|
||||||
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
|
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
|
||||||
} else {
|
} else {
|
||||||
$this->_quotePrefix = (boolean) $pValue;
|
$this->_quotePrefix = (boolean) $pValue;
|
||||||
}
|
}
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1478,9 +1478,9 @@ class Worksheet implements IComparable
|
|||||||
|
|
||||||
// Add the style to the workbook if necessary
|
// Add the style to the workbook if necessary
|
||||||
$workbook = $this->_parent;
|
$workbook = $this->_parent;
|
||||||
if ($this->_parent->cellXfExists($pCellStyle)) {
|
if ($existingStyle = $this->_parent->getCellXfByHashCode($pCellStyle->getHashCode())) {
|
||||||
// there is already this cell Xf in our collection
|
// there is already such cell Xf in our collection
|
||||||
$xfIndex = $pCellStyle->getIndex();
|
$xfIndex = $existingStyle->getIndex();
|
||||||
} else {
|
} else {
|
||||||
// we don't have such a cell Xf, need to add
|
// we don't have such a cell Xf, need to add
|
||||||
$workbook->addCellXf($pCellStyle);
|
$workbook->addCellXf($pCellStyle);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user