diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-10-13 08:42:33 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-10-15 04:54:11 +0200 |
commit | aa7500f2231c383e4fd49e94757faccacdde1185 (patch) | |
tree | ff2c2f4bd8654cb4e0a6641bb98ad238fc339c78 /sc/qa | |
parent | 8fb84ee62409dec8eb02982c9cf78fb42bf1747e (diff) |
add a unit test for removing rows/columns with comments
Change-Id: I91d9abdc61f75ba080e092dc9b4e18bdb89b3705
Diffstat (limited to 'sc/qa')
-rw-r--r-- | sc/qa/unit/ucalc.cxx | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 8eef4104ec99..a5e3a07c010c 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -225,6 +225,8 @@ public: void testFindAreaPosColRight(); void testSort(); void testSortWithFormulaRefs(); + void testDeleteRow(); + void testDeleteCol(); CPPUNIT_TEST_SUITE(Test); CPPUNIT_TEST(testCollator); @@ -275,6 +277,8 @@ public: CPPUNIT_TEST(testFindAreaPosColRight); CPPUNIT_TEST(testSort); CPPUNIT_TEST(testSortWithFormulaRefs); + CPPUNIT_TEST(testDeleteRow); + CPPUNIT_TEST(testDeleteCol); CPPUNIT_TEST_SUITE_END(); private: @@ -5030,6 +5034,44 @@ void Test::testSort() pDoc->DeleteTab(0); } +void Test::testDeleteRow() +{ + ScDocument* pDoc = m_xDocShRef->GetDocument(); + rtl::OUString aSheet1("Sheet1"); + pDoc->InsertTab(0, aSheet1); + + 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); + + pDoc->DeleteRow(0, 0, MAXCOL, 0, 1, 1); + + CPPUNIT_ASSERT(m_pDoc->GetNotes(0)->empty()); + pDoc->DeleteTab(0); +} + +void Test::testDeleteCol() +{ + ScDocument* pDoc = m_xDocShRef->GetDocument(); + rtl::OUString aSheet1("Sheet1"); + pDoc->InsertTab(0, aSheet1); + + 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); + + pDoc->DeleteCol(0, 0, MAXROW, 0, 1, 1); + + CPPUNIT_ASSERT(m_pDoc->GetNotes(0)->empty()); + pDoc->DeleteTab(0); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); } |