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 /svx/source/unodraw/unoshape.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 'svx/source/unodraw/unoshape.cxx')
-rw-r--r-- | svx/source/unodraw/unoshape.cxx | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index 315503fa547b..e62262d6db5f 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -1018,17 +1018,18 @@ void SvxShape::Notify( SfxBroadcaster&, const SfxHint& rHint ) throw() return; // #i55919# SdrHintKind::ObjectChange is only interesting if it's for this object - - const SdrHint* pSdrHint = dynamic_cast<const SdrHint*>(&rHint); - if (!pSdrHint || - ((pSdrHint->GetKind() != SdrHintKind::ModelCleared) && - (pSdrHint->GetKind() != SdrHintKind::ObjectChange || pSdrHint->GetObject() != GetSdrObject() ))) + if (rHint.GetId() != SfxHintId::ThisIsAnSdrHint) + return; + SdrObject* pSdrObject(GetSdrObject()); + const SdrHint* pSdrHint = static_cast<const SdrHint*>(&rHint); + if ((pSdrHint->GetKind() != SdrHintKind::ModelCleared) && + (pSdrHint->GetKind() != SdrHintKind::ObjectChange || pSdrHint->GetObject() != pSdrObject )) return; - uno::Reference< uno::XInterface > xSelf( GetSdrObject()->getWeakUnoShape() ); + uno::Reference< uno::XInterface > xSelf( pSdrObject->getWeakUnoShape() ); if( !xSelf.is() ) { - EndListening(GetSdrObject()->getSdrModelFromSdrObject()); + EndListening(pSdrObject->getSdrModelFromSdrObject()); mpSdrObjectWeakReference.reset(nullptr); return; } @@ -1053,8 +1054,6 @@ void SvxShape::Notify( SfxBroadcaster&, const SfxHint& rHint ) throw() if( bClearMe ) { - SdrObject* pSdrObject(GetSdrObject()); - if(!HasSdrObjectOwnership()) { if(nullptr != pSdrObject) |