diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-12-08 11:14:47 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-12-10 12:09:03 +0100 |
commit | 585bf5f2b223a1449dd8f6b65c5f0c0c00160af7 (patch) | |
tree | 2381aec3ff9e9938bc564dc8dce927f09c21e3e0 /svx | |
parent | 0db4adad840c591393466256d62e4bee6b2f929d (diff) |
tdf#146108 Calc slow to change cell focus..
in a document with a big background image
Revert "tdf#136058: remove some caching"
This reverts commit 57c40329a2b469813a1f357de355a37c8e3077ae.
And add some comments for future would-be optimisers.
Change-Id: Ie8686edc38dcdbe7d9e78599c1a259aab68278a1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126527
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126574
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/sdr/contact/viewcontact.cxx | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/svx/source/sdr/contact/viewcontact.cxx b/svx/source/sdr/contact/viewcontact.cxx index 4a2914af0e2b..2644632a9a27 100644 --- a/svx/source/sdr/contact/viewcontact.cxx +++ b/svx/source/sdr/contact/viewcontact.cxx @@ -101,7 +101,9 @@ void ViewContact::RemoveViewObjectContact(ViewObjectContact& rVOContact) maViewObjectContactVector.begin(), maViewObjectContactVector.end(), &rVOContact); if (aFindResult != maViewObjectContactVector.end()) + { maViewObjectContactVector.erase(aFindResult); + } } // Test if this ViewContact has ViewObjectContacts at all. This can @@ -226,6 +228,9 @@ ViewContact::createViewIndependentPrimitive2DSequence() const drawinglayer::primitive2d::Primitive2DContainer ViewContact::getViewIndependentPrimitive2DContainer() const { + /* Local up-to-date checks. Create new list and compare. + We cannot just always use the new data because the old data has cached bitmaps in it e.g. see the document in tdf#146108. + */ drawinglayer::primitive2d::Primitive2DContainer xNew( createViewIndependentPrimitive2DSequence()); @@ -235,7 +240,14 @@ ViewContact::getViewIndependentPrimitive2DContainer() const xNew = embedToObjectSpecificInformation(std::move(xNew)); } - return xNew; + if (mxViewIndependentPrimitive2DSequence != xNew) + { + // has changed, copy content + const_cast<ViewContact*>(this)->mxViewIndependentPrimitive2DSequence = std::move(xNew); + } + + // return current Primitive2DContainer + return mxViewIndependentPrimitive2DSequence; } // add Gluepoints (if available) |