[Libreoffice-commits] core.git: Branch 'private/kohei/calc-sort-fix' - sc/qa
Kohei Yoshida
kohei.yoshida at collabora.com
Mon Apr 21 13:39:18 PDT 2014
sc/qa/unit/ucalc.cxx | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)
New commits:
commit 544c93ad6d16d823f1ff63c83287d4aaf21339fc
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date: Mon Apr 21 16:38:42 2014 -0400
We have m_pDoc available here in the test...
Change-Id: Ib541cb9f99b3f1094e33d7b333fdbeeeccadce26
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 7197d91..d29461f 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -4581,9 +4581,8 @@ void Test::testFindAreaPosColRight()
// if cells in the sort are referenced by formulas
void Test::testSortWithFormulaRefs()
{
- ScDocument* pDoc = getDocShell().GetDocument();
- pDoc->InsertTab(0, "List1");
- pDoc->InsertTab(1, "List2");
+ m_pDoc->InsertTab(0, "List1");
+ m_pDoc->InsertTab(1, "List2");
const char* aFormulaData[6] = {
"=IF($List1.A2<>\"\",$List1.A2,\"\")",
@@ -4601,7 +4600,7 @@ void Test::testSortWithFormulaRefs()
"larry",
};
- const char* aResults[ 6 ] = {
+ const char* aResults[6] = {
"bob",
"brian",
"larry",
@@ -4612,12 +4611,12 @@ void Test::testSortWithFormulaRefs()
// insert data to sort
SCROW nStart = 1, nEnd = 4;
for ( SCROW i = nStart; i <= nEnd; ++i )
- pDoc->SetString( 0, i, 0, OUString::createFromAscii(aTextData[i-1]) );
+ m_pDoc->SetString( 0, i, 0, OUString::createFromAscii(aTextData[i-1]) );
// insert forumulas
nStart = 0;
nEnd = SAL_N_ELEMENTS(aFormulaData);
for ( SCROW i = nStart; i < nEnd; ++i )
- pDoc->SetString( 0, i, 1, OUString::createFromAscii(aFormulaData[i]) );
+ m_pDoc->SetString( 0, i, 1, OUString::createFromAscii(aFormulaData[i]) );
ScSortParam aSortData;
aSortData.nCol1 = 0;
@@ -4627,16 +4626,16 @@ void Test::testSortWithFormulaRefs()
aSortData.maKeyState[0].bDoSort = true;
aSortData.maKeyState[0].nField = 0;
- pDoc->Sort(0, aSortData, false, NULL);
+ m_pDoc->Sort(0, aSortData, false, NULL);
nEnd = SAL_N_ELEMENTS( aResults );
for ( SCROW i = nStart; i < nEnd; ++i )
{
- OUString sResult = pDoc->GetString( 0, i + 1, 0);
- CPPUNIT_ASSERT_EQUAL( OUString::createFromAscii( aResults[ i ] ), sResult );
+ OUString sResult = m_pDoc->GetString(0, i + 1, 0);
+ CPPUNIT_ASSERT_EQUAL( OUString::createFromAscii( aResults[i] ), sResult );
}
- pDoc->DeleteTab(0);
- pDoc->DeleteTab(1);
+ m_pDoc->DeleteTab(1);
+ m_pDoc->DeleteTab(0);
}
void Test::testSortWithStrings()
More information about the Libreoffice-commits
mailing list