diff options
author | Eike Rathke <erack@redhat.com> | 2018-08-20 12:59:59 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-08-22 09:21:43 +0200 |
commit | 886b39fbd4f2401922b1c5af0a06ad09efb59d93 (patch) | |
tree | e975e0b2795bfdbc1d61596184c6ca41ff7a0c2f | |
parent | 49e522f3d6c6045710ecb2d233a07880ac9c6c7d (diff) |
Resolves: tdf#119137 treat scalar non-reference non-array argument as matrix
... of size 1x1 so all further checks are applicable as for any other array.
Change-Id: I0c8926bc56f5e451ca4847e0f0c76a1be97418f2
Reviewed-on: https://gerrit.libreoffice.org/59317
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
(cherry picked from commit 7d785183dda20942459616110bab041f9293a399)
Reviewed-on: https://gerrit.libreoffice.org/59329
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sc/source/core/tool/interpr1.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index c0558c869ad4..964b9e9e13a4 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -6222,7 +6222,23 @@ void ScInterpreter::IterateParametersIfs( double(*ResultFunc)( const sc::ParamIf nMainTab2 = 0; } break; + // Treat a scalar value as 1x1 matrix. + case svDouble: + pMainMatrix = GetNewMat(1,1); + nMainCol1 = nMainCol2 = 0; + nMainRow1 = nMainRow2 = 0; + nMainTab1 = nMainTab2 = 0; + pMainMatrix->PutDouble( GetDouble(), 0, 0); + break; + case svString: + pMainMatrix = GetNewMat(1,1); + nMainCol1 = nMainCol2 = 0; + nMainRow1 = nMainRow2 = 0; + nMainTab1 = nMainTab2 = 0; + pMainMatrix->PutString( GetString(), 0, 0); + break; default: + PopError(); PushError( FormulaError::IllegalParameter); return; } |