[Libreoffice-commits] core.git: 2 commits - sc/qa sc/source
Kohei Yoshida
kohei.yoshida at collabora.com
Fri Sep 19 06:14:50 PDT 2014
sc/qa/unit/ucalc_sort.cxx | 18 ++++++++++--------
sc/source/ui/docshell/dbdocfun.cxx | 1 +
2 files changed, 11 insertions(+), 8 deletions(-)
New commits:
commit 8af25862f1782ff1fb0f66415e3a2d624f61d737
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date: Fri Sep 19 09:12:00 2014 -0400
fdo#84009: Adjust the test case to catch this.
Change-Id: I16bdc6760276b5bc0c78c3693d3f92c68ef67ed1
diff --git a/sc/qa/unit/ucalc_sort.cxx b/sc/qa/unit/ucalc_sort.cxx
index 95a5e42..f81a394 100644
--- a/sc/qa/unit/ucalc_sort.cxx
+++ b/sc/qa/unit/ucalc_sort.cxx
@@ -1320,6 +1320,7 @@ void Test::testSortRefUpdate5()
void Test::testSortOutOfPlaceResult()
{
m_pDoc->InsertTab(0, "Sort");
+ m_pDoc->InsertTab(1, "Result");
const char* pData[] = {
"Header",
@@ -1356,7 +1357,7 @@ void Test::testSortOutOfPlaceResult()
aSortData.nRow2 = 5;
aSortData.bHasHeader = true;
aSortData.bInplace = false;
- aSortData.nDestTab = 0;
+ aSortData.nDestTab = 1;
aSortData.nDestCol = 2;
aSortData.nDestRow = 1;
aSortData.maKeyState[0].bDoSort = true;
@@ -1373,14 +1374,15 @@ void Test::testSortOutOfPlaceResult()
CPPUNIT_ASSERT_EQUAL( 9.0, m_pDoc->GetValue(ScAddress(0,4,0)));
CPPUNIT_ASSERT_EQUAL(-2.0, m_pDoc->GetValue(ScAddress(0,5,0)));
- // Sort result in C2:C7.
- CPPUNIT_ASSERT_EQUAL(OUString("Header"), m_pDoc->GetString(ScAddress(2,1,0)));
- CPPUNIT_ASSERT_EQUAL(-2.0, m_pDoc->GetValue(ScAddress(2,2,0)));
- CPPUNIT_ASSERT_EQUAL( 1.0, m_pDoc->GetValue(ScAddress(2,3,0)));
- CPPUNIT_ASSERT_EQUAL( 2.0, m_pDoc->GetValue(ScAddress(2,4,0)));
- CPPUNIT_ASSERT_EQUAL( 9.0, m_pDoc->GetValue(ScAddress(2,5,0)));
- CPPUNIT_ASSERT_EQUAL(23.0, m_pDoc->GetValue(ScAddress(2,6,0)));
+ // Sort result in C2:C7 on sheet "Result".
+ CPPUNIT_ASSERT_EQUAL(OUString("Header"), m_pDoc->GetString(ScAddress(2,1,1)));
+ CPPUNIT_ASSERT_EQUAL(-2.0, m_pDoc->GetValue(ScAddress(2,2,1)));
+ CPPUNIT_ASSERT_EQUAL( 1.0, m_pDoc->GetValue(ScAddress(2,3,1)));
+ CPPUNIT_ASSERT_EQUAL( 2.0, m_pDoc->GetValue(ScAddress(2,4,1)));
+ CPPUNIT_ASSERT_EQUAL( 9.0, m_pDoc->GetValue(ScAddress(2,5,1)));
+ CPPUNIT_ASSERT_EQUAL(23.0, m_pDoc->GetValue(ScAddress(2,6,1)));
+ m_pDoc->DeleteTab(1);
m_pDoc->DeleteTab(0);
}
commit 5fd4679e7b92f344ea867e0dca1fc4c9363ae2cd
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date: Fri Sep 19 09:11:09 2014 -0400
fdo#84009: Be sure to update the sheet index when moving the sort range.
Change-Id: Ic9ad51b33f6dfb6f90e76439c27eeff25ec4c7da
diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx
index 7f30a02..fe843b5 100644
--- a/sc/source/ui/docshell/dbdocfun.cxx
+++ b/sc/source/ui/docshell/dbdocfun.cxx
@@ -499,6 +499,7 @@ bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam,
return false;
aLocalParam.MoveToDest();
+ nTab = aLocalParam.nDestTab;
}
ScEditableTester aTester( &rDoc, nTab, aLocalParam.nCol1,aLocalParam.nRow1,
More information about the Libreoffice-commits
mailing list