diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-09-22 20:44:41 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-09-23 09:41:31 +0200 |
commit | 02ab482b8fb8faa04e62f97d952f7e98cf0490fb (patch) | |
tree | ef8535acbd906fe8e0c7279983d0604e3722a04c /sc/source/ui | |
parent | 8db6083692e92389d50565bbf8643c60572e4aca (diff) |
ScRefAddress::GetRefString never passed a null ScDocument*
so the nullptr check can be removed
and some more along that vein
Change-Id: Ic0c1f98564b6bd457edd0d3ba2a4382b7945e806
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103217
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc/source/ui')
-rw-r--r-- | sc/source/ui/attrdlg/scdlgfact.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/attrdlg/scdlgfact.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/condformat/condformatmgr.cxx | 10 | ||||
-rw-r--r-- | sc/source/ui/formdlg/formula.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/inc/condformatmgr.hxx | 6 | ||||
-rw-r--r-- | sc/source/ui/view/cellsh1.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/viewfun2.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/viewfunc.cxx | 4 |
8 files changed, 16 insertions, 16 deletions
diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx index a9e9ae359993..fc68fdcac16b 100644 --- a/sc/source/ui/attrdlg/scdlgfact.cxx +++ b/sc/source/ui/attrdlg/scdlgfact.cxx @@ -973,9 +973,9 @@ VclPtr<AbstractScSortWarningDlg> ScAbstractDialogFactory_Impl::CreateScSortWarni return VclPtr<AbstractScSortWarningDlg_Impl>::Create(std::make_unique<ScSortWarningDlg>(pParent, rExtendText, rCurrentText)); } -VclPtr<AbstractScCondFormatManagerDlg> ScAbstractDialogFactory_Impl::CreateScCondFormatMgrDlg(weld::Window* pParent, ScDocument* pDoc, const ScConditionalFormatList* pFormatList ) +VclPtr<AbstractScCondFormatManagerDlg> ScAbstractDialogFactory_Impl::CreateScCondFormatMgrDlg(weld::Window* pParent, ScDocument& rDoc, const ScConditionalFormatList* pFormatList ) { - return VclPtr<AbstractScCondFormatManagerDlg_Impl>::Create(std::make_shared<ScCondFormatManagerDlg>(pParent, pDoc, pFormatList)); + return VclPtr<AbstractScCondFormatManagerDlg_Impl>::Create(std::make_shared<ScCondFormatManagerDlg>(pParent, rDoc, pFormatList)); } VclPtr<AbstractScDataPilotDatabaseDlg> ScAbstractDialogFactory_Impl::CreateScDataPilotDatabaseDlg(weld::Window* pParent) diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx index 65853602d8c5..fc2e992ee4be 100644 --- a/sc/source/ui/attrdlg/scdlgfact.hxx +++ b/sc/source/ui/attrdlg/scdlgfact.hxx @@ -690,7 +690,7 @@ public: virtual VclPtr<AbstractScSortWarningDlg> CreateScSortWarningDlg(weld::Window* pParent, const OUString& rExtendText, const OUString& rCurrentText ) override; - virtual VclPtr<AbstractScCondFormatManagerDlg> CreateScCondFormatMgrDlg(weld::Window* pParent, ScDocument* pDoc, const ScConditionalFormatList* pFormatList ) override; + virtual VclPtr<AbstractScCondFormatManagerDlg> CreateScCondFormatMgrDlg(weld::Window* pParent, ScDocument& rDoc, const ScConditionalFormatList* pFormatList ) override; virtual VclPtr<AbstractScDataPilotDatabaseDlg> CreateScDataPilotDatabaseDlg(weld::Window* pParent) override; diff --git a/sc/source/ui/condformat/condformatmgr.cxx b/sc/source/ui/condformat/condformatmgr.cxx index 03e691ac2ed8..4e9e3224ab94 100644 --- a/sc/source/ui/condformat/condformatmgr.cxx +++ b/sc/source/ui/condformat/condformatmgr.cxx @@ -16,9 +16,9 @@ #include <conditio.hxx> ScCondFormatManagerWindow::ScCondFormatManagerWindow(weld::TreeView& rTreeView, - ScDocument* pDoc, ScConditionalFormatList* pFormatList) + ScDocument& rDoc, ScConditionalFormatList* pFormatList) : mrTreeView(rTreeView) - , mpDoc(pDoc) + , mrDoc(rDoc) , mpFormatList(pFormatList) { mrTreeView.set_size_request(mrTreeView.get_approximate_digit_width() * 70, @@ -41,7 +41,7 @@ void ScCondFormatManagerWindow::Init() for(const auto& rItem : *mpFormatList) { const ScRangeList& aRange = rItem->GetRange(); - aRange.Format(sRangeStr, ScRefFlags::VALID, *mpDoc, mpDoc->GetAddressConvention()); + aRange.Format(sRangeStr, ScRefFlags::VALID, mrDoc, mrDoc.GetAddressConvention()); mrTreeView.append(OUString::number(rItem->GetKey()), sRangeStr); mrTreeView.set_text(nRow, ScCondFormatHelper::GetExpression(*rItem, aRange.GetTopLeftCorner()), 1); ++nRow; @@ -83,7 +83,7 @@ void ScCondFormatManagerWindow::setColSizes() mrTreeView.set_column_fixed_widths(aWidths); } -ScCondFormatManagerDlg::ScCondFormatManagerDlg(weld::Window* pParent, ScDocument* pDoc, const ScConditionalFormatList* pFormatList) +ScCondFormatManagerDlg::ScCondFormatManagerDlg(weld::Window* pParent, ScDocument& rDoc, const ScConditionalFormatList* pFormatList) : GenericDialogController(pParent, "modules/scalc/ui/condformatmanager.ui", "CondFormatManager") , m_bModified(false) , m_xFormatList( pFormatList ? new ScConditionalFormatList(*pFormatList) : nullptr) @@ -91,7 +91,7 @@ ScCondFormatManagerDlg::ScCondFormatManagerDlg(weld::Window* pParent, ScDocument , m_xBtnRemove(m_xBuilder->weld_button("remove")) , m_xBtnEdit(m_xBuilder->weld_button("edit")) , m_xTreeView(m_xBuilder->weld_tree_view("CONTAINER")) - , m_xCtrlManager(new ScCondFormatManagerWindow(*m_xTreeView, pDoc, m_xFormatList.get())) + , m_xCtrlManager(new ScCondFormatManagerWindow(*m_xTreeView, rDoc, m_xFormatList.get())) { m_xBtnRemove->connect_clicked(LINK(this, ScCondFormatManagerDlg, RemoveBtnHdl)); m_xBtnEdit->connect_clicked(LINK(this, ScCondFormatManagerDlg, EditBtnClickHdl)); diff --git a/sc/source/ui/formdlg/formula.cxx b/sc/source/ui/formdlg/formula.cxx index 20f60edbc6c4..e150cfa1e9bd 100644 --- a/sc/source/ui/formdlg/formula.cxx +++ b/sc/source/ui/formdlg/formula.cxx @@ -442,7 +442,7 @@ void ScFormulaDlg::SetReference( const ScRange& rRef, ScDocument& rRefDoc ) // position. ScTokenArray aArray(rRefDoc); ScComplexRefData aRefData; - aRefData.InitRangeRel(&rRefDoc, rRef, m_CursorPos); + aRefData.InitRangeRel(rRefDoc, rRef, m_CursorPos); if ((eRangeFlags & eColFlags) == eColFlags) { aRefData.Ref1.SetAbsCol( rRef.aStart.Col() ); diff --git a/sc/source/ui/inc/condformatmgr.hxx b/sc/source/ui/inc/condformatmgr.hxx index f24f57952a33..2e7eaa54eaa9 100644 --- a/sc/source/ui/inc/condformatmgr.hxx +++ b/sc/source/ui/inc/condformatmgr.hxx @@ -25,11 +25,11 @@ private: void setColSizes(); weld::TreeView& mrTreeView; - ScDocument* mpDoc; + ScDocument& mrDoc; ScConditionalFormatList* mpFormatList; public: - ScCondFormatManagerWindow(weld::TreeView& rTreeView, ScDocument* pDoc, ScConditionalFormatList* pFormatList); + ScCondFormatManagerWindow(weld::TreeView& rTreeView, ScDocument& rDoc, ScConditionalFormatList* pFormatList); void DeleteSelection(); ScConditionalFormat* GetSelection(); @@ -38,7 +38,7 @@ public: class ScCondFormatManagerDlg : public weld::GenericDialogController { public: - ScCondFormatManagerDlg(weld::Window* pParent, ScDocument* pDoc, const ScConditionalFormatList* pFormatList); + ScCondFormatManagerDlg(weld::Window* pParent, ScDocument& rDoc, const ScConditionalFormatList* pFormatList); virtual ~ScCondFormatManagerDlg() override; std::unique_ptr<ScConditionalFormatList> GetConditionalFormatList(); diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 8492d8d4e227..a55673827585 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -2614,7 +2614,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) pList = rDoc.GetCondFormList( aPos.Tab() ); VclPtr<AbstractScCondFormatManagerDlg> pDlg(pFact->CreateScCondFormatMgrDlg( - pTabViewShell->GetFrameWeld(), &rDoc, pList)); + pTabViewShell->GetFrameWeld(), rDoc, pList)); if (pDlgItem) pDlg->SetModified(); diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx index c0f28d7017a8..0d981959ca59 100644 --- a/sc/source/ui/view/viewfun2.cxx +++ b/sc/source/ui/view/viewfun2.cxx @@ -831,7 +831,7 @@ OUString ScViewFunc::GetAutoSumFormula( const ScRangeList& rRangeList, bool bSub if (i != 0) pArray->AddOpCode(ocSep); ScComplexRefData aRef; - aRef.InitRangeRel(&rDoc, r, rAddr); + aRef.InitRangeRel(rDoc, r, rAddr); pArray->AddDoubleReference(aRef); } } diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index 31a357325aa5..b15e7751b752 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -1500,7 +1500,7 @@ void ScViewFunc::OnLOKInsertDeleteColumn(SCCOL nStartCol, long nOffset) aMultiMark.MarkToMulti(); if (aMultiMark.IsMultiMarked()) { - aMultiMark.ShiftCols(&pTabViewShell->GetViewData().GetDocument(), nStartCol, nOffset); + aMultiMark.ShiftCols(pTabViewShell->GetViewData().GetDocument(), nStartCol, nOffset); pTabViewShell->SetMarkData(aMultiMark); } } @@ -1556,7 +1556,7 @@ void ScViewFunc::OnLOKInsertDeleteRow(SCROW nStartRow, long nOffset) aMultiMark.MarkToMulti(); if (aMultiMark.IsMultiMarked()) { - aMultiMark.ShiftRows(&pTabViewShell->GetViewData().GetDocument(), nStartRow, nOffset); + aMultiMark.ShiftRows(pTabViewShell->GetViewData().GetDocument(), nStartRow, nOffset); pTabViewShell->SetMarkData(aMultiMark); } } |