mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-09-24 17:19:29 +00:00
Bugfix: Work item 15421 - PHPExcel_ReferenceHelper::insertNewBefore() is missing an 'Update worksheet: comments' section
Solution, courtesy of MKunert git-svn-id: https://phpexcel.svn.codeplex.com/svn/trunk@69421 2327b42d-5241-43d6-9e2a-de5ac946f064
This commit is contained in:
@@ -259,6 +259,14 @@ class PHPExcel_ReferenceHelper
|
||||
}
|
||||
}
|
||||
|
||||
// Update worksheet: comments
|
||||
$aComments = $pSheet->getComments();
|
||||
$aNewComments = array(); // the new array of all comments
|
||||
foreach ($aComments as $key => &$value) {
|
||||
$newReference = $this->updateCellReference($key, $pBefore, $pNumCols, $pNumRows);
|
||||
$aNewComments[$newReference] = $value;
|
||||
}
|
||||
$pSheet->setComments($aNewComments); // replace the comments array
|
||||
|
||||
// Update worksheet: hyperlinks
|
||||
$aHyperlinkCollection = array_reverse($pSheet->getHyperlinkCollection(), true);
|
||||
|
||||
Reference in New Issue
Block a user