[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - include/svx svx/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Fri Apr 23 13:56:48 UTC 2021


 include/svx/sdr/contact/viewcontact.hxx |    8 +-------
 svx/source/sdr/contact/viewcontact.cxx  |   15 ++-------------
 2 files changed, 3 insertions(+), 20 deletions(-)

New commits:
commit 57c40329a2b469813a1f357de355a37c8e3077ae
Author:     Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Sat Apr 17 14:46:59 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Apr 23 15:56:14 2021 +0200

    tdf#136058: remove some caching
    
    if we going to recreate it every time we call this method,
    there is no point in caching the result.
    
    Change-Id: Ie1f7bde86eca5cdd998fa8626303d3dead479ad3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114231
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    (cherry picked from commit b236b36475ed9a204ac931c34ccc23205296a0a6)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114508
    Tested-by: Xisco Fauli <xiscofauli at libreoffice.org>
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/include/svx/sdr/contact/viewcontact.hxx b/include/svx/sdr/contact/viewcontact.hxx
index c5cc61883a49..c7119fcd93e2 100644
--- a/include/svx/sdr/contact/viewcontact.hxx
+++ b/include/svx/sdr/contact/viewcontact.hxx
@@ -46,11 +46,6 @@ 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);
 
@@ -123,8 +118,7 @@ public:
 
     // access to the local primitive. This will ensure that the primitive is
     // current in comparing the local one with a fresh created incarnation
-    drawinglayer::primitive2d::Primitive2DContainer const&
-    getViewIndependentPrimitive2DContainer() const;
+    drawinglayer::primitive2d::Primitive2DContainer getViewIndependentPrimitive2DContainer() const;
 
     // add Gluepoints (if available)
     virtual drawinglayer::primitive2d::Primitive2DContainer
diff --git a/svx/source/sdr/contact/viewcontact.cxx b/svx/source/sdr/contact/viewcontact.cxx
index 8e8d35db4406..0d1a9f0cb085 100644
--- a/svx/source/sdr/contact/viewcontact.cxx
+++ b/svx/source/sdr/contact/viewcontact.cxx
@@ -38,7 +38,6 @@ ViewObjectContact& ViewContact::CreateObjectSpecificViewObjectContact(ObjectCont
 
 ViewContact::ViewContact()
     : maViewObjectContactVector()
-    , mxViewIndependentPrimitive2DSequence()
 {
 }
 
@@ -105,9 +104,7 @@ 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,10 +223,9 @@ ViewContact::createViewIndependentPrimitive2DSequence() const
     return drawinglayer::primitive2d::Primitive2DContainer{ xReference };
 }
 
-drawinglayer::primitive2d::Primitive2DContainer const&
+drawinglayer::primitive2d::Primitive2DContainer
 ViewContact::getViewIndependentPrimitive2DContainer() const
 {
-    // local up-to-date checks. Create new list and compare.
     drawinglayer::primitive2d::Primitive2DContainer xNew(
         createViewIndependentPrimitive2DSequence());
 
@@ -239,14 +235,7 @@ ViewContact::getViewIndependentPrimitive2DContainer() const
         xNew = embedToObjectSpecificInformation(std::move(xNew));
     }
 
-    if (mxViewIndependentPrimitive2DSequence != xNew)
-    {
-        // has changed, copy content
-        const_cast<ViewContact*>(this)->mxViewIndependentPrimitive2DSequence = std::move(xNew);
-    }
-
-    // return current Primitive2DContainer
-    return mxViewIndependentPrimitive2DSequence;
+    return xNew;
 }
 
 // add Gluepoints (if available)


More information about the Libreoffice-commits mailing list