diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-04-09 12:05:16 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-04-10 15:34:22 +0200 |
commit | 526f0fce45fb014b09057403ae37c125e5a18655 (patch) | |
tree | 709629c4a3ad59d232ae23fb73d31f82bc18e682 /svx/source | |
parent | f48ddb48720767414fee4b1dbdced85a8be27d09 (diff) |
tdf#130326 speed up opening XLSX
SvxShape::Notify is called a lot (26%) of CPU, so re-arrange it
to do the cheapest checks first.
Change-Id: I0e6c6c976ecfe7670e8d4af175606654f839aa66
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113843
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/unodraw/unoshape.cxx | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index 1e5263921fd2..de292ef43bb3 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -992,16 +992,18 @@ uno::Sequence< sal_Int8 > SAL_CALL SvxShape::getImplementationId() void SvxShape::Notify( SfxBroadcaster&, const SfxHint& rHint ) throw() { DBG_TESTSOLARMUTEX(); - if( !HasSdrObject() ) - return; - // #i55919# SdrHintKind::ObjectChange is only interesting if it's for this object + // do cheap checks first, this method is hot 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 )) + if (pSdrHint->GetKind() != SdrHintKind::ModelCleared && + pSdrHint->GetKind() != SdrHintKind::ObjectChange) + return; + + // #i55919# SdrHintKind::ObjectChange is only interesting if it's for this object + SdrObject* pSdrObject(GetSdrObject()); + if ( !pSdrObject || pSdrHint->GetObject() != pSdrObject ) return; uno::Reference< uno::XInterface > xSelf( pSdrObject->getWeakUnoShape() ); |