Skip to content
This repository has been archived by the owner on Jan 2, 2019. It is now read-only.

Commit

Permalink
Bugfix: Work Item GH-275 - Insert New Row/Column Before is not correc…
Browse files Browse the repository at this point in the history
…tly updating formula references
  • Loading branch information
Mark Baker committed Dec 9, 2013
1 parent e79181c commit fcb794e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Classes/PHPExcel/ReferenceHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -762,9 +762,13 @@ public function updateFormulaReferences($pFormula = '', $pBefore = 'A1', $pNumCo
}
}
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));
}
}
Expand Down

0 comments on commit fcb794e

Please sign in to comment.