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

Tor Lillqvist (via logerrit) logerrit at kemper.freedesktop.org
Tue Feb 2 09:19:01 UTC 2021


 sc/source/ui/docshell/docfunc.cxx |   29 +++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)

New commits:
commit 2ee5769587024672bdc84d00c7cf8eb48ef8c620
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Mon Feb 1 13:18:23 2021 +0200
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Tue Feb 2 10:18:16 2021 +0100

    Probably this LOK invalidation should be done only if something changed
    
    Change-Id: I0164ac8d74c08abce0a1d8c2e7a7dd9679da91fa
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110256
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110282
    Tested-by: Jenkins
    Reviewed-by: Tor Lillqvist <tml at collabora.com>

diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 98e07e22df5e..0c7b35ff000f 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -153,20 +153,6 @@ bool ScDocFunc::AdjustRowHeight( const ScRange& rRange, bool bPaint )
     SCROW nStartRow = rRange.aStart.Row();
     SCROW nEndRow   = rRange.aEnd.Row();
 
-    if (comphelper::LibreOfficeKit::isActive())
-    {
-        SfxViewShell* pViewShell = SfxViewShell::GetFirst();
-        while (pViewShell)
-        {
-            ScTabViewShell* pTabViewShell = dynamic_cast<ScTabViewShell*>(pViewShell);
-            if (pTabViewShell && pTabViewShell->GetDocId() == pSomeViewForThisDoc->GetDocId())
-            {
-                pTabViewShell->GetViewData().GetLOKHeightHelper(nTab)->invalidateByIndex(nStartRow);
-            }
-            pViewShell = SfxViewShell::GetNext(*pViewShell);
-        }
-    }
-
     ScSizeDeviceProvider aProv( &rDocShell );
     Fraction aOne(1,1);
 
@@ -174,7 +160,22 @@ bool ScDocFunc::AdjustRowHeight( const ScRange& rRange, bool bPaint )
     bool bChanged = rDoc.SetOptimalHeight(aCxt, nStartRow, nEndRow, nTab);
     // tdf#76183: recalculate objects' positions
     if (bChanged)
+    {
+        if (comphelper::LibreOfficeKit::isActive())
+        {
+            SfxViewShell* pViewShell = SfxViewShell::GetFirst();
+            while (pViewShell)
+            {
+                ScTabViewShell* pTabViewShell = dynamic_cast<ScTabViewShell*>(pViewShell);
+                if (pTabViewShell && pTabViewShell->GetDocId() == pSomeViewForThisDoc->GetDocId())
+                {
+                    pTabViewShell->GetViewData().GetLOKHeightHelper(nTab)->invalidateByIndex(nStartRow);
+                }
+                pViewShell = SfxViewShell::GetNext(*pViewShell);
+            }
+        }
         rDoc.SetDrawPageSize(nTab);
+    }
 
     if ( bPaint && bChanged )
         rDocShell.PostPaint(ScRange(0, nStartRow, nTab, rDoc.MaxCol(), rDoc.MaxRow(), nTab),


More information about the Libreoffice-commits mailing list