Bugfix: Work Item CP20604 - Adding Sheet to Workbook Bug
This commit is contained in:
parent
992aee683a
commit
496b76e70a
|
@ -527,6 +527,11 @@ class PHPExcel
|
|||
++$this->_activeSheetIndex;
|
||||
}
|
||||
}
|
||||
|
||||
if ($pSheet->getParent() === null) {
|
||||
$pSheet->rebindParent($this);
|
||||
}
|
||||
|
||||
return $pSheet;
|
||||
}
|
||||
|
||||
|
|
|
@ -794,14 +794,16 @@ class PHPExcel_Worksheet implements PHPExcel_IComparable
|
|||
* @return PHPExcel_Worksheet
|
||||
*/
|
||||
public function rebindParent(PHPExcel $parent) {
|
||||
$namedRanges = $this->_parent->getNamedRanges();
|
||||
foreach ($namedRanges as $namedRange) {
|
||||
$parent->addNamedRange($namedRange);
|
||||
}
|
||||
if ($this->_parent !== null) {
|
||||
$namedRanges = $this->_parent->getNamedRanges();
|
||||
foreach ($namedRanges as $namedRange) {
|
||||
$parent->addNamedRange($namedRange);
|
||||
}
|
||||
|
||||
$this->_parent->removeSheetByIndex(
|
||||
$this->_parent->getIndex($this)
|
||||
);
|
||||
$this->_parent->removeSheetByIndex(
|
||||
$this->_parent->getIndex($this)
|
||||
);
|
||||
}
|
||||
$this->_parent = $parent;
|
||||
|
||||
return $this;
|
||||
|
|
|
@ -46,6 +46,7 @@ Fixed in develop branch for release v1.8.0:
|
|||
- Bugfix: (Roy Shahbazian) Work Item GH-299 - Fixed typo in Chart/Layout set/getYMode()
|
||||
- Bugfix: (EliuFlorez) Work item GH-279 - Fatal error: Call to a member function cellExists() line: 3327 in calculation.php if referenced worksheet doesn't exist
|
||||
- Bugfix: (MBaker) Work Item GH-290 - AdvancedValueBinder "Division by zero"-error
|
||||
- Bugfix: (MBaker) Work Item CP20604 - Adding Sheet to Workbook Bug
|
||||
- Feature: (amerov) - Implementation of the Excel HLOOKUP() function
|
||||
- Feature: (MBaker) - Added "Quote Prefix" to style settings (Excel2007 Reader and Writer only)
|
||||
- Feature: (MBaker) - Added Horizontal FILL alignment for Excel5 and Excel2007 Readers/Writers, and Horizontal DISTRIBUTED alignment for Excel2007 Reader/Writer
|
||||
|
|
Loading…
Reference in New Issue