sw/inc/viewsh.hxx              |    4 ++--
 sw/source/core/view/viewsh.cxx |   18 +++++++++++++++---
 2 files changed, 17 insertions(+), 5 deletions(-)

New commits:
commit 6e0c522de3faf55f3a069b1648cc283a3813ff6d
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Tue May 23 14:19:34 2023 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Wed May 24 14:36:49 2023 +0200

    don't InvalidateAll in online for a OuterResize case
    
    which is triggered on a new joiner to a shared document
    but doesn't seem useful in the online case at least
    
    https: //github.com/CollaboraOnline/online/issues/6379
    Change-Id: Ic5034658d9e8a7ca1dfab44ce3905b95a5705eb2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152164
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152175
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>

diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx
index 5d2e57952f4f..cc327e3c75f2 100644
--- a/sw/inc/viewsh.hxx
+++ b/sw/inc/viewsh.hxx
@@ -189,7 +189,7 @@ class SW_DLLPUBLIC SwViewShell : public 
sw::Ring<SwViewShell>
 
     SAL_DLLPRIVATE void ImplApplyViewOptions( const SwViewOption &rOpt );
 
-    SAL_DLLPRIVATE void InvalidateAll(const std::vector<LockPaintReason>& 
rReasons);
+    SAL_DLLPRIVATE void InvalidateAll(std::vector<LockPaintReason>& rReasons);
 
 protected:
     static ShellResource*      spShellRes;      ///< Resources for the Shell.
@@ -496,7 +496,7 @@ public:
     inline void LockPaint(LockPaintReason eReason);
            void ImplLockPaint();
     inline void UnlockPaint(bool bVirDev = false );
-           void ImplUnlockPaint( const std::vector<LockPaintReason>& rReasons, 
bool bVirDev );
+           void ImplUnlockPaint( std::vector<LockPaintReason>& rReasons, bool 
bVirDev );
            bool IsPaintLocked() const { return mnLockPaint != 0; }
 
     // Get/set DrawView and PageView.
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index c4c410efe02d..9c80d43f36a6 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -480,7 +480,7 @@ void SwViewShell::ImplLockPaint()
     Imp()->LockPaint();
 }
 
-void SwViewShell::ImplUnlockPaint(const std::vector<LockPaintReason>& 
rReasons, bool bVirDev)
+void SwViewShell::ImplUnlockPaint(std::vector<LockPaintReason>& rReasons, bool 
bVirDev)
 {
     CurrShell aCurr( this );
     if ( GetWin() && GetWin()->IsVisible() )
@@ -578,11 +578,23 @@ namespace
     };
 }
 
-void SwViewShell::InvalidateAll(const std::vector<LockPaintReason>& rReasons)
+void SwViewShell::InvalidateAll(std::vector<LockPaintReason>& rReasons)
 {
+    assert(!rReasons.empty() && "there must be a reason to InvalidateAll");
+
     for (const auto& reason : rReasons)
         SAL_INFO("sw.core", "InvalidateAll because of: " << to_string(reason));
-    GetWin()->Invalidate(InvalidateFlags::Children);
+
+    if (comphelper::LibreOfficeKit::isActive())
+    {
+        // https://github.com/CollaboraOnline/online/issues/6379
+        // ditch OuterResize as a reason to invalidate all in the online case
+        rReasons.erase(std::remove(rReasons.begin(), rReasons.end(), 
LockPaintReason::OuterResize), rReasons.end());
+    }
+
+    if (!rReasons.empty())
+        GetWin()->Invalidate(InvalidateFlags::Children);
+    rReasons.clear();
 }
 
 bool SwViewShell::AddPaintRect( const SwRect & rRect )

Reply via email to