sc/qa/unit/tiledrendering/tiledrendering.cxx |    4 ++--
 sc/source/ui/docshell/docsh3.cxx             |    5 ++++-
 2 files changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 34d5abf464dfbf4bdc36f6b87e606c84a1f4d99d
Author:     Szymon Kłos <szymon.k...@collabora.com>
AuthorDate: Tue Jul 25 14:35:49 2023 +0200
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Sun Aug 27 20:42:13 2023 +0200

    lok: notify only affected tabs on cell resize
    
    When row has automatic height and we type something into
    one cell - it may be resized. That caused sending
    document size changed callback to all the views, also
    affecting all the parts/tabs.
    
    This patch calls that only for affected views which
    are looking at modified parts. It will not invalidate
    all the tabs when only one is modified.
    
    Change-Id: I93e574cf967d608696c1a95ad8b5a7614973c3f5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154891
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156156
    Tested-by: Jenkins

diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx 
b/sc/qa/unit/tiledrendering/tiledrendering.cxx
index 35304683e724..76286912a698 100644
--- a/sc/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx
@@ -1054,7 +1054,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, 
testInvalidateOnInserRowCol)
     aView.m_aInvalidations.clear();
     dispatchCommand(mxComponent, ".uno:InsertRows", aArgs);
     CPPUNIT_ASSERT(aView.m_bInvalidateTiles);
-    CPPUNIT_ASSERT_EQUAL(size_t(2), aView.m_aInvalidations.size());
+    CPPUNIT_ASSERT_EQUAL(size_t(1), aView.m_aInvalidations.size());
     CPPUNIT_ASSERT_EQUAL(tools::Rectangle(-75, 51240, 32212230, 63990), 
aView.m_aInvalidations[0]);
 
     // move on the right
@@ -1070,7 +1070,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, 
testInvalidateOnInserRowCol)
     aView.m_aInvalidations.clear();
     dispatchCommand(mxComponent, ".uno:InsertColumns", aArgs);
     CPPUNIT_ASSERT(aView.m_bInvalidateTiles);
-    CPPUNIT_ASSERT_EQUAL(size_t(2), aView.m_aInvalidations.size());
+    CPPUNIT_ASSERT_EQUAL(size_t(1), aView.m_aInvalidations.size());
     CPPUNIT_ASSERT_EQUAL(tools::Rectangle(254925, -15, 32212230, 63990), 
aView.m_aInvalidations[0]);
 }
 
diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx
index 789737e5f824..50e99f36f109 100644
--- a/sc/source/ui/docshell/docsh3.cxx
+++ b/sc/source/ui/docshell/docsh3.cxx
@@ -109,6 +109,7 @@ void ScDocShell::PostPaint( SCCOL nStartCol, SCROW 
nStartRow, SCTAB nStartTab,
 void ScDocShell::PostPaint( const ScRangeList& rRanges, PaintPartFlags nPart, 
sal_uInt16 nExtFlags )
 {
     ScRangeList aPaintRanges;
+    std::set<SCTAB> aTabsInvalidated;
     for (size_t i = 0, n = rRanges.size(); i < n; ++i)
     {
         const ScRange& rRange = rRanges[i];
@@ -167,6 +168,7 @@ void ScDocShell::PostPaint( const ScRangeList& rRanges, 
PaintPartFlags nPart, sa
             }
         }
         aPaintRanges.push_back(ScRange(nCol1, nRow1, nTab1, nCol2, nRow2, 
nTab2));
+        aTabsInvalidated.insert(nTab1);
     }
 
     Broadcast(ScPaintHint(aPaintRanges.Combine(), nPart));
@@ -176,7 +178,8 @@ void ScDocShell::PostPaint( const ScRangeList& rRanges, 
PaintPartFlags nPart, sa
     if ((nPart & (PaintPartFlags::Top | PaintPartFlags::Left)) && 
comphelper::LibreOfficeKit::isActive())
     {
         ScModelObj* pModel = GetModel();
-        SfxLokHelper::notifyDocumentSizeChangedAllViews(pModel);
+        for (auto nTab : aTabsInvalidated)
+            SfxLokHelper::notifyPartSizeChangedAllViews(pModel, nTab);
     }
 }
 

Reply via email to