summaryrefslogtreecommitdiff
path: root/sc/source
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/source
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/source')
-rw-r--r--sc/source/core/data/column.cxx6
-rw-r--r--sc/source/core/data/table1.cxx4
2 files changed, 5 insertions, 5 deletions
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: */