1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
10 #include <sal/config.h>
11 #include "helper/qahelper.hxx"
14 #include <rangelst.hxx>
16 class Test
: public ScUcalcTestBase
19 void testDeleteArea_4Ranges();
20 void testDeleteArea_3Ranges();
21 void testDeleteArea_3Ranges_Case2();
22 void testDeleteArea_3Ranges_Case3();
23 void testDeleteArea_3Ranges_Case4();
24 void testDeleteArea_3Ranges_Case5();
25 void testDeleteArea_2Ranges();
26 void testDeleteArea_2Ranges_Case2();
27 void testDeleteArea_2Ranges_Case3();
28 void testDeleteArea_2Ranges_Case4();
29 void testDeleteArea_2Ranges_Case5();
30 void testDeleteArea_2Ranges_Case6();
31 void testDeleteArea_2Ranges_Case7();
32 void testDeleteArea_2Ranges_Case8();
33 void testDeleteArea_1Range();
34 void testDeleteArea_0Ranges();
35 void testJoin_Case1();
36 void testJoin_Case2();
37 void testJoin_Case3();
38 void testJoin_Case4();
39 void testJoin_Case5();
40 void testGetIntersectedRange();
42 void testUpdateReference_DeleteRow();
43 void testUpdateReference_DeleteLastRow();
44 void testUpdateReference_DeleteCol();
49 CPPUNIT_TEST_SUITE(Test
);
50 CPPUNIT_TEST(testDeleteArea_4Ranges
);
51 CPPUNIT_TEST(testDeleteArea_3Ranges
);
52 CPPUNIT_TEST(testDeleteArea_3Ranges_Case2
);
53 CPPUNIT_TEST(testDeleteArea_3Ranges_Case3
);
54 CPPUNIT_TEST(testDeleteArea_3Ranges_Case4
);
55 CPPUNIT_TEST(testDeleteArea_3Ranges_Case5
);
56 CPPUNIT_TEST(testDeleteArea_2Ranges
);
57 CPPUNIT_TEST(testDeleteArea_2Ranges_Case2
);
58 CPPUNIT_TEST(testDeleteArea_2Ranges_Case3
);
59 CPPUNIT_TEST(testDeleteArea_2Ranges_Case4
);
60 CPPUNIT_TEST(testDeleteArea_2Ranges_Case5
);
61 CPPUNIT_TEST(testDeleteArea_2Ranges_Case6
);
62 CPPUNIT_TEST(testDeleteArea_2Ranges_Case7
);
63 CPPUNIT_TEST(testDeleteArea_2Ranges_Case8
);
64 CPPUNIT_TEST(testDeleteArea_1Range
);
65 CPPUNIT_TEST(testDeleteArea_0Ranges
);
66 CPPUNIT_TEST(testJoin_Case1
);
67 CPPUNIT_TEST(testJoin_Case2
);
68 CPPUNIT_TEST(testJoin_Case3
);
69 CPPUNIT_TEST(testJoin_Case4
);
70 CPPUNIT_TEST(testJoin_Case5
);
71 CPPUNIT_TEST(testUpdateReference_DeleteRow
);
72 CPPUNIT_TEST(testUpdateReference_DeleteLastRow
);
73 CPPUNIT_TEST(testUpdateReference_DeleteCol
);
74 CPPUNIT_TEST(testGetIntersectedRange
);
75 CPPUNIT_TEST(testInsertRow
);
76 CPPUNIT_TEST(testInsertCol
);
77 CPPUNIT_TEST_SUITE_END();
80 void Test::testDeleteArea_4Ranges()
82 ScRangeList
aList(ScRange(0,0,0,5,5,0));
83 aList
.DeleteArea(2,2,0,3,3,0);
85 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(4), aList
.size());
86 for(SCCOL nCol
= 0; nCol
<= 5; ++nCol
)
88 for(SCROW nRow
= 0; nRow
<= 5; ++nRow
)
90 if((nCol
== 2 || nCol
== 3) && ( nRow
== 2 || nRow
== 3))
91 CPPUNIT_ASSERT(!aList
.Contains(ScRange(nCol
, nRow
, 0)));
93 CPPUNIT_ASSERT(aList
.Contains(ScRange(nCol
, nRow
, 0)));
98 void Test::testDeleteArea_3Ranges()
100 ScRangeList
aList(ScRange(1,1,0,6,6,0));
101 aList
.DeleteArea(3,3,0,8,4,0);
103 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), aList
.size());
104 for(SCCOL nCol
= 1; nCol
<= 6; ++nCol
)
106 for(SCROW nRow
= 1; nRow
<= 6; ++nRow
)
108 if((nRow
== 3 || nRow
== 4) && (nCol
>= 3))
109 CPPUNIT_ASSERT(!aList
.Contains(ScRange(nCol
, nRow
, 0)));
111 CPPUNIT_ASSERT(aList
.Contains(ScRange(nCol
, nRow
, 0)));
115 CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt64
>(28), aList
.GetCellCount());
118 void Test::testDeleteArea_3Ranges_Case2()
120 ScRangeList
aList(ScRange(1,1,0,6,6,0));
121 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aList
.size());
122 aList
.DeleteArea(0,2,0,2,4,0);
123 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), aList
.size());
125 // Column 1-2 && Row 2-4 should not be in the range list. The rest should
127 for (SCCOL nCol
= 1; nCol
<= 6; ++nCol
)
129 for (SCROW nRow
= 1; nRow
<= 6; ++nRow
)
131 if ((1 <= nCol
&& nCol
<= 2) && (2 <= nRow
&& nRow
<= 4))
132 CPPUNIT_ASSERT(!aList
.Contains(ScRange(nCol
, nRow
, 0)));
134 CPPUNIT_ASSERT(aList
.Contains(ScRange(nCol
, nRow
, 0)));
139 void Test::testDeleteArea_3Ranges_Case3()
141 ScRangeList
aList(ScRange(1,5,0,6,11,0));
142 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aList
.size());
143 aList
.DeleteArea(3,2,0,4,8,0);
144 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), aList
.size());
146 // Column 3-4 && Row 5-8 should not be in the range list.
147 for (SCCOL nCol
= 1; nCol
<= 6; ++nCol
)
149 for (SCROW nRow
= 5; nRow
<= 11; ++nRow
)
151 if ((3 <= nCol
&& nCol
<= 4) && (5 <= nRow
&& nRow
<= 8))
152 CPPUNIT_ASSERT(!aList
.Contains(ScRange(nCol
, nRow
, 0)));
154 CPPUNIT_ASSERT(aList
.Contains(ScRange(nCol
, nRow
, 0)));
159 void Test::testDeleteArea_3Ranges_Case4()
161 ScRangeList
aList(ScRange(1,5,0,6,11,0));
162 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aList
.size());
163 aList
.DeleteArea(3,5,0,4,5,0);
164 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), aList
.size());
166 // Column 3-4 && Row 5 should not be in the range list.
167 for (SCCOL nCol
= 1; nCol
<= 6; ++nCol
)
169 for (SCROW nRow
= 5; nRow
<= 11; ++nRow
)
171 if ((3 <= nCol
&& nCol
<= 4) && 5 == nRow
)
172 CPPUNIT_ASSERT(!aList
.Contains(ScRange(nCol
, nRow
, 0)));
174 CPPUNIT_ASSERT(aList
.Contains(ScRange(nCol
, nRow
, 0)));
179 void Test::testDeleteArea_3Ranges_Case5()
181 ScRangeList
aList(ScRange(1,5,0,6,11,0));
182 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aList
.size());
183 aList
.DeleteArea(6,7,0,6,9,0);
184 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), aList
.size());
186 // Column 6 && Row 7-9 should not be in the range list.
187 for (SCCOL nCol
= 1; nCol
<= 6; ++nCol
)
189 for (SCROW nRow
= 5; nRow
<= 11; ++nRow
)
191 if ( nCol
== 6 && (7 <= nRow
&& nRow
<= 9))
192 CPPUNIT_ASSERT(!aList
.Contains(ScRange(nCol
, nRow
, 0)));
194 CPPUNIT_ASSERT(aList
.Contains(ScRange(nCol
, nRow
, 0)));
199 void Test::testDeleteArea_2Ranges()
201 ScRangeList
aList(ScRange(0,0,0,5,5,5));
202 ScRangeList
aList2(aList
);
204 aList
.DeleteArea(4,4,0,6,7,0);
205 aList2
.DeleteArea(4,4,0,6,7,0);
206 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), aList
.size());
207 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), aList2
.size());
209 for(SCCOL nCol
= 0; nCol
<= 5; ++nCol
)
211 for(SCROW nRow
= 0; nRow
<= 5; ++nRow
)
213 if(nCol
>=4 && nRow
>= 4)
214 CPPUNIT_ASSERT(!aList
.Contains(ScRange(nCol
, nRow
, 0)));
216 CPPUNIT_ASSERT(aList
.Contains(ScRange(nCol
, nRow
, 0)));
221 void Test::testDeleteArea_2Ranges_Case2()
223 ScRangeList
aList(ScRange(1,1,0,1,5,0));
224 aList
.DeleteArea(0,3,0,ScSheetLimits::CreateDefault().MaxCol(),3,0);
226 for(SCROW nRow
= 1; nRow
<= 5; ++nRow
)
229 CPPUNIT_ASSERT(!aList
.Contains(ScRange(1,3,0)));
231 CPPUNIT_ASSERT(aList
.Contains(ScRange(1,nRow
,0)));
233 CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt64
>(4), aList
.GetCellCount());
236 void Test::testDeleteArea_2Ranges_Case3()
238 ScRangeList
aList(ScRange(0,5,0,2,10,0));
239 aList
.DeleteArea(2,3,0,3,7,0);
240 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), aList
.size());
242 // Column 2 Row 5-7 shouldn't be in the list.
243 for (SCCOL nCol
= 0; nCol
<= 2; ++nCol
)
245 for (SCROW nRow
= 5; nRow
<= 10; ++nRow
)
247 if (nCol
== 2 && (5 <= nRow
&& nRow
<= 7))
248 CPPUNIT_ASSERT(!aList
.Contains(ScRange(nCol
,nRow
,0)));
250 CPPUNIT_ASSERT(aList
.Contains(ScRange(nCol
,nRow
,0)));
255 void Test::testDeleteArea_2Ranges_Case4()
257 ScRangeList
aList(ScRange(2,3,0,4,7,0));
258 aList
.DeleteArea(0,1,0,2,5,0);
259 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), aList
.size());
261 // Column 2 Row 3-5 shouldn't be in the list.
262 for (SCCOL nCol
= 2; nCol
<= 4; ++nCol
)
264 for (SCROW nRow
= 3; nRow
<= 7; ++nRow
)
266 if (nCol
== 2 && (3 <= nRow
&& nRow
<= 5))
267 CPPUNIT_ASSERT(!aList
.Contains(ScRange(nCol
,nRow
,0)));
269 CPPUNIT_ASSERT(aList
.Contains(ScRange(nCol
,nRow
,0)));
274 void Test::testDeleteArea_2Ranges_Case5()
276 ScRangeList
aList(ScRange(2,2,0,5,5,0));
277 aList
.DeleteArea(4,5,0,5,5,0);
278 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), aList
.size());
280 // Column 4 and 5 Row 5 shouldn't be in the list.
281 for(SCCOL nCol
= 2; nCol
<= 5; ++nCol
)
283 for(SCROW nRow
= 2; nRow
<= 5; ++nRow
)
285 if(nRow
== 5 && 4 <= nCol
)
286 CPPUNIT_ASSERT(!aList
.Contains(ScRange(nCol
, nRow
, 0)));
288 CPPUNIT_ASSERT(aList
.Contains(ScRange(nCol
, nRow
, 0)));
293 void Test::testDeleteArea_2Ranges_Case6()
295 ScRangeList
aList(ScRange(2,2,0,5,5,0));
296 aList
.DeleteArea(4,2,0,5,2,0);
297 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), aList
.size());
299 // Column 4 and 5 Row 2 shouldn't be in the list.
300 for(SCCOL nCol
= 2; nCol
<= 5; ++nCol
)
302 for(SCROW nRow
= 2; nRow
<= 5; ++nRow
)
304 if(nRow
== 2 && 4 <= nCol
)
305 CPPUNIT_ASSERT(!aList
.Contains(ScRange(nCol
, nRow
, 0)));
307 CPPUNIT_ASSERT(aList
.Contains(ScRange(nCol
, nRow
, 0)));
312 void Test::testDeleteArea_2Ranges_Case7()
314 ScRangeList
aList(ScRange(2,2,0,5,5,0));
315 aList
.DeleteArea(2,5,0,2,5,0);
316 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), aList
.size());
318 // Column 2 Row 5 shouldn't be in the list.
319 for(SCCOL nCol
= 2; nCol
<= 5; ++nCol
)
321 for(SCROW nRow
= 2; nRow
<= 5; ++nRow
)
323 if(nRow
== 5 && nCol
== 2)
324 CPPUNIT_ASSERT(!aList
.Contains(ScRange(nCol
, nRow
, 0)));
326 CPPUNIT_ASSERT(aList
.Contains(ScRange(nCol
, nRow
, 0)));
331 void Test::testDeleteArea_2Ranges_Case8()
333 ScRangeList
aList(ScRange(2,2,0,5,5,0));
334 aList
.DeleteArea(2,2,0,3,2,0);
335 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), aList
.size());
337 // Column 2 & 3 Row 2 shouldn't be in the list.
338 for(SCCOL nCol
= 2; nCol
<= 5; ++nCol
)
340 for(SCROW nRow
= 2; nRow
<= 5; ++nRow
)
342 if(nRow
== 2 && nCol
<= 3)
343 CPPUNIT_ASSERT(!aList
.Contains(ScRange(nCol
, nRow
, 0)));
345 CPPUNIT_ASSERT(aList
.Contains(ScRange(nCol
, nRow
, 0)));
350 void Test::testDeleteArea_1Range()
352 ScRangeList
aList(ScRange(1,1,0,3,3,0));
353 aList
.DeleteArea(1,1,0,2,3,0);
355 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aList
.size());
357 for(SCROW nRow
= 1; nRow
<= 3; ++nRow
)
359 CPPUNIT_ASSERT(aList
.Contains(ScRange(3,nRow
,0)));
361 CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt64
>(3), aList
.GetCellCount());
364 void Test::testDeleteArea_0Ranges()
366 ScRangeList
aList(ScRange(1,1,0,3,3,0));
367 aList
.DeleteArea(1,1,0,3,3,0);
369 CPPUNIT_ASSERT(aList
.empty());
371 ScRangeList
aList2(ScRange(1,1,0,3,3,0));
372 aList2
.DeleteArea(0,0,0,4,4,0);
374 CPPUNIT_ASSERT(aList
.empty());
377 void Test::testJoin_Case1()
380 aList
.push_back(ScRange(1,1,0,3,3,0));
381 aList
.Join(ScRange(4,1,0,6,3,0));
383 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aList
.size());
384 CPPUNIT_ASSERT_EQUAL( ScRange(1,1,0,6,3,0), aList
[0]);
387 void Test::testJoin_Case2()
390 aList
.push_back(ScRange(1,1,0,3,3,0));
391 aList
.push_back(ScRange(4,1,0,6,3,0));
392 aList
.push_back(ScRange(7,1,0,9,3,0));
394 aList
.Join(aList
[2], true);
396 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aList
.size());
397 CPPUNIT_ASSERT_EQUAL(ScRange(1,1,0,9,3,0), aList
[0]);
400 void Test::testJoin_Case3()
403 aList
.Join(ScRange(1,1,0,6,6,0));
404 aList
.Join(ScRange(3,3,0,4,4,0));
406 // The second one should have been swallowed by the first one
407 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aList
.size());
408 CPPUNIT_ASSERT_EQUAL(ScRange(1,1,0,6,6,0), aList
[0]);
410 // Add a disjoint one
411 aList
.Join(ScRange(8,8,0,9,9,0));
413 // Should be two ones now
414 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), aList
.size());
415 // The first one should still be as is
416 CPPUNIT_ASSERT_EQUAL(ScRange(1,1,0,6,6,0), aList
[0]);
417 // Ditto for the second one
418 CPPUNIT_ASSERT_EQUAL(ScRange(8,8,0,9,9,0), aList
[1]);
421 void Test::testJoin_Case4()
424 aList
.Join(ScRange(1,1,0,2,6,0));
425 // Join a range that overlaps it and extends it vertically
426 aList
.Join(ScRange(1,4,0,2,8,0));
428 // The one range in the list should have been extended
429 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aList
.size());
430 CPPUNIT_ASSERT_EQUAL(ScRange(1,1,0,2,8,0), aList
[0]);
432 // Join a range that overlaps it and extends it horizontally
433 aList
.Join(ScRange(2,1,0,4,8,0));
435 // Again, should have just been extended
436 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aList
.size());
437 CPPUNIT_ASSERT_EQUAL(ScRange(1,1,0,4,8,0), aList
[0]);
439 // And then the same but on top / to the left of existing range
441 aList2
.Join(ScRange(4,4,0,8,8,0));
442 aList2
.Join(ScRange(4,1,0,8,6,0));
444 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aList2
.size());
445 CPPUNIT_ASSERT_EQUAL(ScRange(4,1,0,8,8,0), aList2
[0]);
447 aList2
.Join(ScRange(1,1,0,6,8,0));
449 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aList2
.size());
450 CPPUNIT_ASSERT_EQUAL(ScRange(1,1,0,8,8,0), aList2
[0]);
453 void Test::testJoin_Case5()
456 aList
.Join(ScRange(0,0,0,4,4,0));
457 aList
.Join(ScRange(8,0,0,10,4,0));
459 // Nothing special so far, two disjoint ranges
460 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), aList
.size());
461 CPPUNIT_ASSERT_EQUAL(ScRange(0,0,0,4,4,0), aList
[0]);
462 CPPUNIT_ASSERT_EQUAL(ScRange(8,0,0,10,4,0), aList
[1]);
464 // This should join the two ranges into one
465 aList
.Join(ScRange(5,0,0,9,4,0));
467 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aList
.size());
468 CPPUNIT_ASSERT_EQUAL(ScRange(0,0,0,10,4,0), aList
[0]);
471 void Test::testUpdateReference_DeleteRow()
473 ScRangeList
aList(ScRange(1,1,0,4,4,0));
474 bool bUpdated
= aList
.UpdateReference(URM_INSDEL
, m_pDoc
, ScRange(0,3,0,m_pDoc
->MaxCol(),m_pDoc
->MaxRow(),0), 0, -1, 0);
475 CPPUNIT_ASSERT(bUpdated
);
477 for(SCCOL nCol
= 1; nCol
<= 4; ++nCol
)
479 for(SCROW nRow
= 1; nRow
<= 3; ++nRow
)
481 CPPUNIT_ASSERT(aList
.Contains(ScRange(nCol
, nRow
, 0)));
483 CPPUNIT_ASSERT(!aList
.Contains(ScRange(nCol
, 4, 0)));
485 CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt64
>(12), aList
.GetCellCount());
487 ScRangeList
aList2(ScRange(2,2,0,2,2,0));
488 aList2
.UpdateReference(URM_INSDEL
, m_pDoc
, ScRange(0,3,0,m_pDoc
->MaxCol(),m_pDoc
->MaxRow(),0), 0, -1, 0);
489 CPPUNIT_ASSERT(aList2
.empty());
492 aList3
.push_back(ScRange(2,2,0,2,8,0));
493 aList3
.push_back(ScRange(4,2,0,4,8,0));
494 aList3
.UpdateReference(URM_INSDEL
, m_pDoc
, ScRange(2,5,0,m_pDoc
->MaxCol(),m_pDoc
->MaxRow(),0), 0, -1, 0);
495 // Verify all ranges in the list have been updated properly.
496 CPPUNIT_ASSERT_EQUAL(size_t(2), aList3
.size());
497 CPPUNIT_ASSERT_EQUAL(ScRange(2,2,0,2,7,0), aList3
[0]);
498 CPPUNIT_ASSERT_EQUAL(ScRange(4,2,0,4,7,0), aList3
[1]);
500 ScRangeList
aList4(ScRange(0,0,0,m_pDoc
->MaxCol(),m_pDoc
->MaxRow(),0));
501 ScRangeList aList4Copy
= aList4
;
502 aList4
.UpdateReference(URM_INSDEL
, m_pDoc
, ScRange(14,3,0,m_pDoc
->MaxCol(),7,0), 0, -2, 0);
503 CPPUNIT_ASSERT_EQUAL(aList4Copy
, aList4
);
506 void Test::testUpdateReference_DeleteLastRow()
508 ScRangeList
aList(ScRange(1,1,0,4,4,0));
509 bool bUpdated
= aList
.UpdateReference(URM_INSDEL
, m_pDoc
, ScRange(0,4,0,m_pDoc
->MaxCol(),4,0), 0, -1, 0);
510 CPPUNIT_ASSERT(bUpdated
);
513 void Test::testUpdateReference_DeleteCol()
515 ScRangeList
aList(ScRange(1,1,0,4,4,0));
516 bool bUpdated
= aList
.UpdateReference(URM_INSDEL
, m_pDoc
, ScRange(3,0,0,m_pDoc
->MaxCol(),m_pDoc
->MaxRow(),0), -1, 0, 0);
517 CPPUNIT_ASSERT(bUpdated
);
519 for(SCROW nRow
= 1; nRow
<= 4; ++nRow
)
521 for(SCCOL nCol
= 1; nCol
<= 3; ++nCol
)
523 CPPUNIT_ASSERT(aList
.Contains(ScRange(nCol
, nRow
, 0)));
525 CPPUNIT_ASSERT(!aList
.Contains(ScRange(4, nRow
, 0)));
527 CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt64
>(12), aList
.GetCellCount());
530 void Test::testGetIntersectedRange()
532 ScRangeList
aList(ScRange(2, 2, 0, 5, 5, 0));
533 ScRangeList aIntersecting
= aList
.GetIntersectedRange(ScRange(0, 0, 0, 3, 3, 0));
534 CPPUNIT_ASSERT_EQUAL(ScRangeList(ScRange(2,2,0,3,3,0)), aIntersecting
);
537 void Test::testInsertRow()
539 ScRangeList
aList(ScRange(1,1,0,4,4,0));
540 aList
.InsertRow(0, 0, m_pDoc
->MaxCol(), 5, 2);
541 CPPUNIT_ASSERT_EQUAL(ScRangeList(ScRange(1,1,0,4,6,0)), aList
);
544 void Test::testInsertCol()
546 ScRangeList
aList(ScRange(1,1,0,4,4,0));
547 aList
.InsertCol(0, 0, m_pDoc
->MaxRow(), 5, 2);
548 CPPUNIT_ASSERT_EQUAL(ScRangeList(ScRange(1,1,0,6,4,0)), aList
);
551 CPPUNIT_TEST_SUITE_REGISTRATION(Test
);
553 CPPUNIT_PLUGIN_IMPLEMENT();
554 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */