diff options
-rw-r--r-- | formula/source/core/api/vectortoken.cxx | 5 | ||||
-rw-r--r-- | include/formula/vectortoken.hxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/formulacell.cxx | 4 |
3 files changed, 9 insertions, 2 deletions
diff --git a/formula/source/core/api/vectortoken.cxx b/formula/source/core/api/vectortoken.cxx index 206b9c9da8e8..55ab18e27932 100644 --- a/formula/source/core/api/vectortoken.cxx +++ b/formula/source/core/api/vectortoken.cxx @@ -15,6 +15,11 @@ VectorRefArray::VectorRefArray() : mpNumericArray(NULL), mpStringArray(NULL) {} VectorRefArray::VectorRefArray( const double* pArray ) : mpNumericArray(pArray), mpStringArray(NULL) {} VectorRefArray::VectorRefArray( rtl_uString** pArray ) : mpNumericArray(NULL), mpStringArray(pArray) {} +bool VectorRefArray::isValid() const +{ + return mpNumericArray || mpStringArray; +} + SingleVectorRefToken::SingleVectorRefToken( const double* pArray, size_t nLength ) : FormulaToken(svSingleVectorRef, ocPush), maArray(pArray), mnArrayLength(nLength) {} diff --git a/include/formula/vectortoken.hxx b/include/formula/vectortoken.hxx index 54043b114990..3b1db684a010 100644 --- a/include/formula/vectortoken.hxx +++ b/include/formula/vectortoken.hxx @@ -40,6 +40,8 @@ struct FORMULA_DLLPUBLIC VectorRefArray VectorRefArray(); VectorRefArray( const double* pArray ); VectorRefArray( rtl_uString** pArray ); + + bool isValid() const; }; /** diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx index dfcf352145d5..9d3210481bef 100644 --- a/sc/source/core/data/formulacell.cxx +++ b/sc/source/core/data/formulacell.cxx @@ -3420,7 +3420,7 @@ public: // length. formula::VectorRefArray aArray = mrDoc.FetchVectorRefArray(mrCxt, aRefPos, nLen); - if (!aArray.mpNumericArray && !aArray.mpStringArray) + if (!aArray.isValid()) return false; formula::SingleVectorRefToken aTok(aArray, nLen); @@ -3488,7 +3488,7 @@ public: { aRefPos.SetCol(i); formula::VectorRefArray aArray = mrDoc.FetchVectorRefArray(mrCxt, aRefPos, nArrayLength); - if (!aArray.mpNumericArray && !aArray.mpStringArray) + if (!aArray.isValid()) return false; aArrays.push_back(aArray); |