From d77471b670e050f99e7f8fd442d7d4ee6b84a6e3 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 3 Mar 2025 20:29:38 +0000 Subject: cool#10967: LOK Impress: Invalidate tiles on switching the CenterPane MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit and not at DrawDocShell::Connect which happens on switching view which happens frequently with multiple users which creates a storm of invalidations. #0 SfxViewShell::libreOfficeKitViewInvalidateTilesCallback (this=0x3301ce40, pRect=0x0, nPart=0, nMode=0) at sfx2/source/view/viewsh.cxx:3331 #1 0x00007fd0f1bae136 in sd::DrawDocShell::Connect (this=0x352e3e50, pViewSh=0x3700bed0) at sd/source/ui/docshell/docshel2.cxx:159 #2 0x00007fd0f2168cae in sd::ViewShell::Activate (this=0x3700bed0, bIsMDIActivate=true) at sd/source/ui/view/viewshel.cxx:350 #3 0x00007fd0f202c41b in sd::DrawViewShell::Activate (this=0x3700bed0, bIsMDIActivate=true) at sd/source/ui/view/drviews1.cxx:84 #4 0x00007fd115efb7d6 in SfxShell::DoActivate_Impl (this=0x3700bed0, pFrame=0x37066300, bMDI=true) at sfx2/source/control/shell.cxx:326 #5 0x00007fd115ebed5e in SfxDispatcher::DoActivate_Impl (this=0x370481c0, bMDI=true) at sfx2/source/control/dispatch.cxx:600 #6 0x00007fd1163b9f00 in SfxViewFrame::DoActivate (this=0x37066300, bUI=true) at sfx2/source/view/viewfrm.cxx:1196 #7 0x00007fd115da26b6 in SfxApplication::SetViewFrame_Impl (this=0x318c3ba0, pFrame=0x37066300) at sfx2/source/appl/app.cxx:260 #8 0x00007fd1163c8126 in SfxViewFrame::SetViewFrame (pFrame=0x37066300) at sfx2/source/view/viewfrm.cxx:3652 #9 0x00007fd1163c02ba in SfxViewFrame::MakeActive_Impl (this=0x37066300, bGrabFocus=false) at sfx2/source/view/viewfrm.cxx:2252 #10 0x00007fd116374bba in SfxLokHelper::setView (nId=5) at sfx2/source/view/lokhelper.cxx:221 #11 0x00007fd1164a59ce in doc_setView (nId=5) at desktop/source/lib/init.cxx:6918 Change-Id: Id4883d99009544cee8a239471f3ae65eb3646306 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182443 Tested-by: Jenkins CollaboraOffice Reviewed-by: Gökay ŞATIR (cherry picked from commit 22307f05056aefebc4ba5d0ab60445b30adfc00c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182464 Reviewed-by: Caolán McNamara Tested-by: Jenkins --- sd/source/ui/docshell/docshel2.cxx | 12 ------------ sd/source/ui/view/FormShellManager.cxx | 9 +++++++++ 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/sd/source/ui/docshell/docshel2.cxx b/sd/source/ui/docshell/docshel2.cxx index caf6c44f1778..6a3ea2edfda1 100644 --- a/sd/source/ui/docshell/docshel2.cxx +++ b/sd/source/ui/docshell/docshel2.cxx @@ -39,9 +39,6 @@ #include #include -#include -#include - namespace sd { /** @@ -150,15 +147,6 @@ void DrawDocShell::Draw(OutputDevice* pOut, const JobSetup&, sal_uInt16 nAspect, void DrawDocShell::Connect(ViewShell* pViewSh) { mpViewShell = pViewSh; - - if (comphelper::LibreOfficeKit::isActive()) - { - SfxViewShell* sfxViewShell = mpViewShell->GetViewShell(); - if (sfxViewShell) - { - mpViewShell->GetViewShell()->libreOfficeKitViewInvalidateTilesCallback(nullptr, sfxViewShell->getPart(), sfxViewShell->getEditMode()); - } - } } void DrawDocShell::Disconnect(ViewShell const * pViewSh) diff --git a/sd/source/ui/view/FormShellManager.cxx b/sd/source/ui/view/FormShellManager.cxx index d2cb6ebfee21..3aad7a10a2a3 100644 --- a/sd/source/ui/view/FormShellManager.cxx +++ b/sd/source/ui/view/FormShellManager.cxx @@ -24,6 +24,8 @@ #include #include #include +#include +#include #include #include #include @@ -156,6 +158,13 @@ void FormShellManager::RegisterAtCenterPane() mpSubShellFactory = std::make_shared(*pShell, *this); mrBase.GetViewShellManager()->AddSubShellFactory(pShell,mpSubShellFactory); mrBase.GetViewShellManager()->ActivateSubShell(*pShell, ToolbarId::FormLayer_Toolbox); + + if (comphelper::LibreOfficeKit::isActive()) + { + SfxViewShell* sfxViewShell = pShell->GetViewShell(); + if (sfxViewShell) + pShell->GetViewShell()->libreOfficeKitViewInvalidateTilesCallback(nullptr, sfxViewShell->getPart(), sfxViewShell->getEditMode()); + } } void FormShellManager::UnregisterAtCenterPane() -- cgit