[PATCH] Obtain actual 0-parameter count for OR(), AND() and 1-parameter functions
authorEike Rathke <erack@redhat.com>
Thu, 16 Feb 2023 19:20:31 +0000 (20:20 +0100)
committerRene Engelhard <rene@debian.org>
Wed, 24 May 2023 18:05:03 +0000 (19:05 +0100)
commitc5d963fff3c45c7482964d4ff8671840c3a51b1e
tree445a33f9a93e31a8edc2b8721318efdcbeb7000a
parentaaea8c3bcd2a9204770260c2256ce9cb9455823f
[PATCH] Obtain actual 0-parameter count for OR(), AND() and 1-parameter functions

OR and AND for legacy infix notation are classified as binary
operators but in fact are functions with parameter count. In case
no argument is supplied, GetByte() returns 0 and for that case the
implicit binary operator 2 parameters were wrongly assumed.
Similar for functions expecting 1 parameter, without argument 1
was assumed. For "real" unary and binary operators the compiler
already checks parameters. Omit OR and AND and 1-parameter
functions from this implicit assumption and return the actual 0
count.

Change-Id: Ie05398c112a98021ac2875cf7b6de994aee9d882
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147173
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
(cherry picked from commit e7ce9bddadb2db222eaa5f594ef1de2e36d57e5c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147129
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit d6599a2af131994487d2d9223a4fd32a8c3ddc49)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147132
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Gbp-Pq: Name sc-stack-parameter-count.diff
formula/source/core/api/token.cxx
sc/source/core/inc/interpre.hxx
sc/source/core/tool/interpr1.cxx
sc/source/core/tool/interpr3.cxx
sc/source/core/tool/interpr4.cxx