tdf#54857 improve resizing of columns

repeated calls to resize() means we bypass the normal doubling behaviour
of the vector, so rather let it do it's own thing.

Change-Id: I7b4273d20b6cdcac6aeddd61395fbe64de004c9f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142176
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
diff --git a/sc/source/core/data/colcontainer.cxx b/sc/source/core/data/colcontainer.cxx
index a0a9d84..f6ef8ff 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: */