From 90fbbecb2e80d47106d48c308af5addb3d8db57e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Mon, 14 Sep 2020 10:58:13 +0100 Subject: [PATCH] ScIconSetFrmtDataEntry::CreateEntry always dereferences it ScDocument* arg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I4adee5f3632d4c9a9846f38828c85e39c1f3218d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102663 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- sc/source/ui/condformat/condformatdlgentry.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx index 1bd243ff235e..5836221cba22 100644 --- a/sc/source/ui/condformat/condformatdlgentry.cxx +++ b/sc/source/ui/condformat/condformatdlgentry.cxx @@ -1323,7 +1323,7 @@ public: mxGrid->set_grid_top_attach(nTop); } - ScColorScaleEntry* CreateEntry(ScDocument* pDoc, const ScAddress& rPos) const; + ScColorScaleEntry* CreateEntry(ScDocument& rDoc, const ScAddress& rPos) const; void SetFirstEntry(); }; @@ -1373,7 +1373,7 @@ ScIconSetFrmtDataEntry::~ScIconSetFrmtDataEntry() mpContainer->move(mxGrid.get(), nullptr); } -ScColorScaleEntry* ScIconSetFrmtDataEntry::CreateEntry(ScDocument* pDoc, const ScAddress& rPos) const +ScColorScaleEntry* ScIconSetFrmtDataEntry::CreateEntry(ScDocument& rDoc, const ScAddress& rPos) const { sal_Int32 nPos = mxLbEntryType->get_active(); OUString aText = mxEdEntry->get_text(); @@ -1381,7 +1381,7 @@ ScColorScaleEntry* ScIconSetFrmtDataEntry::CreateEntry(ScDocument* pDoc, const S sal_uInt32 nIndex = 0; double nVal = 0; - SvNumberFormatter* pNumberFormatter = pDoc->GetFormatTable(); + SvNumberFormatter* pNumberFormatter = rDoc.GetFormatTable(); (void)pNumberFormatter->IsNumberFormat(aText, nIndex, nVal); pEntry->SetValue(nVal); @@ -1398,7 +1398,7 @@ ScColorScaleEntry* ScIconSetFrmtDataEntry::CreateEntry(ScDocument* pDoc, const S break; case 3: pEntry->SetType(COLORSCALE_FORMULA); - pEntry->SetFormula(aText, *pDoc, rPos, pDoc->GetGrammar()); + pEntry->SetFormula(aText, rDoc, rPos, rDoc.GetGrammar()); break; default: assert(false); @@ -1516,7 +1516,7 @@ ScFormatEntry* ScIconSetFrmtEntry::GetEntry() const pData->eIconSetType = static_cast(mxLbIconSetType->get_active()); for(const auto& rxEntry : maEntries) { - pData->m_Entries.emplace_back(rxEntry->CreateEntry(mpDoc, maPos)); + pData->m_Entries.emplace_back(rxEntry->CreateEntry(*mpDoc, maPos)); } pFormat->SetIconSetData(pData);