diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-05-31 13:53:43 +0200 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-06-28 09:36:19 +0200 |
commit | 363eda3d6e39d657248f3f2ffd9e9d5dcf7c7bdd (patch) | |
tree | 10da3f8a380161ec7c72b90617a8abbc329cc9af | |
parent | Resolves: tdf#153767 Try harder to import OOXML bool shared formula result (diff) | |
download | core-363eda3d6e39d657248f3f2ffd9e9d5dcf7c7bdd.tar.gz core-363eda3d6e39d657248f3f2ffd9e9d5dcf7c7bdd.zip |
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 <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153582
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
-rw-r--r-- | svx/source/sdr/contact/viewobjectcontact.cxx | 10 |
1 files changed, 7 insertions, 3 deletions
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 |