diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index ee217ba50c82..a4dd113a0cd9 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -276,18 +276,11 @@ public: ScColumn& CreateColumnIfNotExists( const SCCOL nScCol ) { if ( nScCol >= aCol.size() ) - { - const SCCOL aOldColSize = aCol.size(); - bool bUseEmptyAttrArray = false; - if ( aOldColSize == 0 ) - bUseEmptyAttrArray = true; - aCol.resize( static_cast< size_t >( nScCol + 1 ) ); - for (SCCOL i = aOldColSize; i <= nScCol; i++) - aCol[i].Init( i, nTab, pDocument, bUseEmptyAttrArray ); - - } + CreateColumnIfNotExistsImpl(nScCol); return aCol[nScCol]; } + // out-of-line the cold part of the function + void CreateColumnIfNotExistsImpl( const SCCOL nScCol ); sal_uLong GetCellCount() const; sal_uLong GetWeightedCount() const; sal_uLong GetWeightedCount(SCROW nStartRow, SCROW nEndRow) const; diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index 7c5555c9f679..6fb453807604 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -2533,4 +2533,12 @@ ScColumnsRange ScTable::GetColumnsRange(SCCOL nColBegin, SCCOL nColEnd) const ScColumnsRange::Iterator( aCol.begin() + nEffEnd)); } +// out-of-line the cold part of the CreateColumnIfNotExists function +void ScTable::CreateColumnIfNotExistsImpl( const SCCOL nScCol ) +{ + const SCCOL aOldColSize = aCol.size(); + aCol.resize( static_cast< size_t >( nScCol + 1 ) ); + for (SCCOL i = aOldColSize; i <= nScCol; i++) + aCol[i].Init( i, nTab, pDocument, false ); +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */