diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-08-18 15:19:35 +0200 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-08-18 17:15:31 +0200 |
commit | 340bf7be0cf0453049cc0d7e1a263dde41d2a0cc (patch) | |
tree | 6a43e72bfe1e449c16e68a6c0623c1b267cf492b /svx/source/svdraw | |
parent | d4a1aaca9fdeadcba86d7144165a691ea95ccf89 (diff) |
Remove redundant nullptr check
The only place calling UnloadObj is UnloadCheckHdl, which already
makes sure that the pointer is valid.
Change-Id: I78bd89b76427d18af1f38b29a8cf93bf02592030
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120634
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'svx/source/svdraw')
-rw-r--r-- | svx/source/svdraw/svdetc.cxx | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/svx/source/svdraw/svdetc.cxx b/svx/source/svdraw/svdetc.cxx index aa8ef44ee845..21dec8684feb 100644 --- a/svx/source/svdraw/svdetc.cxx +++ b/svx/source/svdraw/svdetc.cxx @@ -211,22 +211,20 @@ const SdrOle2Obj* OLEObjCache::operator[](size_t nPos) const bool OLEObjCache::UnloadObj(SdrOle2Obj* pObj) { bool bUnloaded = false; - if (pObj) - { - //#i80528# The old mechanism is completely useless, only taking into account if - // in all views the GrafDraft feature is used. This will nearly never have been the - // case since no one ever used this option. - // 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 bool bVisible(rViewContact.HasViewObjectContacts()); + //#i80528# The old mechanism is completely useless, only taking into account if + // in all views the GrafDraft feature is used. This will nearly never have been the + // case since no one ever used this option. - if(!bVisible) - { - bUnloaded = pObj->Unload(); - } + // 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 bool bVisible(rViewContact.HasViewObjectContacts()); + + if(!bVisible) + { + bUnloaded = pObj->Unload(); } return bUnloaded; |