summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2023-05-23 14:19:34 +0100
committerCaolán McNamara <caolan.mcnamara@collabora.com>2023-05-23 21:52:47 +0200
commit010c05ca0eb66756b7f5db8b847e5a227d9e1ed4 (patch)
tree87eb4937352547dc88d089b1dc0ecd5b41131d61
parente606d9336149a78eabd9440ccea2f6c2a29cd0d0 (diff)
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.mcnamara@collabora.com>
-rw-r--r--sw/inc/viewsh.hxx4
-rw-r--r--sw/source/core/view/viewsh.cxx18
2 files changed, 17 insertions, 5 deletions
diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx
index 554442d45e5b..e54e294d2f0a 100644
--- a/sw/inc/viewsh.hxx
+++ b/sw/inc/viewsh.hxx
@@ -187,7 +187,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.
@@ -492,7 +492,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 56b6b67a4caf..e501545e7396 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -417,7 +417,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() )
@@ -515,11 +515,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 )