The # postfix operator was parsed at the same level as the percent sign, which is looser than the prefix operators. Because of this =@A1# compiled to the spill range of an implicit intersection and =-A1# to the spill range of a negated value. Neither of those means anything, and OOXML writes the # around the reference alone in both cases. The # is now parsed right after the factor it follows, tighter than any operator that can come before it. A whole range reference goes inside, because the lexer reads A1:A3 as a single reference. The percent sign stays above the reference operators, so =A1%# leaves the # with nothing to bind to and doesn't parse, and the export drops such a # (OOXML has no spelling for it either). A blank between two operands is only the intersection operator if both sides yield a reference. The # does, so the checks that keep the blank alive and that keep the operator once the operands are known had to be told about it. The interpreter passes the spill range on as a matrix that carries the range it was read from. The intersection, range and union operators only took references and refused that, so PopReferenceOperand now hands them the carried range as a double reference. Signed-off-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> Change-Id: I1a587bf291ff639b326a366b8efc332106eb5fd3 Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/10156 Tested-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com> (cherry picked from commit c589c34aaec00d60fc47f1933762b105f9d22de3) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210293 Tested-by: Xisco Fauli <xiscofauli@libreoffice.org> 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.