From 10c934147d469965dba6abc78efd02759a010b8e Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 23 Apr 2019 09:26:46 +0200 Subject: tdf#113266 slow opening XLS with 45 MB drawing Some hot-spots around dynamic_cast of SdrHint, so avoid that by creating special SfxHintId::ThisIsAnSdrHint The most common CPU hot-spot was in SvxShape::Notify, the other changes are just for consistency. Also remove some dead code in ScShapeChildren, the Notify method was doing nothing useful. Change-Id: I696db1fcafc09bb10bf23ac673de292746141491 Reviewed-on: https://gerrit.libreoffice.org/71108 Tested-by: Jenkins Reviewed-by: Noel Grandin --- .../AccessibleDocumentPagePreview.cxx | 63 +--------------------- 1 file changed, 1 insertion(+), 62 deletions(-) (limited to 'sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx') diff --git a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx index 81b8cf79460e..8f21926bec50 100644 --- a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx @@ -589,16 +589,10 @@ struct ScShapeRange typedef std::vector ScShapeRangeVec; -class ScShapeChildren : public SfxListener, - public ::accessibility::IAccessibleParent +class ScShapeChildren : public ::accessibility::IAccessibleParent { public: ScShapeChildren(ScPreviewShell* pViewShell, ScAccessibleDocumentPagePreview* pAccDoc); - virtual ~ScShapeChildren() override; - - ///===== SfxListener ===================================================== - - virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override; ///===== IAccessibleParent ============================================== @@ -625,7 +619,6 @@ public: void DataChanged(); void VisAreaChanged() const; - void SetDrawBroadcaster(); private: ScAccessibleDocumentPagePreview* const mpAccDoc; ScPreviewShell* mpViewShell; @@ -648,56 +641,6 @@ ScShapeChildren::ScShapeChildren(ScPreviewShell* pViewShell, ScAccessibleDocumen mpViewShell(pViewShell), maShapeRanges(SC_PREVIEW_MAXRANGES) { - if (pViewShell) - { - SfxBroadcaster* pDrawBC = pViewShell->GetDocument().GetDrawBroadcaster(); - if (pDrawBC) - StartListening(*pDrawBC); - } -} - -ScShapeChildren::~ScShapeChildren() -{ - if (mpViewShell) - { - SfxBroadcaster* pDrawBC = mpViewShell->GetDocument().GetDrawBroadcaster(); - if (pDrawBC) - EndListening(*pDrawBC); - } -} - -void ScShapeChildren::SetDrawBroadcaster() -{ - if (mpViewShell) - { - SfxBroadcaster* pDrawBC = mpViewShell->GetDocument().GetDrawBroadcaster(); - if (pDrawBC) - StartListening(*pDrawBC, DuplicateHandling::Prevent); - } -} - -void ScShapeChildren::Notify(SfxBroadcaster&, const SfxHint& rHint) -{ - const SdrHint* pSdrHint = dynamic_cast( &rHint ); - if (pSdrHint) - { - SdrObject* pObj = const_cast(pSdrHint->GetObject()); - if (pObj && (pObj->getSdrPageFromSdrObject() == GetDrawPage())) - { - switch (pSdrHint->GetKind()) - { - case SdrHintKind::ObjectChange : - { - } - break; - default : - { - // other events are not interesting - } - break; - } - } - } } void ScShapeChildren::FindChanged(ScShapeChildVec& rOld, ScShapeChildVec& rNew) const @@ -1237,10 +1180,6 @@ void ScAccessibleDocumentPagePreview::Notify( SfxBroadcaster& rBC, const SfxHint } } } - else if (rHint.GetId() == SfxHintId::ScAccMakeDrawLayer) - { - GetShapeChildren()->SetDrawBroadcaster(); - } else if (rHint.GetId() == SfxHintId::ScAccVisAreaChanged) { Size aOutputSize; -- cgit