[Libreoffice-commits] core.git: svx/source

Mike Kaganski (via logerrit) logerrit at kemper.freedesktop.org
Wed Aug 18 15:16:07 UTC 2021


 svx/source/svdraw/svdetc.cxx |   26 ++++++++++++--------------
 1 file changed, 12 insertions(+), 14 deletions(-)

New commits:
commit 340bf7be0cf0453049cc0d7e1a263dde41d2a0cc
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Wed Aug 18 15:19:35 2021 +0200
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Wed Aug 18 17:15:31 2021 +0200

    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 at collabora.com>

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;


More information about the Libreoffice-commits mailing list