Bugfix: Work Item GH-275 - Insert New Row/Column Before is not correctly updating formula references

This commit is contained in:
Mark Baker 2013-12-09 23:45:45 +00:00
parent e79181cb4d
commit fcb794e2e2
1 changed files with 7 additions and 3 deletions

View File

@ -762,9 +762,13 @@ class PHPExcel_ReferenceHelper
}
}
if ($adjustCount > 0) {
krsort($cellTokens);
krsort($newCellTokens);
// Update cell references in the formula
if ($pNumCols > 0 || $pNumRows > 0) {
krsort($cellTokens);
krsort($newCellTokens);
} else {
ksort($cellTokens);
ksort($newCellTokens);
} // Update cell references in the formula
$formulaBlock = str_replace('\\','',preg_replace($cellTokens,$newCellTokens,$formulaBlock));
}
}