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:
Mark Baker
2011-02-25 22:57:22 +00:00
parent 901d20e6f9
commit 45fb4d84c1
3 changed files with 22 additions and 0 deletions
+8
View File
@@ -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);