From 7d785183dda20942459616110bab041f9293a399 Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Mon, 20 Aug 2018 12:59:59 +0200 Subject: 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 Tested-by: Eike Rathke --- sc/source/core/tool/interpr1.cxx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'sc/source/core/tool/interpr1.cxx') diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index 2e2b1dc7b265..71f95a3ecd55 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -6220,7 +6220,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; } -- cgit v1.2.3