diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-04-23 09:26:46 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-04-23 14:10:38 +0200 |
commit | 10c934147d469965dba6abc78efd02759a010b8e (patch) | |
tree | 54fe37d01913d48abf93bd087c59f95fdcfa5a46 /sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx | |
parent | a08401155a0b4b49878e8e50d39b2fd3e5278779 (diff) |
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 <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx')
-rw-r--r-- | sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx | 63 |
1 files changed, 1 insertions, 62 deletions
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<ScShapeRange> 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<const SdrHint*>( &rHint ); - if (pSdrHint) - { - SdrObject* pObj = const_cast<SdrObject*>(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; |