summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-09-18 06:18:11 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-09-18 06:22:19 +0200
commit01e63352677242ca6915cc37601c4f8b0a49881c (patch)
tree1e122941e35d5e48fcd7cac5a9ff4595e6273a8a
parent5f0b2c26ce6854463577058ee1d84fefd1889b2c (diff)
and another test for ScRangeList::DeleteArea
Change-Id: I1fa81b32f9ffc70769876becbcf213796cab405b
-rw-r--r--sc/qa/unit/rangelst_test.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/sc/qa/unit/rangelst_test.cxx b/sc/qa/unit/rangelst_test.cxx
index a2289b692a92..b447dc18de73 100644
--- a/sc/qa/unit/rangelst_test.cxx
+++ b/sc/qa/unit/rangelst_test.cxx
@@ -88,6 +88,21 @@ void Test::testDeleteArea_4Ranges()
void Test::testDeleteArea_3Ranges()
{
ScRangeList aList(ScRange(1,1,0,6,6,0));
+ aList.DeleteArea(3,3,0,8,4,0);
+
+ CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), aList.size());
+ for(SCCOL nCol = 1; nCol <= 6; ++nCol)
+ {
+ for(SCROW nRow = 1; nRow <= 6; ++nRow)
+ {
+ if((nRow == 3 || nRow == 4) && (nCol >= 3))
+ CPPUNIT_ASSERT(!aList.In(ScRange(nCol, nRow, 0)));
+ else
+ CPPUNIT_ASSERT(aList.In(ScRange(nCol, nRow, 0)));
+ }
+ }
+
+ CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(28), aList.GetCellCount());
}
void Test::testDeleteArea_2Ranges()