sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

New commits:
commit 6155fe977b0462136fcccbc6f052518041b5e66f
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Wed Jan 24 20:18:01 2024 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Fri Jan 26 09:56:13 2024 +0100

    tdf#142806 sw: slowness if Style Inspector visible during PDF export
    
    There are loads of bookmarks in this bugdoc, WriterInspectorTextPanel
    update functions somehow iterate them all, and it's entirely pointless
    because the view doesn't repaint during store anyway.
    
    PDF export does a lot of cursor moves at the shell to get selection
    rectangles, and each one triggers the slow update in AttrChangedNotify.
    
    Also simplify, the m_pShell is already there.
    
    Change-Id: I2177db1a2ab712e8984772843bd5f995e6989a4f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162525
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>
    (cherry picked from commit 5314947eea119a1ed4960e23c61530669b97468e)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162544
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx 
b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx
index 49086fa9a04f..c6376910f1a5 100644
--- a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx
+++ b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx
@@ -758,12 +758,18 @@ IMPL_LINK(WriterInspectorTextPanel, AttrChangedNotify, 
LinkParamNone*, pLink, vo
     if (m_oldLink.IsSet())
         m_oldLink.Call(pLink);
 
+    if (m_pShell->IsViewLocked())
+    {
+        return; // tdf#142806 avoid slowdown when storing files
+    }
+
     SwDocShell* pDocSh = m_pShell->GetDoc()->GetDocShell();
     std::vector<svx::sidebar::TreeNode> aStore;
 
-    SwEditShell* pEditSh = pDocSh ? pDocSh->GetDoc()->GetEditShell() : nullptr;
-    if (pEditSh && pEditSh->GetCursor()->GetPointNode().GetTextNode())
-        UpdateTree(*pDocSh, *pEditSh, aStore, m_nParIdx);
+    if (m_pShell->GetCursor()->GetPointNode().GetTextNode())
+    {
+        UpdateTree(*pDocSh, *m_pShell, aStore, m_nParIdx);
+    }
 
     updateEntries(aStore, m_nParIdx);
 }

Reply via email to