summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2015-11-16 12:23:15 +0100
committerEike Rathke <erack@redhat.com>2015-11-16 13:25:49 +0100
commit49257e1da7e371fdea0fac080116b0511789cac7 (patch)
treec959639884536a2bb035ee0fda819c7dada565c7 /sc
parentc994ce8a1d292b02e4c53f7b4061f3bbb840f874 (diff)
Resolves: tdf#95670 propagate ForceArray per parameter
Regression of b5cd11b4b02a85a83db77ba9d8d1763f0cd88cb1 It was always wrong to propagate ForceArray already if a function had a ForceArray parameter *somewhere*, we need to do this per parameter instead. Change-Id: If188d45366279d9a7bf641edc7e4dd7095d6d035
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/compiler.hxx2
-rw-r--r--sc/source/core/inc/interpre.hxx4
-rw-r--r--sc/source/core/tool/compiler.cxx8
-rw-r--r--sc/source/core/tool/interpr4.cxx2
-rw-r--r--sc/source/core/tool/token.cxx2
5 files changed, 15 insertions, 3 deletions
diff --git a/sc/inc/compiler.hxx b/sc/inc/compiler.hxx
index ca335593b7f2..ffdd65ad7328 100644
--- a/sc/inc/compiler.hxx
+++ b/sc/inc/compiler.hxx
@@ -475,6 +475,8 @@ private:
virtual void CreateStringFromIndex( OUStringBuffer& rBuffer, const formula::FormulaToken* pToken ) const override;
virtual void LocalizeString( OUString& rName ) const override; // modify rName - input: exact name
+ virtual bool IsForceArrayParameter( const formula::FormulaToken* pToken, sal_uInt16 nParam ) const;
+
/// Access the CharTable flags
inline sal_uLong GetCharTableFlags( sal_Unicode c, sal_Unicode cLast )
{ return c < 128 ? pConv->getCharTableFlags(c, cLast) : 0; }
diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx
index 1343e7543bf8..c35248d57f8f 100644
--- a/sc/source/core/inc/interpre.hxx
+++ b/sc/source/core/inc/interpre.hxx
@@ -32,6 +32,7 @@
#include "calcconfig.hxx"
#include "token.hxx"
#include "math.hxx"
+#include "parclass.hxx"
#include <map>
#include <memory>
@@ -918,7 +919,8 @@ inline void ScInterpreter::MatrixDoubleRefToMatrix()
inline bool ScInterpreter::MatrixParameterConversion()
{
- if ( (bMatrixFormula || pCur->HasForceArray()) && !pJumpMatrix && sp > 0 )
+ if ( (bMatrixFormula || pCur->HasForceArray() || ScParameterClassification::HasForceArray( pCur->GetOpCode())) &&
+ !pJumpMatrix && sp > 0 )
return ConvertMatrixParameters();
return false;
}
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 59c259e5131f..05cebc13d384 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -5416,4 +5416,12 @@ bool ScCompiler::HandleTableRef()
return true;
}
+bool ScCompiler::IsForceArrayParameter( const formula::FormulaToken* pToken, sal_uInt16 nParam ) const
+{
+ ScParameterClassification::Type eType = ScParameterClassification::GetParameterType( pToken, nParam);
+ return
+ eType == ScParameterClassification::ForceArray ||
+ eType == ScParameterClassification::ReferenceOrForceArray;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 0a8a74579e25..a5f5982a854e 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -1400,7 +1400,7 @@ bool ScInterpreter::ConvertMatrixParameters()
// has ForceArray or ReferenceOrForceArray
// parameter *somewhere else*) pick a normal
// position dependent implicit intersection later.
- (eType != ScParameterClassification::Value || bMatrixFormula))
+ (eType != ScParameterClassification::Value || bMatrixFormula || pCur->HasForceArray()))
{
SCCOL nCol1, nCol2;
SCROW nRow1, nRow2;
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index cfdd5a39a5bf..ea66456679c8 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -252,7 +252,7 @@ void ScRawToken::SetOpCode( OpCode e )
default:
eType = svByte;
sbyte.cByte = 0;
- sbyte.bHasForceArray = ScParameterClassification::HasForceArray( eOp);
+ sbyte.bHasForceArray = false;
}
}