summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-12-08 11:14:47 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-12-08 11:46:42 +0100
commit829510594b394d00ca2b4acb0ed64c6bda0f311c (patch)
tree5c03f91fb338f97d2821dbb4bdee9f1ed5787376 /svx
parent556062749651d332cc3c744649b158a3ccc2cc18 (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>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/sdr/contact/viewcontact.cxx14
1 files changed, 13 insertions, 1 deletions
diff --git a/svx/source/sdr/contact/viewcontact.cxx b/svx/source/sdr/contact/viewcontact.cxx
index 3c1c875acba3..3f13933b742d 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
@@ -223,6 +225,9 @@ void ViewContact::createViewIndependentPrimitive2DSequence(
void ViewContact::getViewIndependentPrimitive2DContainer(
drawinglayer::primitive2d::Primitive2DDecompositionVisitor& rVisitor) 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(xNew);
@@ -232,7 +237,14 @@ void ViewContact::getViewIndependentPrimitive2DContainer(
xNew = embedToObjectSpecificInformation(std::move(xNew));
}
- rVisitor.visit(xNew);
+ if (mxViewIndependentPrimitive2DSequence != xNew)
+ {
+ // has changed, copy content
+ const_cast<ViewContact*>(this)->mxViewIndependentPrimitive2DSequence = std::move(xNew);
+ }
+
+ // return current Primitive2DContainer
+ rVisitor.visit(mxViewIndependentPrimitive2DSequence);
}
// add Gluepoints (if available)