The _xlfn.SINGLE and _xlfn.ANCHORARRAY wrappers go into the formula text once the operand they enclose stands in the buffer, and each splice moves the text behind it along. Several of the recorded starts did not move with it, so =SUM( @A1#) saved as SUM(__xlfn.SINGLE(xlfn.ANCHORARRAY( A1))), and A1~-B2# and @-A1%# came out wrong in the same way. Whitespace ahead of a scope or of an expression is no longer part of it, so the starts the wrappers and the union list use begin behind the blank. The spilled-range splice pulls an @ that begins inside its wrapper back to the wrapper's own start, so the @ takes the whole wrapper as its operand. The union list's parenthesis and the @ splice both move the start of the expression they go in front of, so a postfix operator behind them still finds where its operand begins. A scope's parentheses count as taken when a wrapper begins ahead of the scope's text, as they already did when one begins exactly at it. The writer of the pending @ wrappers asserts that they stand in the order their operands begin. That order is what keeps the starts still waiting correct, and each of these bugs broke it. Signed-off-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> Change-Id: I87ca7c67be9d2f11ca34661a79401a2fa1c60bbe Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/9638 Tested-by: Jenkins CPCI <releng@collaboraoffice.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit 3d52e137f229d87bc5633dc7966bace3044f1c3a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209504 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Formula Helper Code
Contains parts of the formula parser used outside LibreOffice Calc code that has been pulled out from Calc's formula parser code.
Also contains some functions that are needed by code in both sc and
scaddins. Located here just for convenience. So sue me.