sc/inc/column.hxx | 2 +- sc/source/core/data/column.cxx | 6 +++--- sc/source/core/data/table1.cxx | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-)
New commits: commit 2ce8446ac40d5186c54ec26995b8e0989557cbe5 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Tue Sep 15 12:18:48 2020 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Wed Sep 16 14:23:00 2020 +0200 ScColumn::ScColumn never called with a null ScDocument* Change-Id: I125d0e7571e3c34fbaab0fd024a67cbb518fdf64 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102845 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index 25f8e1430906..aeb978fbc391 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -177,7 +177,7 @@ public: ScColumn(ScSheetLimits const &); ~ScColumn() COVERITY_NOEXCEPT_FALSE; - void Init(SCCOL nNewCol, SCTAB nNewTab, ScDocument* pDoc, bool bEmptyAttrArray); + void Init(SCCOL nNewCol, SCTAB nNewTab, ScDocument& rDoc, bool bEmptyAttrArray); ScDocument* GetDoc() const { return pAttrArray->GetDoc(); } SCTAB GetTab() const { return nTab; } diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index f2f8374df0c8..e3adff2de24f 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -95,14 +95,14 @@ ScColumn::~ScColumn() COVERITY_NOEXCEPT_FALSE FreeAll(); } -void ScColumn::Init(SCCOL nNewCol, SCTAB nNewTab, ScDocument* pDoc, bool bEmptyAttrArray) +void ScColumn::Init(SCCOL nNewCol, SCTAB nNewTab, ScDocument& rDoc, bool bEmptyAttrArray) { nCol = nNewCol; nTab = nNewTab; if ( bEmptyAttrArray ) - pAttrArray.reset(new ScAttrArray( nCol, nTab, pDoc, nullptr )); + pAttrArray.reset(new ScAttrArray( nCol, nTab, &rDoc, nullptr )); else - pAttrArray.reset(new ScAttrArray( nCol, nTab, pDoc, &pDoc->maTabs[nTab]->aDefaultColAttrArray )); + pAttrArray.reset(new ScAttrArray( nCol, nTab, &rDoc, &rDoc.maTabs[nTab]->aDefaultColAttrArray )); } SCROW ScColumn::GetNextUnprotected( SCROW nRow, bool bUp ) const diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index 331b5a7c3513..af5f34f5d3b0 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -305,7 +305,7 @@ ScTable::ScTable( ScDocument& rDoc, SCTAB nNewTab, const OUString& rNewName, } for (SCCOL k=0; k < aCol.size(); k++) - aCol[k].Init( k, nTab, &rDocument, true ); + aCol[k].Init( k, nTab, rDocument, true ); } ScTable::~ScTable() COVERITY_NOEXCEPT_FALSE @@ -2619,6 +2619,6 @@ void ScTable::CreateColumnIfNotExistsImpl( const SCCOL nScCol ) const const SCCOL aOldColSize = aCol.size(); aCol.resize( rDocument.GetSheetLimits(), static_cast< size_t >( nScCol + 1 ) ); for (SCCOL i = aOldColSize; i <= nScCol; i++) - aCol[i].Init( i, nTab, &rDocument, false ); + aCol[i].Init( i, nTab, rDocument, false ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits