diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-12-05 22:01:29 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-12-05 22:45:40 -0500 |
commit | 68fd7b7adc3021d30460a2c80d6876df239fd490 (patch) | |
tree | 36ba2c8efa323a3cc1ae1bdb62f3d65df90cb2a3 /sc/qa | |
parent | Remove unused header include esp when it's an STL header. (diff) | |
download | core-68fd7b7adc3021d30460a2c80d6876df239fd490.tar.gz core-68fd7b7adc3021d30460a2c80d6876df239fd490.zip |
Fix incorrect adjustment of range references during sort.
... as a result of the introduction of range-based area listeners.
With this change, the insertRangeData() function for ucalc no longer needs
the additional bGroupListening flag. All tests pass with group listening
enabled at all times.
Change-Id: I9b9fb9443c727ff62badbd60ec9cd94094eb5a45
Diffstat (limited to 'sc/qa')
-rw-r--r-- | sc/qa/unit/ucalc.hxx | 22 | ||||
-rw-r--r-- | sc/qa/unit/ucalc_formula.cxx | 2 | ||||
-rw-r--r-- | sc/qa/unit/ucalc_sharedformula.cxx | 2 |
3 files changed, 8 insertions, 18 deletions
diff --git a/sc/qa/unit/ucalc.hxx b/sc/qa/unit/ucalc.hxx index cb2f8394fb79..d5fd98380263 100644 --- a/sc/qa/unit/ucalc.hxx +++ b/sc/qa/unit/ucalc.hxx @@ -59,13 +59,8 @@ public: template<size_t _Size> static ScRange insertRangeData( - ScDocument* pDoc, const ScAddress& rPos, const char* aData[][_Size], size_t nRowCount, - bool bGroupListening = false ) + ScDocument* pDoc, const ScAddress& rPos, const char* aData[][_Size], size_t nRowCount ) { - // TODO : Ideally bGroupListening should be always true for all tests. - // Eventually we want to drop this parameter once all tests pass with - // group listening turned on. - ScRange aRange(rPos); aRange.aEnd.SetCol(rPos.Col()+_Size-1); aRange.aEnd.SetRow(rPos.Row()+nRowCount-1); @@ -82,19 +77,14 @@ public: SCCOL nCol = i + rPos.Col(); SCROW nRow = j + rPos.Row(); OUString aStr(aData[j][i], strlen(aData[j][i]), RTL_TEXTENCODING_UTF8); - if (bGroupListening) - { - ScSetStringParam aParam; // Leave default. - aParam.meStartListening = sc::NoListening; - pDoc->SetString(nCol, nRow, rPos.Tab(), aStr, &aParam); - } - else - pDoc->SetString(nCol, nRow, rPos.Tab(), aStr, NULL); + + ScSetStringParam aParam; // Leave default. + aParam.meStartListening = sc::NoListening; + pDoc->SetString(nCol, nRow, rPos.Tab(), aStr, &aParam); } } - if (bGroupListening) - pDoc->StartAllListeners(aRange); + pDoc->StartAllListeners(aRange); printRange(pDoc, aRange, "Range data content"); return aRange; diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx index 56f5f8c080a5..c66194c34a4b 100644 --- a/sc/qa/unit/ucalc_formula.cxx +++ b/sc/qa/unit/ucalc_formula.cxx @@ -4274,7 +4274,7 @@ void Test::testFormulaDepTracking3() { "5", "6", "=SUM(A3:B3)", 0 }, }; - insertRangeData(m_pDoc, ScAddress(0,0,0), pData, SAL_N_ELEMENTS(pData), true); + insertRangeData(m_pDoc, ScAddress(0,0,0), pData, SAL_N_ELEMENTS(pData)); // Check the initial formula results. CPPUNIT_ASSERT_EQUAL( 3.0, m_pDoc->GetValue(ScAddress(2,0,0))); diff --git a/sc/qa/unit/ucalc_sharedformula.cxx b/sc/qa/unit/ucalc_sharedformula.cxx index 811612379163..2ef7d88b06c8 100644 --- a/sc/qa/unit/ucalc_sharedformula.cxx +++ b/sc/qa/unit/ucalc_sharedformula.cxx @@ -596,7 +596,7 @@ void Test::testSharedFormulasRefUpdateRangeDeleteRow() { "7", "8", "=SUM(A5:B5)" } }; - insertRangeData(m_pDoc, ScAddress(0,0,0), aData, SAL_N_ELEMENTS(aData), true); + insertRangeData(m_pDoc, ScAddress(0,0,0), aData, SAL_N_ELEMENTS(aData)); // Check initial formula values. CPPUNIT_ASSERT_EQUAL( 3.0, m_pDoc->GetValue(ScAddress(2,0,0))); |