diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-09-14 16:42:52 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-09-15 21:36:27 +0200 |
commit | bf3d1b8e8f89bfdb409c70cfea126f36474d4772 (patch) | |
tree | 9d496d04fc1bbd76c15ab215f947ac28587f0e1e /sc/source/ui/miscdlgs/highred.cxx | |
parent | 957adc83e67276805c6dcd7be1ea23c142c49306 (diff) |
establish that ScViewData::GetDocument can always return ScDocument&
we can only be ctored with a ScDocShell& or ScDocument&, and ScDocShell
provides a ScDocument& from its GetDocument() so we can always have a
ScDocument& when a public ctor has completed
some null checks can then be seen to be redundant and are removed
Change-Id: Ifaf39cb06e8dbce363999c05ee0aeb3ec4f00428
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102775
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc/source/ui/miscdlgs/highred.cxx')
-rw-r--r-- | sc/source/ui/miscdlgs/highred.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sc/source/ui/miscdlgs/highred.cxx b/sc/source/ui/miscdlgs/highred.cxx index 584119681fa0..c6cc22765e0d 100644 --- a/sc/source/ui/miscdlgs/highred.cxx +++ b/sc/source/ui/miscdlgs/highred.cxx @@ -29,7 +29,7 @@ ScHighlightChgDlg::ScHighlightChgDlg(SfxBindings* pB, SfxChildWindow* pCW, weld: ScViewData* ptrViewData) : ScAnyRefDlgController(pB, pCW, pParent, "modules/scalc/ui/showchangesdialog.ui", "ShowChangesDialog") , pViewData(ptrViewData) - , pDoc(ptrViewData->GetDocument()) + , rDoc(ptrViewData->GetDocument()) , m_xHighlightBox(m_xBuilder->weld_check_button("showchanges")) , m_xCbAccept(m_xBuilder->weld_check_button("showaccepted")) , m_xCbReject(m_xBuilder->weld_check_button("showrejected")) @@ -59,9 +59,9 @@ ScHighlightChgDlg::~ScHighlightChgDlg() void ScHighlightChgDlg::Init() { - OSL_ENSURE( pViewData && pDoc, "ViewData or Document not found!" ); + OSL_ENSURE( pViewData, "ViewData or Document not found!" ); - ScChangeTrack* pChanges=pDoc->GetChangeTrack(); + ScChangeTrack* pChanges = rDoc.GetChangeTrack(); if(pChanges!=nullptr) { aChangeViewSet.SetTheAuthorToShow(pChanges->GetUser()); @@ -71,7 +71,7 @@ void ScHighlightChgDlg::Init() m_xFilterCtr->InsertAuthor(rItem); } - ScChangeViewSettings* pViewSettings=pDoc->GetChangeViewSettings(); + ScChangeViewSettings* pViewSettings = rDoc.GetChangeViewSettings(); if(pViewSettings!=nullptr) aChangeViewSet=*pViewSettings; @@ -116,7 +116,7 @@ void ScHighlightChgDlg::Init() if ( !aChangeViewSet.GetTheRangeList().empty() ) { const ScRange & rRangeEntry = aChangeViewSet.GetTheRangeList().front(); - OUString aRefStr(rRangeEntry.Format(*pDoc, ScRefFlags::RANGE_ABS_3D)); + OUString aRefStr(rRangeEntry.Format(rDoc, ScRefFlags::RANGE_ABS_3D)); m_xFilterCtr->SetRange(aRefStr); } m_xFilterCtr->Enable(true); @@ -212,10 +212,10 @@ IMPL_LINK_NOARG(ScHighlightChgDlg, OKBtnHdl, weld::Button&, void) aChangeViewSet.SetHasComment(m_xFilterCtr->IsComment()); aChangeViewSet.SetTheComment(m_xFilterCtr->GetComment()); ScRangeList aLocalRangeList; - aLocalRangeList.Parse(m_xFilterCtr->GetRange(), *pDoc); + aLocalRangeList.Parse(m_xFilterCtr->GetRange(), rDoc); aChangeViewSet.SetTheRangeList(aLocalRangeList); - aChangeViewSet.AdjustDateMode( *pDoc ); - pDoc->SetChangeViewSettings(aChangeViewSet); + aChangeViewSet.AdjustDateMode( rDoc ); + rDoc.SetChangeViewSettings(aChangeViewSet); pViewData->GetDocShell()->PostPaintGridAll(); response(RET_OK); } |