From 7bba0f12e4bb726ef29a9b7c2f862128abcaf0d7 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 18 Aug 2021 16:32:00 +0100 Subject: UnloadObj always dereferences its SdrOle2Obj* arg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I24f68e83c15f7fad464ad164e75e7cd49ae17b9e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120678 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- svx/source/svdraw/svdetc.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'svx') diff --git a/svx/source/svdraw/svdetc.cxx b/svx/source/svdraw/svdetc.cxx index 04219e7a8477..e97593ca0319 100644 --- a/svx/source/svdraw/svdetc.cxx +++ b/svx/source/svdraw/svdetc.cxx @@ -151,7 +151,7 @@ IMPL_LINK_NOARG(OLEObjCache, UnloadCheckHdl, Timer*, void) } } - if ( bUnload && UnloadObj(pUnloadObj) ) + if (bUnload && UnloadObj(*pUnloadObj)) { // object was successfully unloaded RemoveObj(pUnloadObj); @@ -216,7 +216,7 @@ const SdrOle2Obj* OLEObjCache::operator[](size_t nPos) const return maObjs[nPos]; } -bool OLEObjCache::UnloadObj(SdrOle2Obj* pObj) +bool OLEObjCache::UnloadObj(SdrOle2Obj& rObj) { bool bUnloaded = false; @@ -227,12 +227,12 @@ bool OLEObjCache::UnloadObj(SdrOle2Obj* pObj) // A much better (and working) criteria would be the VOC contact count. // The question is what will happen when i make it work now suddenly? I // will try it for 2.4. - const sdr::contact::ViewContact& rViewContact = pObj->GetViewContact(); + const sdr::contact::ViewContact& rViewContact = rObj.GetViewContact(); const bool bVisible(rViewContact.HasViewObjectContacts()); if(!bVisible) { - bUnloaded = pObj->Unload(); + bUnloaded = rObj.Unload(); } return bUnloaded; -- cgit