summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-12-08 11:14:47 +0200
committerCaolán McNamara <caolanm@redhat.com>2021-12-10 22:53:09 +0100
commit26259e4089ec0225e84ed99159d85e858f612022 (patch)
tree2f4a8ed694e484564beaa7b5f1a387c505d1492d
parentResolves: tdf#146141 don't double delete comments (diff)
downloadcore-26259e4089ec0225e84ed99159d85e858f612022.tar.gz
core-26259e4089ec0225e84ed99159d85e858f612022.zip
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 (cherry picked from commit 585bf5f2b223a1449dd8f6b65c5f0c0c00160af7) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126598 Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--include/svx/sdr/contact/viewcontact.hxx5
-rw-r--r--svx/source/sdr/contact/viewcontact.cxx14
2 files changed, 18 insertions, 1 deletions
diff --git a/include/svx/sdr/contact/viewcontact.hxx b/include/svx/sdr/contact/viewcontact.hxx
index c7119fcd93e2..eee3ea6f11cb 100644
--- a/include/svx/sdr/contact/viewcontact.hxx
+++ b/include/svx/sdr/contact/viewcontact.hxx
@@ -46,6 +46,11 @@ private:
// Registering and de-registering is done in the VOC constructors/destructors.
std::vector<ViewObjectContact*> maViewObjectContactVector;
+ // Primitive2DContainer of the ViewContact. This contains all necessary information
+ // for the graphical visualisation and needs to be supported by all VCs which
+ // can be visualized.
+ drawinglayer::primitive2d::Primitive2DContainer mxViewIndependentPrimitive2DSequence;
+
// A new ViewObjectContact was created and shall be remembered.
void AddViewObjectContact(ViewObjectContact& rVOContact);
diff --git a/svx/source/sdr/contact/viewcontact.cxx b/svx/source/sdr/contact/viewcontact.cxx
index 1723a6bb91e8..52cca39d7057 100644
--- a/svx/source/sdr/contact/viewcontact.cxx
+++ b/svx/source/sdr/contact/viewcontact.cxx
@@ -104,7 +104,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
@@ -229,6 +231,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());
@@ -238,7 +243,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)