nss: upgrade to release 3.73
[LibreOffice.git] / sc / qa / unit / rangelst_test.cxx
blob4239cc91e8a909f440da1e2d347437ab3b7b5f49
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
10 #include <sal/config.h>
11 #include <test/bootstrapfixture.hxx>
12 #include <docsh.hxx>
13 #include <scdll.hxx>
15 #include <rangelst.hxx>
17 class Test : public test::BootstrapFixture
19 public:
20 Test()
21 : m_pDoc(nullptr)
25 virtual void setUp() override;
26 virtual void tearDown() override;
28 void testDeleteArea_4Ranges();
29 void testDeleteArea_3Ranges();
30 void testDeleteArea_3Ranges_Case2();
31 void testDeleteArea_3Ranges_Case3();
32 void testDeleteArea_3Ranges_Case4();
33 void testDeleteArea_3Ranges_Case5();
34 void testDeleteArea_2Ranges();
35 void testDeleteArea_2Ranges_Case2();
36 void testDeleteArea_2Ranges_Case3();
37 void testDeleteArea_2Ranges_Case4();
38 void testDeleteArea_2Ranges_Case5();
39 void testDeleteArea_2Ranges_Case6();
40 void testDeleteArea_2Ranges_Case7();
41 void testDeleteArea_2Ranges_Case8();
42 void testDeleteArea_1Range();
43 void testDeleteArea_0Ranges();
44 void testJoin_Case1();
45 void testJoin_Case2();
46 void testJoin_Case3();
47 void testJoin_Case4();
48 void testJoin_Case5();
49 void testGetIntersectedRange();
51 void testUpdateReference_DeleteRow();
52 void testUpdateReference_DeleteLastRow();
53 void testUpdateReference_DeleteCol();
55 void testInsertRow();
56 void testInsertCol();
58 CPPUNIT_TEST_SUITE(Test);
59 CPPUNIT_TEST(testDeleteArea_4Ranges);
60 CPPUNIT_TEST(testDeleteArea_3Ranges);
61 CPPUNIT_TEST(testDeleteArea_3Ranges_Case2);
62 CPPUNIT_TEST(testDeleteArea_3Ranges_Case3);
63 CPPUNIT_TEST(testDeleteArea_3Ranges_Case4);
64 CPPUNIT_TEST(testDeleteArea_3Ranges_Case5);
65 CPPUNIT_TEST(testDeleteArea_2Ranges);
66 CPPUNIT_TEST(testDeleteArea_2Ranges_Case2);
67 CPPUNIT_TEST(testDeleteArea_2Ranges_Case3);
68 CPPUNIT_TEST(testDeleteArea_2Ranges_Case4);
69 CPPUNIT_TEST(testDeleteArea_2Ranges_Case5);
70 CPPUNIT_TEST(testDeleteArea_2Ranges_Case6);
71 CPPUNIT_TEST(testDeleteArea_2Ranges_Case7);
72 CPPUNIT_TEST(testDeleteArea_2Ranges_Case8);
73 CPPUNIT_TEST(testDeleteArea_1Range);
74 CPPUNIT_TEST(testDeleteArea_0Ranges);
75 CPPUNIT_TEST(testJoin_Case1);
76 CPPUNIT_TEST(testJoin_Case2);
77 CPPUNIT_TEST(testJoin_Case3);
78 CPPUNIT_TEST(testJoin_Case4);
79 CPPUNIT_TEST(testJoin_Case5);
80 CPPUNIT_TEST(testUpdateReference_DeleteRow);
81 CPPUNIT_TEST(testUpdateReference_DeleteLastRow);
82 CPPUNIT_TEST(testUpdateReference_DeleteCol);
83 CPPUNIT_TEST(testGetIntersectedRange);
84 CPPUNIT_TEST(testInsertRow);
85 CPPUNIT_TEST(testInsertCol);
86 CPPUNIT_TEST_SUITE_END();
88 private:
89 ScDocument *m_pDoc;
90 ScDocShellRef m_xDocShRef;
93 void Test::setUp()
95 BootstrapFixture::setUp();
97 ScDLL::Init();
98 m_xDocShRef = new ScDocShell(
99 SfxModelFlags::EMBEDDED_OBJECT |
100 SfxModelFlags::DISABLE_EMBEDDED_SCRIPTS |
101 SfxModelFlags::DISABLE_DOCUMENT_RECOVERY);
103 m_pDoc = &m_xDocShRef->GetDocument();
106 void Test::tearDown()
108 m_xDocShRef->DoClose();
109 m_xDocShRef.clear();
110 BootstrapFixture::tearDown();
113 void Test::testDeleteArea_4Ranges()
115 ScRangeList aList(ScRange(0,0,0,5,5,0));
116 aList.DeleteArea(2,2,0,3,3,0);
118 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(4), aList.size());
119 for(SCCOL nCol = 0; nCol <= 5; ++nCol)
121 for(SCROW nRow = 0; nRow <= 5; ++nRow)
123 if((nCol == 2 || nCol == 3) && ( nRow == 2 || nRow == 3))
124 CPPUNIT_ASSERT(!aList.In(ScRange(nCol, nRow, 0)));
125 else
126 CPPUNIT_ASSERT(aList.In(ScRange(nCol, nRow, 0)));
131 void Test::testDeleteArea_3Ranges()
133 ScRangeList aList(ScRange(1,1,0,6,6,0));
134 aList.DeleteArea(3,3,0,8,4,0);
136 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), aList.size());
137 for(SCCOL nCol = 1; nCol <= 6; ++nCol)
139 for(SCROW nRow = 1; nRow <= 6; ++nRow)
141 if((nRow == 3 || nRow == 4) && (nCol >= 3))
142 CPPUNIT_ASSERT(!aList.In(ScRange(nCol, nRow, 0)));
143 else
144 CPPUNIT_ASSERT(aList.In(ScRange(nCol, nRow, 0)));
148 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(28), aList.GetCellCount());
151 void Test::testDeleteArea_3Ranges_Case2()
153 ScRangeList aList(ScRange(1,1,0,6,6,0));
154 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aList.size());
155 aList.DeleteArea(0,2,0,2,4,0);
156 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), aList.size());
158 // Column 1-2 && Row 2-4 should not be in the range list. The rest should
159 // be in the list.
160 for (SCCOL nCol = 1; nCol <= 6; ++nCol)
162 for (SCROW nRow = 1; nRow <= 6; ++nRow)
164 if ((1 <= nCol && nCol <= 2) && (2 <= nRow && nRow <= 4))
165 CPPUNIT_ASSERT(!aList.In(ScRange(nCol, nRow, 0)));
166 else
167 CPPUNIT_ASSERT(aList.In(ScRange(nCol, nRow, 0)));
172 void Test::testDeleteArea_3Ranges_Case3()
174 ScRangeList aList(ScRange(1,5,0,6,11,0));
175 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aList.size());
176 aList.DeleteArea(3,2,0,4,8,0);
177 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), aList.size());
179 // Column 3-4 && Row 5-8 should not be in the range list.
180 for (SCCOL nCol = 1; nCol <= 6; ++nCol)
182 for (SCROW nRow = 5; nRow <= 11; ++nRow)
184 if ((3 <= nCol && nCol <= 4) && (5 <= nRow && nRow <= 8))
185 CPPUNIT_ASSERT(!aList.In(ScRange(nCol, nRow, 0)));
186 else
187 CPPUNIT_ASSERT(aList.In(ScRange(nCol, nRow, 0)));
192 void Test::testDeleteArea_3Ranges_Case4()
194 ScRangeList aList(ScRange(1,5,0,6,11,0));
195 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aList.size());
196 aList.DeleteArea(3,5,0,4,5,0);
197 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), aList.size());
199 // Column 3-4 && Row 5 should not be in the range list.
200 for (SCCOL nCol = 1; nCol <= 6; ++nCol)
202 for (SCROW nRow = 5; nRow <= 11; ++nRow)
204 if ((3 <= nCol && nCol <= 4) && 5 == nRow )
205 CPPUNIT_ASSERT(!aList.In(ScRange(nCol, nRow, 0)));
206 else
207 CPPUNIT_ASSERT(aList.In(ScRange(nCol, nRow, 0)));
212 void Test::testDeleteArea_3Ranges_Case5()
214 ScRangeList aList(ScRange(1,5,0,6,11,0));
215 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aList.size());
216 aList.DeleteArea(6,7,0,6,9,0);
217 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), aList.size());
219 // Column 6 && Row 7-9 should not be in the range list.
220 for (SCCOL nCol = 1; nCol <= 6; ++nCol)
222 for (SCROW nRow = 5; nRow <= 11; ++nRow)
224 if ( nCol == 6 && (7 <= nRow && nRow <= 9))
225 CPPUNIT_ASSERT(!aList.In(ScRange(nCol, nRow, 0)));
226 else
227 CPPUNIT_ASSERT(aList.In(ScRange(nCol, nRow, 0)));
232 void Test::testDeleteArea_2Ranges()
234 ScRangeList aList(ScRange(0,0,0,5,5,5));
235 ScRangeList aList2(aList);
237 aList.DeleteArea(4,4,0,6,7,0);
238 aList2.DeleteArea(4,4,0,6,7,0);
239 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), aList.size());
240 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), aList2.size());
242 for(SCCOL nCol = 0; nCol <= 5; ++nCol)
244 for(SCROW nRow = 0; nRow <= 5; ++nRow)
246 if(nCol>=4 && nRow >= 4)
247 CPPUNIT_ASSERT(!aList.In(ScRange(nCol, nRow, 0)));
248 else
249 CPPUNIT_ASSERT(aList.In(ScRange(nCol, nRow, 0)));
254 void Test::testDeleteArea_2Ranges_Case2()
256 ScRangeList aList(ScRange(1,1,0,1,5,0));
257 aList.DeleteArea(0,3,0,MAXCOL,3,0);
259 for(SCROW nRow = 1; nRow <= 5; ++nRow)
261 if(nRow == 3)
262 CPPUNIT_ASSERT(!aList.In(ScRange(1,3,0)));
263 else
264 CPPUNIT_ASSERT(aList.In(ScRange(1,nRow,0)));
266 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(4), aList.GetCellCount());
269 void Test::testDeleteArea_2Ranges_Case3()
271 ScRangeList aList(ScRange(0,5,0,2,10,0));
272 aList.DeleteArea(2,3,0,3,7,0);
273 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), aList.size());
275 // Column 2 Row 5-7 shouldn't be in the list.
276 for (SCCOL nCol = 0; nCol <= 2; ++nCol)
278 for (SCROW nRow = 5; nRow <= 10; ++nRow)
280 if (nCol == 2 && (5 <= nRow && nRow <= 7))
281 CPPUNIT_ASSERT(!aList.In(ScRange(nCol,nRow,0)));
282 else
283 CPPUNIT_ASSERT(aList.In(ScRange(nCol,nRow,0)));
288 void Test::testDeleteArea_2Ranges_Case4()
290 ScRangeList aList(ScRange(2,3,0,4,7,0));
291 aList.DeleteArea(0,1,0,2,5,0);
292 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), aList.size());
294 // Column 2 Row 3-5 shouldn't be in the list.
295 for (SCCOL nCol = 2; nCol <= 4; ++nCol)
297 for (SCROW nRow = 3; nRow <= 7; ++nRow)
299 if (nCol == 2 && (3 <= nRow && nRow <= 5))
300 CPPUNIT_ASSERT(!aList.In(ScRange(nCol,nRow,0)));
301 else
302 CPPUNIT_ASSERT(aList.In(ScRange(nCol,nRow,0)));
307 void Test::testDeleteArea_2Ranges_Case5()
309 ScRangeList aList(ScRange(2,2,0,5,5,0));
310 aList.DeleteArea(4,5,0,5,5,0);
311 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), aList.size());
313 // Column 4 and 5 Row 5 shouldn't be in the list.
314 for(SCCOL nCol = 2; nCol <= 5; ++nCol)
316 for(SCROW nRow = 2; nRow <= 5; ++nRow)
318 if(nRow == 5 && 4 <= nCol)
319 CPPUNIT_ASSERT(!aList.In(ScRange(nCol, nRow, 0)));
320 else
321 CPPUNIT_ASSERT(aList.In(ScRange(nCol, nRow, 0)));
326 void Test::testDeleteArea_2Ranges_Case6()
328 ScRangeList aList(ScRange(2,2,0,5,5,0));
329 aList.DeleteArea(4,2,0,5,2,0);
330 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), aList.size());
332 // Column 4 and 5 Row 2 shouldn't be in the list.
333 for(SCCOL nCol = 2; nCol <= 5; ++nCol)
335 for(SCROW nRow = 2; nRow <= 5; ++nRow)
337 if(nRow == 2 && 4 <= nCol)
338 CPPUNIT_ASSERT(!aList.In(ScRange(nCol, nRow, 0)));
339 else
340 CPPUNIT_ASSERT(aList.In(ScRange(nCol, nRow, 0)));
345 void Test::testDeleteArea_2Ranges_Case7()
347 ScRangeList aList(ScRange(2,2,0,5,5,0));
348 aList.DeleteArea(2,5,0,2,5,0);
349 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), aList.size());
351 // Column 2 Row 5 shouldn't be in the list.
352 for(SCCOL nCol = 2; nCol <= 5; ++nCol)
354 for(SCROW nRow = 2; nRow <= 5; ++nRow)
356 if(nRow == 5 && nCol == 2)
357 CPPUNIT_ASSERT(!aList.In(ScRange(nCol, nRow, 0)));
358 else
359 CPPUNIT_ASSERT(aList.In(ScRange(nCol, nRow, 0)));
364 void Test::testDeleteArea_2Ranges_Case8()
366 ScRangeList aList(ScRange(2,2,0,5,5,0));
367 aList.DeleteArea(2,2,0,3,2,0);
368 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), aList.size());
370 // Column 2 & 3 Row 2 shouldn't be in the list.
371 for(SCCOL nCol = 2; nCol <= 5; ++nCol)
373 for(SCROW nRow = 2; nRow <= 5; ++nRow)
375 if(nRow == 2 && nCol <= 3)
376 CPPUNIT_ASSERT(!aList.In(ScRange(nCol, nRow, 0)));
377 else
378 CPPUNIT_ASSERT(aList.In(ScRange(nCol, nRow, 0)));
383 void Test::testDeleteArea_1Range()
385 ScRangeList aList(ScRange(1,1,0,3,3,0));
386 aList.DeleteArea(1,1,0,2,3,0);
388 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aList.size());
390 for(SCROW nRow = 1; nRow <= 3; ++nRow)
392 CPPUNIT_ASSERT(aList.In(ScRange(3,nRow,0)));
394 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), aList.GetCellCount());
397 void Test::testDeleteArea_0Ranges()
399 ScRangeList aList(ScRange(1,1,0,3,3,0));
400 aList.DeleteArea(1,1,0,3,3,0);
402 CPPUNIT_ASSERT(aList.empty());
404 ScRangeList aList2(ScRange(1,1,0,3,3,0));
405 aList2.DeleteArea(0,0,0,4,4,0);
407 CPPUNIT_ASSERT(aList.empty());
410 void Test::testJoin_Case1()
412 ScRangeList aList;
413 aList.push_back(ScRange(1,1,0,3,3,0));
414 aList.Join(ScRange(4,1,0,6,3,0));
416 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aList.size());
417 CPPUNIT_ASSERT_EQUAL( ScRange(1,1,0,6,3,0), aList[0]);
420 void Test::testJoin_Case2()
422 ScRangeList aList;
423 aList.push_back(ScRange(1,1,0,3,3,0));
424 aList.push_back(ScRange(4,1,0,6,3,0));
425 aList.push_back(ScRange(7,1,0,9,3,0));
427 aList.Join(aList[2], true);
429 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aList.size());
430 CPPUNIT_ASSERT_EQUAL(ScRange(1,1,0,9,3,0), aList[0]);
433 void Test::testJoin_Case3()
435 ScRangeList aList;
436 aList.Join(ScRange(1,1,0,6,6,0));
437 aList.Join(ScRange(3,3,0,4,4,0));
439 // The second one should have been swallowed by the first one
440 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aList.size());
441 CPPUNIT_ASSERT_EQUAL(ScRange(1,1,0,6,6,0), aList[0]);
443 // Add a disjoint one
444 aList.Join(ScRange(8,8,0,9,9,0));
446 // Should be two ones now
447 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), aList.size());
448 // The first one should still be as is
449 CPPUNIT_ASSERT_EQUAL(ScRange(1,1,0,6,6,0), aList[0]);
450 // Ditto for the second one
451 CPPUNIT_ASSERT_EQUAL(ScRange(8,8,0,9,9,0), aList[1]);
454 void Test::testJoin_Case4()
456 ScRangeList aList;
457 aList.Join(ScRange(1,1,0,2,6,0));
458 // Join a range that overlaps it and extends it vertically
459 aList.Join(ScRange(1,4,0,2,8,0));
461 // The one range in the list should have been extended
462 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aList.size());
463 CPPUNIT_ASSERT_EQUAL(ScRange(1,1,0,2,8,0), aList[0]);
465 // Join a range that overlaps it and extends it horizontally
466 aList.Join(ScRange(2,1,0,4,8,0));
468 // Again, should have just been extended
469 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aList.size());
470 CPPUNIT_ASSERT_EQUAL(ScRange(1,1,0,4,8,0), aList[0]);
472 // And then the same but on top / to the left of existing range
473 ScRangeList aList2;
474 aList2.Join(ScRange(4,4,0,8,8,0));
475 aList2.Join(ScRange(4,1,0,8,6,0));
477 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aList2.size());
478 CPPUNIT_ASSERT_EQUAL(ScRange(4,1,0,8,8,0), aList2[0]);
480 aList2.Join(ScRange(1,1,0,6,8,0));
482 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aList2.size());
483 CPPUNIT_ASSERT_EQUAL(ScRange(1,1,0,8,8,0), aList2[0]);
486 void Test::testJoin_Case5()
488 ScRangeList aList;
489 aList.Join(ScRange(0,0,0,4,4,0));
490 aList.Join(ScRange(8,0,0,10,4,0));
492 // Nothing special so far, two disjoint ranges
493 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), aList.size());
494 CPPUNIT_ASSERT_EQUAL(ScRange(0,0,0,4,4,0), aList[0]);
495 CPPUNIT_ASSERT_EQUAL(ScRange(8,0,0,10,4,0), aList[1]);
497 // This should join the two ranges into one
498 aList.Join(ScRange(5,0,0,9,4,0));
500 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aList.size());
501 CPPUNIT_ASSERT_EQUAL(ScRange(0,0,0,10,4,0), aList[0]);
504 void Test::testUpdateReference_DeleteRow()
506 ScRangeList aList(ScRange(1,1,0,4,4,0));
507 bool bUpdated = aList.UpdateReference(URM_INSDEL, m_pDoc, ScRange(0,3,0,MAXCOL,MAXROW,0), 0, -1, 0);
508 CPPUNIT_ASSERT(bUpdated);
510 for(SCCOL nCol = 1; nCol <= 4; ++nCol)
512 for(SCROW nRow = 1; nRow <= 3; ++nRow)
514 CPPUNIT_ASSERT(aList.In(ScRange(nCol, nRow, 0)));
516 CPPUNIT_ASSERT(!aList.In(ScRange(nCol, 4, 0)));
518 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(12), aList.GetCellCount());
520 ScRangeList aList2(ScRange(2,2,0,2,2,0));
521 aList2.UpdateReference(URM_INSDEL, m_pDoc, ScRange(0,3,0,MAXCOL,MAXROW,0), 0, -1, 0);
522 CPPUNIT_ASSERT(aList2.empty());
524 ScRangeList aList3;
525 aList3.push_back(ScRange(2,2,0,2,8,0));
526 aList3.push_back(ScRange(4,2,0,4,8,0));
527 aList3.UpdateReference(URM_INSDEL, m_pDoc, ScRange(2,5,0,MAXCOL,MAXROW,0), 0, -1, 0);
528 // Verify all ranges in the list have been updated properly.
529 CPPUNIT_ASSERT_EQUAL(size_t(2), aList3.size());
530 CPPUNIT_ASSERT_EQUAL(ScRange(2,2,0,2,7,0), aList3[0]);
531 CPPUNIT_ASSERT_EQUAL(ScRange(4,2,0,4,7,0), aList3[1]);
533 ScRangeList aList4(ScRange(0,0,0,MAXCOL,MAXROW,0));
534 ScRangeList aList4Copy = aList4;
535 aList4.UpdateReference(URM_INSDEL, m_pDoc, ScRange(14,3,0,MAXCOL,7,0), 0, -2, 0);
536 CPPUNIT_ASSERT_EQUAL(aList4Copy, aList4);
539 void Test::testUpdateReference_DeleteLastRow()
541 ScRangeList aList(ScRange(1,1,0,4,4,0));
542 bool bUpdated = aList.UpdateReference(URM_INSDEL, m_pDoc, ScRange(0,4,0,MAXCOL,4,0), 0, -1, 0);
543 CPPUNIT_ASSERT(bUpdated);
546 void Test::testUpdateReference_DeleteCol()
548 ScRangeList aList(ScRange(1,1,0,4,4,0));
549 bool bUpdated = aList.UpdateReference(URM_INSDEL, m_pDoc, ScRange(3,0,0,MAXCOL,MAXROW,0), -1, 0, 0);
550 CPPUNIT_ASSERT(bUpdated);
552 for(SCROW nRow = 1; nRow <= 4; ++nRow)
554 for(SCCOL nCol = 1; nCol <= 3; ++nCol)
556 CPPUNIT_ASSERT(aList.In(ScRange(nCol, nRow, 0)));
558 CPPUNIT_ASSERT(!aList.In(ScRange(4, nRow, 0)));
560 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(12), aList.GetCellCount());
563 void Test::testGetIntersectedRange()
565 ScRangeList aList(ScRange(2, 2, 0, 5, 5, 0));
566 ScRangeList aIntersecting = aList.GetIntersectedRange(ScRange(0, 0, 0, 3, 3, 0));
567 CPPUNIT_ASSERT_EQUAL(ScRangeList(ScRange(2,2,0,3,3,0)), aIntersecting);
570 void Test::testInsertRow()
572 ScRangeList aList(ScRange(1,1,0,4,4,0));
573 aList.InsertRow(0, 0, MAXCOL, 5, 2);
574 CPPUNIT_ASSERT_EQUAL(ScRangeList(ScRange(1,1,0,4,6,0)), aList);
577 void Test::testInsertCol()
579 ScRangeList aList(ScRange(1,1,0,4,4,0));
580 aList.InsertCol(0, 0, MAXROW, 5, 2);
581 CPPUNIT_ASSERT_EQUAL(ScRangeList(ScRange(1,1,0,6,4,0)), aList);
584 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
586 CPPUNIT_PLUGIN_IMPLEMENT();
587 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */