diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2023-01-30 20:14:10 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2023-01-31 07:21:39 +0000 |
commit | 1e92059fe95cc1ba31aab4a66926d55bc00d0684 (patch) | |
tree | f6d6523928daff96ff0a2d15ab923c4777ab09e7 /include/svx/svdpntv.hxx | |
parent | d9ebb2e76bf7ec068ebfceccf7f477471012d157 (diff) |
svx: Refactor (sdr) views to access the SdrModel by reference
In SdrPaintView (and subclasses) the mpModel variable is always
the same as the input (reference) model, so there is no need for
that extra variable.
Change the strange and confusing var. name mrSdrModelFromSdrView
(the input reference to SdrModel) to just mrModel and use that in
GetModel(). Change the GetModel() to return a reference instead
of a pointer and reactor the code to accomodate the change.
This gets rid of many nullptr checks for the pointer that the
GetModel() returns and makes the code more simple is some cases.
Change-Id: I18351a417fd82f49262a83de036ec1420a65399c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146373
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'include/svx/svdpntv.hxx')
-rw-r--r-- | include/svx/svdpntv.hxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/svx/svdpntv.hxx b/include/svx/svdpntv.hxx index 7e49d959232b..f6be42ee1e9a 100644 --- a/include/svx/svdpntv.hxx +++ b/include/svx/svdpntv.hxx @@ -118,11 +118,10 @@ private: friend class SdrGrafObj; // the SdrModel this view was created with, unchanged during lifetime - SdrModel& mrSdrModelFromSdrView; + SdrModel& mrModel; std::unique_ptr<SdrPageView> mpPageView; protected: - SdrModel* mpModel; VclPtr<OutputDevice> mpActualOutDev; // Only for comparison VclPtr<OutputDevice> mpDragWin; SfxStyleSheet* mpDefaultStyleSheet; @@ -255,10 +254,11 @@ protected: public: // SdrModel access on SdrView level - SdrModel& getSdrModelFromSdrView() const { return mrSdrModelFromSdrView; } + SdrModel& getSdrModelFromSdrView() const { return mrModel; } + + SdrModel& GetModel() const { return mrModel; } virtual void ClearPageView(); - SdrModel* GetModel() const { return mpModel; } virtual bool IsAction() const; virtual void MovAction(const Point& rPnt); |