diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-05-31 13:53:43 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-05-31 17:45:22 +0200 |
commit | 4f98574b78ed1b06bac1d440d75d8ce1ddea8309 (patch) | |
tree | af456bbd62eea7957124db77427455c6a0c7057d /svx | |
parent | 5194bb56b6db3b67389cad977c27a7b34f51044b (diff) |
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/+/152424
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-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 82b21d137ef1..bc3b5ee178bd 100644 --- a/svx/source/sdr/contact/viewobjectcontact.cxx +++ b/svx/source/sdr/contact/viewobjectcontact.cxx @@ -167,10 +167,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 |