[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)
committerDaniel Leidert <dleidert@debian.org>
Sat, 31 May 2025 03:25:27 +0000 (05:25 +0200)
commit0c2f501beb6dc06a124e92642f70f24f54a1aeab
treeda8b84e2af844366a0b8bae8eeb8df0c62272509
parent44d5b255936f997282ca62887f046d30a8f2393e
[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