[Libreoffice-commits] core.git: include/svx svx/source

Noel Grandin noel.grandin at collabora.co.uk
Mon Apr 10 11:41:35 UTC 2017


 include/svx/svdmrkv.hxx       |   21 ++++++++++-----------
 svx/source/svdraw/svdmrkv.cxx |    6 ++----
 2 files changed, 12 insertions(+), 15 deletions(-)

New commits:
commit 6bd33bd263c6666824d0d540395a4df4ae7d1d7b
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Mon Apr 10 09:49:17 2017 +0200

    loplugin:inlinefields in SdrMarkView
    
    Change-Id: I2662c7dbae0189fe2057149d825df39bb976a295
    Reviewed-on: https://gerrit.libreoffice.org/36354
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/svx/svdmrkv.hxx b/include/svx/svdmrkv.hxx
index 246ba6061e8f..192f26b2b393 100644
--- a/include/svx/svdmrkv.hxx
+++ b/include/svx/svdmrkv.hxx
@@ -107,12 +107,12 @@ protected:
     Point                       maRef2;            // Persistent
     Point                       maLastCrookCenter; // Persistent
     SdrHdlList                  maHdlList;
-    sdr::ViewSelection*         mpSdrViewSelection;
+    sdr::ViewSelection          maSdrViewSelection;
 
-    tools::Rectangle                   maMarkedObjRect;
-    tools::Rectangle                   maMarkedObjRectNoOffset;
-    tools::Rectangle                   maMarkedPointsRect;
-    tools::Rectangle                   maMarkedGluePointsRect;
+    tools::Rectangle            maMarkedObjRect;
+    tools::Rectangle            maMarkedObjRectNoOffset;
+    tools::Rectangle            maMarkedPointsRect;
+    tools::Rectangle            maMarkedGluePointsRect;
 
     sal_uInt16                  mnFrameHandlesLimit;
     sal_uIntPtr                 mnInsPointNum;      // Number of the InsPoint
@@ -121,7 +121,6 @@ protected:
     SdrViewEditMode             meEditMode;      // Persistent
     SdrViewEditMode             meEditMode0;     // Persistent
 
-    //HMHbool                       bHdlShown : 1;
     bool                        mbDesignMode : 1;          // DesignMode for SdrUnoObj
     bool                        mbForceFrameHandles : 1;   // Persistent - FrameDrag also for single objects
     bool                        mbPlusHdlAlways : 1;       // Persistent
@@ -228,11 +227,11 @@ public:
 
 protected:
     // all available changing methods
-    SdrMarkList& GetMarkedObjectListWriteAccess() { return mpSdrViewSelection->GetMarkedObjectListWriteAccess(); }
+    SdrMarkList& GetMarkedObjectListWriteAccess() { return maSdrViewSelection.GetMarkedObjectListWriteAccess(); }
 
 public:
     // all available const methods for read access to selection
-    const SdrMarkList& GetMarkedObjectList() const { return mpSdrViewSelection->GetMarkedObjectList(); }
+    const SdrMarkList& GetMarkedObjectList() const { return maSdrViewSelection.GetMarkedObjectList(); }
     // returns SAL_MAX_SIZE if not found
     size_t TryToFindMarkedObject(const SdrObject* pObj) const { return GetMarkedObjectList().FindObject(pObj); }
     SdrPageView* GetSdrPageViewOfMarkedByIndex(size_t nNum) const { return GetMarkedObjectList().GetMark(nNum)->GetPageView(); }
@@ -247,9 +246,9 @@ public:
 
     // Get a list of all those links which are connected to marked nodes,
     // but which are not marked themselves.
-    const SdrMarkList& GetEdgesOfMarkedNodes() const { return mpSdrViewSelection->GetEdgesOfMarkedNodes(); }
-    const SdrMarkList& GetMarkedEdgesOfMarkedNodes() const { return mpSdrViewSelection->GetMarkedEdgesOfMarkedNodes(); }
-    const std::vector<SdrObject*>& GetTransitiveHullOfMarkedObjects() const { return mpSdrViewSelection->GetAllMarkedObjects(); }
+    const SdrMarkList& GetEdgesOfMarkedNodes() const { return maSdrViewSelection.GetEdgesOfMarkedNodes(); }
+    const SdrMarkList& GetMarkedEdgesOfMarkedNodes() const { return maSdrViewSelection.GetMarkedEdgesOfMarkedNodes(); }
+    const std::vector<SdrObject*>& GetTransitiveHullOfMarkedObjects() const { return maSdrViewSelection.GetAllMarkedObjects(); }
 
 
     // mechanism to complete disable handles at the view. Handles will be hidden and deleted
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index 5d007aff7966..478b0cbb65b7 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -151,8 +151,7 @@ SdrMarkView::SdrMarkView(SdrModel* pModel1, OutputDevice* pOut)
     mpMarkObjOverlay(nullptr),
     mpMarkPointsOverlay(nullptr),
     mpMarkGluePointsOverlay(nullptr),
-    maHdlList(this),
-    mpSdrViewSelection(new sdr::ViewSelection())
+    maHdlList(this)
 {
     ImpClearVars();
     StartListening(*pModel1);
@@ -164,7 +163,6 @@ SdrMarkView::~SdrMarkView()
     BrkMarkObj();
     BrkMarkPoints();
     BrkMarkGluePoints();
-    delete mpSdrViewSelection;
 }
 
 void SdrMarkView::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
@@ -2084,7 +2082,7 @@ void SdrMarkView::EnterMarkedGroup()
 void SdrMarkView::MarkListHasChanged()
 {
     GetMarkedObjectListWriteAccess().SetNameDirty();
-    mpSdrViewSelection->SetEdgesOfMarkedNodesDirty();
+    maSdrViewSelection.SetEdgesOfMarkedNodesDirty();
 
     mbMarkedObjRectDirty=true;
     mbMarkedPointsRectsDirty=true;


More information about the Libreoffice-commits mailing list