summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-09-15 12:18:48 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-09-16 14:23:00 +0200
commit2ce8446ac40d5186c54ec26995b8e0989557cbe5 (patch)
treeef7a30639fce0d3dcf5f33dbe06e538e19ca4fdb /sc
parentb49dada831604bbc929323719106c2474ef1102a (diff)
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 <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/column.hxx2
-rw-r--r--sc/source/core/data/column.cxx6
-rw-r--r--sc/source/core/data/table1.cxx4
3 files changed, 6 insertions, 6 deletions
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: */