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 /sw/source/uibase/shells/drwtxtsh.cxx | |
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 'sw/source/uibase/shells/drwtxtsh.cxx')
-rw-r--r-- | sw/source/uibase/shells/drwtxtsh.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sw/source/uibase/shells/drwtxtsh.cxx b/sw/source/uibase/shells/drwtxtsh.cxx index 8f86fb5fc9d1..4d5ace48ab46 100644 --- a/sw/source/uibase/shells/drwtxtsh.cxx +++ b/sw/source/uibase/shells/drwtxtsh.cxx @@ -435,7 +435,7 @@ void SwDrawTextShell::ExecDraw(SfxRequest &rReq) break; case FN_DRAWTEXT_ATTR_DLG: { - SfxItemSet aNewAttr( m_pSdrView->GetModel()->GetItemPool() ); + SfxItemSet aNewAttr(m_pSdrView->GetModel().GetItemPool()); m_pSdrView->GetAttributes( aNewAttr ); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateTextTabDialog( @@ -466,7 +466,7 @@ void SwDrawTextShell::ExecDraw(SfxRequest &rReq) else if (nSId == SID_TABLE_VERT_BOTTOM) eTVA = SDRTEXTVERTADJUST_BOTTOM; - SfxItemSet aNewAttr( m_pSdrView->GetModel()->GetItemPool() ); + SfxItemSet aNewAttr(m_pSdrView->GetModel().GetItemPool()); m_pSdrView->GetAttributes( aNewAttr ); aNewAttr.Put(SdrTextVertAdjustItem(eTVA)); m_pSdrView->SetAttributes(aNewAttr); @@ -802,7 +802,7 @@ void SwDrawTextShell::GetStatePropPanelAttr(SfxItemSet &rSet) SwWrtShell &rSh = GetShell(); m_pSdrView = rSh.GetDrawView(); - SfxItemSet aAttrs( m_pSdrView->GetModel()->GetItemPool() ); + SfxItemSet aAttrs(m_pSdrView->GetModel().GetItemPool()); m_pSdrView->GetAttributes( aAttrs ); while ( nWhich ) |