[Libreoffice-commits] core.git: svx/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Sat Apr 10 13:35:05 UTC 2021
svx/source/unodraw/unoshape.cxx | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
New commits:
commit 526f0fce45fb014b09057403ae37c125e5a18655
Author: Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Fri Apr 9 12:05:16 2021 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sat Apr 10 15:34:22 2021 +0200
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 at collabora.co.uk>
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() );
More information about the Libreoffice-commits
mailing list