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
cb729adc
Kaydet (Commit)
cb729adc
authored
Haz 08, 2011
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Removed patch accidentally committed.
üst
336ed340
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
90 deletions
+0
-90
0001-add-unit-test-for-ScDocument-MoveTab.patch
sc/0001-add-unit-test-for-ScDocument-MoveTab.patch
+0
-90
No files found.
sc/0001-add-unit-test-for-ScDocument-MoveTab.patch
deleted
100644 → 0
Dosyayı görüntüle @
336ed340
From e8c376c207e89f0b6155e4bbcd0f46421db116ea Mon Sep 17 00:00:00 2001
From: Markus Mohrhard <markus.mohrhard@googlemail.com>
Date: Thu, 26 May 2011 19:12:43 +0200
Subject: [PATCH] add unit test for ScDocument::MoveTab
this unit test is disabled for now because there is a problem with ScProgress in ScDocument::MoveTab during unit tests
---
sc/qa/unit/ucalc.cxx | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 52 insertions(+), 0 deletions(-)
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index a55fbbf..c43eb01 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -236,6 +236,7 @@ public:
void testDataPilot();
void testDataPilotFilters();
void testSheetCopy();
+ void testSheetMove();
void testExternalRef();
void testDataArea();
@@ -276,6 +277,9 @@ public:
CPPUNIT_TEST(testDataPilot);
CPPUNIT_TEST(testDataPilotFilters);
CPPUNIT_TEST(testSheetCopy);
+#if 0 // Disabled, first problem with ScProgress in ScDocument::MoveTab must be solved
+ CPPUNIT_TEST(testSheetMove);
+#endif
CPPUNIT_TEST(testExternalRef);
CPPUNIT_TEST(testDataArea);
CPPUNIT_TEST(testGraphicsInGroup);
@@ -1238,6 +1242,54 @@ void Test::testSheetCopy()
CPPUNIT_ASSERT_MESSAGE("rows 5 - 10 should be hidden", bHidden && nRow1 == 5 && nRow2 == 10);
bHidden = m_pDoc->RowHidden(11, 1, &nRow1, &nRow2);
CPPUNIT_ASSERT_MESSAGE("rows 11 - maxrow should be visible", !bHidden && nRow1 == 11 && nRow2 == MAXROW);
+ m_pDoc->DeleteTab(1);
+ m_pDoc->DeleteTab(0);
+}
+
+void Test::testSheetMove()
+{
+ OUString aTabName(RTL_CONSTASCII_USTRINGPARAM("TestTab1"));
+ m_pDoc->InsertTab(0, aTabName);
+ CPPUNIT_ASSERT_MESSAGE("document should have one sheet to begin with.", m_pDoc->GetTableCount() == 1);
+ SCROW nRow1, nRow2;
+ bool bHidden = m_pDoc->RowHidden(0, 0, &nRow1, &nRow2);
+ CPPUNIT_ASSERT_MESSAGE("new sheet should have all rows visible", !bHidden && nRow1 == 0 && nRow2 == MAXROW);
+
+ //test if inserting before another sheet works
+ m_pDoc->InsertTab(0, OUString(RTL_CONSTASCII_USTRINGPARAM("TestTab2")));
+ CPPUNIT_ASSERT_MESSAGE("document should have two sheets", m_pDoc->GetTableCount() == 2);
+ bHidden = m_pDoc->RowHidden(0, 0, &nRow1, &nRow2);
+ CPPUNIT_ASSERT_MESSAGE("new sheet should have all rows visible", !bHidden && nRow1 == 0 && nRow2 == MAXROW);
+
+ // Move and test the result.
+ m_pDoc->MoveTab(0, 1);
+ CPPUNIT_ASSERT_MESSAGE("document now should have two sheets.", m_pDoc->GetTableCount() == 2);
+ bHidden = m_pDoc->RowHidden(0, 1, &nRow1, &nRow2);
+ CPPUNIT_ASSERT_MESSAGE("copied sheet should also have all rows visible as the original.", !bHidden && nRow1 == 0 && nRow2 == MAXROW);
+ String aName;
+ m_pDoc->GetName(0, aName);
+ CPPUNIT_ASSERT_MESSAGE("sheets should have changed places", aName.EqualsAscii("TestTab1"));
+
+ m_pDoc->SetRowHidden(5, 10, 0, true);
+ bHidden = m_pDoc->RowHidden(0, 0, &nRow1, &nRow2);
+ CPPUNIT_ASSERT_MESSAGE("rows 0 - 4 should be visible", !bHidden && nRow1 == 0 && nRow2 == 4);
+ bHidden = m_pDoc->RowHidden(5, 0, &nRow1, &nRow2);
+ CPPUNIT_ASSERT_MESSAGE("rows 5 - 10 should be hidden", bHidden && nRow1 == 5 && nRow2 == 10);
+ bHidden = m_pDoc->RowHidden(11, 0, &nRow1, &nRow2);
+ CPPUNIT_ASSERT_MESSAGE("rows 11 - maxrow should be visible", !bHidden && nRow1 == 11 && nRow2 == MAXROW);
+
+ // Move the sheet once again.
+ m_pDoc->MoveTab(1, 0);
+ CPPUNIT_ASSERT_MESSAGE("document now should have two sheets.", m_pDoc->GetTableCount() == 2);
+ bHidden = m_pDoc->RowHidden(0, 1, &nRow1, &nRow2);
+ CPPUNIT_ASSERT_MESSAGE("rows 0 - 4 should be visible", !bHidden && nRow1 == 0 && nRow2 == 4);
+ bHidden = m_pDoc->RowHidden(5, 1, &nRow1, &nRow2);
+ CPPUNIT_ASSERT_MESSAGE("rows 5 - 10 should be hidden", bHidden && nRow1 == 5 && nRow2 == 10);
+ bHidden = m_pDoc->RowHidden(11, 1, &nRow1, &nRow2);
+ CPPUNIT_ASSERT_MESSAGE("rows 11 - maxrow should be visible", !bHidden && nRow1 == 11 && nRow2 == MAXROW);
+ m_pDoc->GetName(0, aName);
+ CPPUNIT_ASSERT_MESSAGE("sheets should have changed places", aName.EqualsAscii("TestTab2"));
+ m_pDoc->DeleteTab(1);
m_pDoc->DeleteTab(0);
}
--
1.7.2.5
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