[Libreoffice-commits] core.git: sc/qa sc/source

Tamás Zolnai (via logerrit) logerrit at kemper.freedesktop.org
Wed Sep 25 10:35:18 UTC 2019


 sc/qa/unit/tiledrendering/tiledrendering.cxx |   10 ++++------
 sc/source/ui/view/tabview3.cxx               |   16 ++++++++--------
 2 files changed, 12 insertions(+), 14 deletions(-)

New commits:
commit db0e7e3715bdef7ad6c1f536e9cf1ea84773fbe8
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Sat Sep 21 16:44:32 2019 +0200
Commit:     Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Wed Sep 25 12:34:05 2019 +0200

    sc lok: Optimize invalidation triggered by ScTabView::SetCursor() method
    
    Don't call a full invalidation, rather use invalidation only on the new
    area. Make sure that the invalidation is called first.
    
    Change-Id: Ibdcc71a81f852acbd40a710204540ebd8df77907
    Reviewed-on: https://gerrit.libreoffice.org/79497
    Tested-by: Jenkins
    Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>

diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx b/sc/qa/unit/tiledrendering/tiledrendering.cxx
index a2f3e800f72e..59700cfccc9c 100644
--- a/sc/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx
@@ -1809,9 +1809,8 @@ void ScTiledRenderingTest::testJumpHorizontallyInvalidation()
     pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::PAGEDOWN | KEY_MOD2);
     Scheduler::ProcessEventsToIdle();
     CPPUNIT_ASSERT(aView1.m_bInvalidateTiles);
-    CPPUNIT_ASSERT_EQUAL(size_t(2), aView1.m_aInvalidations.size());
-    CPPUNIT_ASSERT_EQUAL(tools::Rectangle(0, 0, 1000000000, 1000000000), aView1.m_aInvalidations[0]);
-    CPPUNIT_ASSERT_EQUAL(tools::Rectangle(26775, 0, 39525, 13005), aView1.m_aInvalidations[1]);
+    CPPUNIT_ASSERT_EQUAL(size_t(1), aView1.m_aInvalidations.size());
+    CPPUNIT_ASSERT_EQUAL(tools::Rectangle(26775, 0, 39525, 13005), aView1.m_aInvalidations[0]);
 }
 
 void ScTiledRenderingTest::testJumpToLastRowInvalidation()
@@ -1833,9 +1832,8 @@ void ScTiledRenderingTest::testJumpToLastRowInvalidation()
     pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::DOWN | KEY_MOD1);
     Scheduler::ProcessEventsToIdle();
     CPPUNIT_ASSERT(aView1.m_bInvalidateTiles);
-    CPPUNIT_ASSERT_EQUAL(size_t(2), aView1.m_aInvalidations.size());
-    CPPUNIT_ASSERT_EQUAL(tools::Rectangle(0, 0, 1000000000, 1000000000), aView1.m_aInvalidations[0]);
-    CPPUNIT_ASSERT_EQUAL(tools::Rectangle(0, 13005, 26775, 127500255), aView1.m_aInvalidations[1]);
+    CPPUNIT_ASSERT_EQUAL(size_t(1), aView1.m_aInvalidations.size());
+    CPPUNIT_ASSERT_EQUAL(tools::Rectangle(0, 13005, 26775, 127500255), aView1.m_aInvalidations[0]);
 }
 
 }
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index db33673cfddb..b264ec0ef2aa 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -399,14 +399,6 @@ void ScTabView::SetCursor( SCCOL nPosX, SCROW nPosY, bool bNew )
 
                 if (pDocSh)
                 {
-                    // Provide size in the payload, so clients don't have to
-                    // call lok::Document::getDocumentSize().
-                    std::stringstream ss;
-                    ss << aNewSize.Width() << ", " << aNewSize.Height();
-                    OString sSize = ss.str().c_str();
-                    ScModelObj* pModel = comphelper::getUnoTunnelImplementation<ScModelObj>(aViewData.GetViewShell()->GetCurrentDocument());
-                    SfxLokHelper::notifyDocumentSizeChanged(aViewData.GetViewShell(), sSize, pModel);
-
                     // New area extended to the right of the sheet after last column
                     // including overlapping area with aNewRowArea
                     tools::Rectangle aNewColArea(aOldSize.getWidth(), 0, aNewSize.getWidth(), aNewSize.getHeight());
@@ -425,6 +417,14 @@ void ScTabView::SetCursor( SCCOL nPosX, SCROW nPosY, bool bNew )
                     {
                         SfxLokHelper::notifyInvalidation(aViewData.GetViewShell(), aNewRowArea.toString());
                     }
+
+                    // Provide size in the payload, so clients don't have to
+                    // call lok::Document::getDocumentSize().
+                    std::stringstream ss;
+                    ss << aNewSize.Width() << ", " << aNewSize.Height();
+                    OString sSize = ss.str().c_str();
+                    ScModelObj* pModel = comphelper::getUnoTunnelImplementation<ScModelObj>(aViewData.GetViewShell()->GetCurrentDocument());
+                    SfxLokHelper::notifyDocumentSizeChanged(aViewData.GetViewShell(), sSize, pModel, false);
                 }
             }
         }


More information about the Libreoffice-commits mailing list