diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2013-11-26 20:34:45 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2013-11-26 20:36:35 -0500 |
commit | 507d348454f6fd2d6475d2878bbc56efd9d73ca1 (patch) | |
tree | a2418e19bb6e02f128fd74a51a1fc52da417804f /sc/source/core | |
parent | 1de7d0aba4142424fe0082071a4ac64ec377cea0 (diff) |
Fix additional bugs in the vector array fetching code.
And a test case to catch it.
Change-Id: I233269822b383afa9783bdc7318eddee31d1eaa3
Diffstat (limited to 'sc/source/core')
-rw-r--r-- | sc/source/core/data/column2.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index 65d6c884126f..24cd6155865e 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -2752,9 +2752,9 @@ formula::VectorRefArray ScColumn::FetchVectorRefArray( SCROW nRow1, SCROW nRow2 const double* pNum = NULL; rtl_uString** pStr = NULL; if (pColArray->mpNumArray) - pNum = &(*pColArray->mpNumArray)[0]; + pNum = &(*pColArray->mpNumArray)[nRow1]; if (pColArray->mpStrArray) - pStr = &(*pColArray->mpStrArray)[0]; + pStr = &(*pColArray->mpStrArray)[nRow1]; return formula::VectorRefArray(pNum, pStr); } @@ -2772,9 +2772,9 @@ formula::VectorRefArray ScColumn::FetchVectorRefArray( SCROW nRow1, SCROW nRow2 const double* pNum = NULL; rtl_uString** pStr = NULL; if (pColArray->mpNumArray) - pNum = &(*pColArray->mpNumArray)[0]; + pNum = &(*pColArray->mpNumArray)[nRow1]; if (pColArray->mpStrArray) - pStr = &(*pColArray->mpStrArray)[0]; + pStr = &(*pColArray->mpStrArray)[nRow1]; return formula::VectorRefArray(pNum, pStr); } @@ -2790,7 +2790,7 @@ formula::VectorRefArray ScColumn::FetchVectorRefArray( SCROW nRow1, SCROW nRow2 return formula::VectorRefArray(); if (static_cast<size_t>(nRow2) < itBlk->size) - return formula::VectorRefArray(&(*pColArray->mpNumArray)[0]); + return formula::VectorRefArray(&(*pColArray->mpNumArray)[nRow1]); // Fill the remaining array with values from the following blocks. size_t nPos = itBlk->size; |