diff options
author | Herbert Dürr <hdu@apache.org> | 2013-08-28 07:08:51 +0000 |
---|---|---|
committer | Herbert Dürr <hdu@apache.org> | 2013-08-28 07:08:51 +0000 |
commit | b819b20948443031751ad8225133517836c1ca30 (patch) | |
tree | eb9d124105191bf8d1984d53ef412954731082dd /sc | |
parent | 75e9010730525ed6122655ac3c3899359c305104 (diff) |
#i122822# revert fix for issue 121058
Sample reduction is only viable on the view side, but not on the generic
data provider side. Reverting r1388440 to fix the latter.
Patch by: Yan Peng Guo
Regression isolated by: Regina Henschel, Herbert Duerr
Found by: rohner@tofwerk.com
Notes
Notes:
ignore: reverted
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/unoobj/chart2uno.cxx | 53 |
1 files changed, 8 insertions, 45 deletions
diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx index 105cf9bcbd80..dc822985768b 100644 --- a/sc/source/ui/unoobj/chart2uno.cxx +++ b/sc/source/ui/unoobj/chart2uno.cxx @@ -2534,6 +2534,7 @@ void ScChart2DataSequence::BuildDataCache() SCCOL nLastCol = -1; SCROW nLastRow = -1; + for (SCTAB nTab = aRange.aStart.Tab(); nTab <= aRange.aEnd.Tab(); ++nTab) { for (SCCOL nCol = aRange.aStart.Col(); nCol <= aRange.aEnd.Col(); ++nCol) @@ -2563,6 +2564,7 @@ void ScChart2DataSequence::BuildDataCache() continue; if (pCell->HasStringData()) + rItem.maString = pCell->GetStringData(); else { @@ -3018,51 +3020,12 @@ uno::Sequence< double > SAL_CALL ScChart2DataSequence::getNumericalData() ::rtl::math::setNan(&fNAN); sal_Int32 nCount = m_aDataArray.size(); - // i121058: if there's too many points need to be painted, it doens't need to get all points for performance consideration - // and so many points are not useful for users to understand the chart. So only picked some points to paint - sal_Int32 nStep = nCount >= 10000 ? 50 : 1; - nCount = nCount >= 10000 ? ((nCount - nCount % nStep) / nStep) : nCount; - sal_Int32 nRealCount = nStep == 1 ? nCount : nCount * 2; - uno::Sequence<double> aSeq(nRealCount); - double* pArr = aSeq.getArray(); - ::std::list<Item>::const_iterator itr = m_aDataArray.begin(), itrEnd = m_aDataArray.end(); - for (sal_Int32 i = 0; i < nCount; i++) - { - if (nStep == 1) - { - *pArr++ = itr->mbIsValue ? itr->mfValue : fNAN; - itr++; - } - else - { - sal_Int32 nMax = 0, nMin = 0, nMaxStep = 0, nMinStep = 0; - for (sal_Int32 j = 0; j < nStep; j++) - { - sal_Int32 nValue = itr->mbIsValue ? itr->mfValue : fNAN; - if (nValue > nMax) - { - nMax = nValue; - nMaxStep = j; - } - if (nValue < nMin) - { - nMin = nValue; - nMinStep = j; - } - itr++; - } - if (nMaxStep > nMinStep) - { - *pArr++ = nMin; - *pArr++ = nMax; - } - else - { - *pArr++ = nMax; - *pArr++ = nMin; - } - } - } + uno::Sequence<double> aSeq(nCount); + double* pArr = aSeq.getArray(); + ::std::list<Item>::const_iterator itr = m_aDataArray.begin(), itrEnd = m_aDataArray.end(); + for (; itr != itrEnd; ++itr, ++pArr) + *pArr = itr->mbIsValue ? itr->mfValue : fNAN; + return aSeq; } |