svx/source/unodraw/unoshape.cxx |   11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

New commits:
commit 2824cb9511265876694db8255aa56942a9911e7e
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Thu Aug 25 14:23:59 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sat Aug 27 18:08:18 2022 +0200

    regression in SvxShape::Notify
    
    from
        commit 526f0fce45fb014b09057403ae37c125e5a18655
        Author: Noel Grandin <noelgran...@gmail.com>
        Date:   Fri Apr 9 12:05:16 2021 +0200
        tdf#130326 speed up opening XLSX
    
    which resulted in things staying alive too long, affecting an upcoming
    patch of mine
    
    Change-Id: I52a0b35c9be55a554885a39d9e0710379304766b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138811
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>
    (cherry picked from commit 4dd4b8c6535340eec1e94bca9d9635243cdf51d8)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138819

diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index 1f7db69b180d..a0c81180dffe 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -971,14 +971,13 @@ void SvxShape::Notify( SfxBroadcaster&, const SfxHint& 
rHint ) noexcept
     // do cheap checks first, this method is hot
     if (rHint.GetId() != SfxHintId::ThisIsAnSdrHint)
         return;
-    const SdrHint* pSdrHint = static_cast<const SdrHint*>(&rHint);
-    if (pSdrHint->GetKind() != SdrHintKind::ModelCleared &&
-        pSdrHint->GetKind() != SdrHintKind::ObjectChange)
+    SdrObject* pSdrObject(mpSdrObjectWeakReference.get());
+    if( !pSdrObject )
         return;
-
+    const SdrHint* pSdrHint = static_cast<const SdrHint*>(&rHint);
     // #i55919# SdrHintKind::ObjectChange is only interesting if it's for this 
object
-    SdrObject* pSdrObject(GetSdrObject());
-    if ( !pSdrObject || pSdrHint->GetObject() != pSdrObject )
+    if ((pSdrHint->GetKind() != SdrHintKind::ModelCleared) &&
+         (pSdrHint->GetKind() != SdrHintKind::ObjectChange || 
pSdrHint->GetObject() != pSdrObject ))
         return;
 
     uno::Reference< uno::XInterface > xSelf( pSdrObject->getWeakUnoShape() );

Reply via email to