Bugfix: Work Item GH-275 - Insert New Row/Column Before is not correctly updating formula references
This commit is contained in:
parent
e79181cb4d
commit
fcb794e2e2
@ -762,9 +762,13 @@ class PHPExcel_ReferenceHelper
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($adjustCount > 0) {
|
if ($adjustCount > 0) {
|
||||||
krsort($cellTokens);
|
if ($pNumCols > 0 || $pNumRows > 0) {
|
||||||
krsort($newCellTokens);
|
krsort($cellTokens);
|
||||||
// Update cell references in the formula
|
krsort($newCellTokens);
|
||||||
|
} else {
|
||||||
|
ksort($cellTokens);
|
||||||
|
ksort($newCellTokens);
|
||||||
|
} // Update cell references in the formula
|
||||||
$formulaBlock = str_replace('\\','',preg_replace($cellTokens,$newCellTokens,$formulaBlock));
|
$formulaBlock = str_replace('\\','',preg_replace($cellTokens,$newCellTokens,$formulaBlock));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user