From b6b0b95bae845a2a59831f4e3ae63de3e54a2984 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 14 May 2014 16:23:11 -0400 Subject: Bail out of group calculation in case the array fetching fails. Change-Id: Ibb7575eeb025fc025d05b147629113796185c5d3 --- formula/source/core/api/vectortoken.cxx | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) (limited to 'formula') diff --git a/formula/source/core/api/vectortoken.cxx b/formula/source/core/api/vectortoken.cxx index bd75efba9e98..c1ff94c82146 100644 --- a/formula/source/core/api/vectortoken.cxx +++ b/formula/source/core/api/vectortoken.cxx @@ -11,15 +11,34 @@ namespace formula { -VectorRefArray::VectorRefArray() : mpNumericArray(NULL), mpStringArray(NULL) {} -VectorRefArray::VectorRefArray( const double* pArray ) : mpNumericArray(pArray), mpStringArray(NULL) {} -VectorRefArray::VectorRefArray( rtl_uString** pArray ) : mpNumericArray(NULL), mpStringArray(pArray) {} +VectorRefArray::VectorRefArray() : + mpNumericArray(NULL), + mpStringArray(NULL), + mbValid(true) {} + +VectorRefArray::VectorRefArray( InitInvalid ) : + mpNumericArray(NULL), + mpStringArray(NULL), + mbValid(false) {} + +VectorRefArray::VectorRefArray( const double* pArray ) : + mpNumericArray(pArray), + mpStringArray(NULL), + mbValid(true) {} + +VectorRefArray::VectorRefArray( rtl_uString** pArray ) : + mpNumericArray(NULL), + mpStringArray(pArray), + mbValid(true) {} + VectorRefArray::VectorRefArray( const double* pNumArray, rtl_uString** pStrArray ) : - mpNumericArray(pNumArray), mpStringArray(pStrArray) {} + mpNumericArray(pNumArray), + mpStringArray(pStrArray), + mbValid(true) {} bool VectorRefArray::isValid() const { - return mpNumericArray || mpStringArray; + return mbValid; } SingleVectorRefToken::SingleVectorRefToken( const VectorRefArray& rArray, size_t nReqLength, size_t nArrayLength ) : -- cgit