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.stahl@allotropia.de>
diff --git a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx
index 49086fa..c637691 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);
}