Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
332451be
Kaydet (Commit)
332451be
authored
Agu 29, 2012
tarafından
Markus Mohrhard
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
add unit test for basic sorting with cell note
Change-Id: I997f96e0a9f6aa4c2ed7f2d3811a84fdfda05683
üst
b705c6b4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
0 deletions
+45
-0
ucalc.cxx
sc/qa/unit/ucalc.cxx
+45
-0
No files found.
sc/qa/unit/ucalc.cxx
Dosyayı görüntüle @
332451be
...
...
@@ -224,6 +224,7 @@ public:
void testFindAreaPosRowDown();
void testFindAreaPosColRight();
void testSort();
CPPUNIT_TEST_SUITE(Test);
CPPUNIT_TEST(testCollator);
...
...
@@ -271,6 +272,7 @@ public:
CPPUNIT_TEST(testCopyPasteFormulasExternalDoc);
CPPUNIT_TEST(testFindAreaPosRowDown);
CPPUNIT_TEST(testFindAreaPosColRight);
CPPUNIT_TEST(testSort);
CPPUNIT_TEST_SUITE_END();
private:
...
...
@@ -4881,6 +4883,49 @@ void Test::testFindAreaPosColRight()
pDoc->DeleteTab(0);
}
void Test::testSort()
{
ScDocument* pDoc = m_xDocShRef->GetDocument();
rtl::OUString aTabName1("test1");
pDoc->InsertTab(0, aTabName1);
const char* aData[][2] = {
{ "2", "4" },
{ "4", "1" },
{ "1", "2" }
};
clearRange( pDoc, ScRange(0, 0, 0, 1, SAL_N_ELEMENTS(aData), 0));
ScAddress aPos(0,0,0);
ScRange aDataRange = insertRangeData( pDoc, aPos, aData, SAL_N_ELEMENTS(aData));
CPPUNIT_ASSERT_MESSAGE("failed to insert range data at correct position", aDataRange.aStart == aPos);
rtl::OUString aHello("Hello");
rtl::OUString aJimBob("Jim Bob");
ScAddress rAddr(1, 1, 0);
ScPostIt* pNote = m_pDoc->GetNotes(rAddr.Tab())->GetOrCreateNote(rAddr);
pNote->SetText(rAddr, aHello);
pNote->SetAuthor(aJimBob);
ScSortParam aSortData;
aSortData.nCol1 = 1;
aSortData.nCol2 = 1;
aSortData.nRow1 = 0;
aSortData.nRow2 = 2;
aSortData.maKeyState[0].bDoSort = true;
aSortData.maKeyState[0].nField = 1;
pDoc->Sort(0, aSortData, false, NULL);
double nVal = pDoc->GetValue(1,0,0);
CPPUNIT_ASSERT_DOUBLES_EQUAL(nVal, 1.0, 1e-8);
// check that note is also moved
pNote = m_pDoc->GetNotes(0)->findByAddress( 1, 0 );
CPPUNIT_ASSERT(pNote);
pDoc->DeleteTab(0);
}
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment