[Libreoffice-commits] .: Branch 'libreoffice-4-0' - 2 commits - sc/qa sc/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Dec 25 19:12:59 PST 2012


 sc/qa/unit/rangelst_test.cxx     |   33 +++++++++++++++++++++++++++++++++
 sc/source/core/data/conditio.cxx |    5 ++++-
 2 files changed, 37 insertions(+), 1 deletion(-)

New commits:
commit 29ffe4813bff7fa1925fad4da6e0ce2a37748dbf
Author: Markus Mohrhard <markus.mohrhard at 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 f5e29978a8aa0260f91a9a7f5a648c602b9bad7d
Author: Markus Mohrhard <markus.mohrhard at 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 f72fa73..b0e99cb 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


More information about the Libreoffice-commits mailing list