svx/source/sdr/contact/viewobjectcontact.cxx |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

New commits:
commit 363eda3d6e39d657248f3f2ffd9e9d5dcf7c7bdd
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed May 31 13:53:43 2023 +0200
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Wed Jun 28 09:36:19 2023 +0200

    speed up tab-switching in a calc document with a lot of graphic objects
    
    if we are in the destructor, and we have never painted the object in
    question, then we don't need to do an expensive object-range calculation
    and invalidation
    
    Change-Id: I857c3d927142f4e90d54f79fa6c293731382f0d9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152434
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153582
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/svx/source/sdr/contact/viewobjectcontact.cxx 
b/svx/source/sdr/contact/viewobjectcontact.cxx
index c3c12071f878..62b63ee6b72d 100644
--- a/svx/source/sdr/contact/viewobjectcontact.cxx
+++ b/svx/source/sdr/contact/viewobjectcontact.cxx
@@ -158,10 +158,14 @@ ViewObjectContact::ViewObjectContact(ObjectContact& 
rObjectContact, ViewContact&
 
 ViewObjectContact::~ViewObjectContact()
 {
-    // invalidate in view
-    if(!getObjectRange().isEmpty())
+    // if the object range is empty, then we have never had the primitive 
range change, so nothing to invalidate
+    if (!maObjectRange.isEmpty())
     {
-        GetObjectContact().InvalidatePartOfView(maObjectRange);
+        // invalidate in view
+        if(!getObjectRange().isEmpty())
+        {
+            GetObjectContact().InvalidatePartOfView(maObjectRange);
+        }
     }
 
     // delete PrimitiveAnimation

Reply via email to