sc/qa/unit/rangelst_test.cxx | 33 +++++++++++++++++++++++++++++++++ sc/source/core/data/conditio.cxx | 5 ++++- 2 files changed, 37 insertions(+), 1 deletion(-)
New commits: commit ef48f2fd617aad8a19c2d5613db8fa513b2ef455 Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Wed Dec 26 04:10:50 2012 +0100 add a unit test for new method in ScRangeList Change-Id: Id27973cc82c71daffec62cbaccba30777c08612b diff --git a/sc/qa/unit/rangelst_test.cxx b/sc/qa/unit/rangelst_test.cxx index b5381ec..62d9002 100644 --- a/sc/qa/unit/rangelst_test.cxx +++ b/sc/qa/unit/rangelst_test.cxx @@ -38,6 +38,7 @@ public: void testDeleteArea_0Ranges(); void testJoin_Case1(); void testJoin_Case2(); + void testGetIntersectedRange(); void testUpdateReference_DeleteRow(); void testUpdateReference_DeleteCol(); @@ -63,6 +64,7 @@ public: CPPUNIT_TEST(testJoin_Case2); CPPUNIT_TEST(testUpdateReference_DeleteRow); CPPUNIT_TEST(testUpdateReference_DeleteCol); + CPPUNIT_TEST(testGetIntersectedRange); CPPUNIT_TEST_SUITE_END(); @@ -71,6 +73,30 @@ private: ScDocShellRef m_xDocShRef; }; +namespace { + +std::ostream& operator<<(std::ostream& rStrm, const ScAddress& rAddr) +{ + rStrm << "Col: " << rAddr.Col() << " Row: " << rAddr.Row() << " Tab: " << rAddr.Tab() << "\n"; + return rStrm; +} + +std::ostream& operator<<(std::ostream& rStrm, const ScRange& rRange) +{ + rStrm << "ScRange: " << rRange.aStart << rRange.aEnd << "\n"; + return rStrm; +} + +std::ostream& operator<<(std::ostream& rStrm, const ScRangeList& rList) +{ + rStrm << "ScRangeList: \n"; + for(size_t i = 0; i < rList.size(); ++i) + rStrm << *rList[i]; + return rStrm; +} + +} + void Test::setUp() { @@ -449,6 +475,13 @@ void Test::testUpdateReference_DeleteCol() CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(12), aList.GetCellCount()); } +void Test::testGetIntersectedRange() +{ + ScRangeList aList(ScRange(2, 2, 0, 5, 5, 0)); + ScRangeList aIntersecting = aList.GetIntersectedRange(ScRange(0, 0, 0, 3, 3, 0)); + CPPUNIT_ASSERT_EQUAL(ScRangeList(ScRange(2,2,0,3,3,0)), aIntersecting); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); commit 7c528f40e0aea9386d175b007974c02d265f96c6 Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Wed Dec 26 04:09:31 2012 +0100 one more improvement around cond format rendering, fdo#57896 Change-Id: I5eb267ec2d1666edd53f5b9d58fd2a0cec044aa1 diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx index 3dcc3be..016c5e9 100644 --- a/sc/source/core/data/conditio.cxx +++ b/sc/source/core/data/conditio.cxx @@ -1973,7 +1973,10 @@ void ScConditionalFormat::dumpInfo(rtl::OUStringBuffer& rBuf) const void ScConditionalFormat::DoRepaint( const ScRange* pModified ) { if(pModified) - pDoc->RepaintRange(*pModified); + { + if(maRanges.Intersects(*pModified)) + pDoc->RepaintRange(*pModified); + } else { // all conditional format cells _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits