mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-08-31 04:28:51 +00:00
Bugfix: Work Item GH-275 - Insert New Row/Column Before is not correctly updating formula references
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user