summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/data/colcontainer.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/sc/source/core/data/colcontainer.cxx b/sc/source/core/data/colcontainer.cxx
index a0a9d845772f..f6ef8ff7da17 100644
--- a/sc/source/core/data/colcontainer.cxx
+++ b/sc/source/core/data/colcontainer.cxx
@@ -47,9 +47,10 @@ void ScColContainer::Clear()
void ScColContainer::resize( ScSheetLimits const & rSheetLimits, const size_t aNewColSize )
{
size_t aOldColSize = aCols.size();
- aCols.resize( aNewColSize );
+ if (aNewColSize > aCols.capacity())
+ aCols.reserve( aNewColSize );
for ( size_t nCol = aOldColSize; nCol < aNewColSize; ++nCol )
- aCols[nCol].reset(new ScColumn(rSheetLimits));
+ aCols.emplace_back(new ScColumn(rSheetLimits));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */