diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2017-10-17 20:04:17 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-10-18 08:35:25 +0200 |
commit | 77d6f56d70b3a7c43e50c53ff2d78583bb7400e8 (patch) | |
tree | e1a3b6ec1a218b60b96f908a783ee94ee8c348d3 /sc | |
parent | 2ed9c74136b3d20aa837632a1f9ad8259f808e86 (diff) |
dyncolcontainer: use std::map in DifAttrCache
Change-Id: Ic3280c5548555ceeb722788dc0a90f8898f46c2e
Reviewed-on: https://gerrit.libreoffice.org/43467
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/dif/difimp.cxx | 10 | ||||
-rw-r--r-- | sc/source/filter/inc/dif.hxx | 3 |
2 files changed, 7 insertions, 6 deletions
diff --git a/sc/source/filter/dif/difimp.cxx b/sc/source/filter/dif/difimp.cxx index 41a967a19ade..e8bf11420bfd 100644 --- a/sc/source/filter/dif/difimp.cxx +++ b/sc/source/filter/dif/difimp.cxx @@ -679,18 +679,18 @@ void DifAttrCache::SetNumFormat( const SCCOL nCol, const SCROW nRow, const sal_u { OSL_ENSURE( ValidCol(nCol), "-DifAttrCache::SetNumFormat(): Col too big!" ); - if( !mvCols[ nCol ] ) - mvCols[ nCol ].reset( new DifColumn ); + if( !maColMap.count(nCol) ) + maColMap[ nCol ].reset( new DifColumn ); - mvCols[ nCol ]->SetNumFormat( nRow, nNumFormat ); + maColMap[ nCol ]->SetNumFormat( nRow, nNumFormat ); } void DifAttrCache::Apply( ScDocument& rDoc, SCTAB nTab ) { for( SCCOL nCol : rDoc.GetColumnsRange(nTab, 0, MAXCOL) ) { - if( mvCols[ nCol ] ) - mvCols[ nCol ]->Apply( rDoc, nCol, nTab ); + if( maColMap.count(nCol) ) + maColMap[ nCol ]->Apply( rDoc, nCol, nTab ); } } diff --git a/sc/source/filter/inc/dif.hxx b/sc/source/filter/inc/dif.hxx index eeb788ab318f..3c0a99aa5f6a 100644 --- a/sc/source/filter/inc/dif.hxx +++ b/sc/source/filter/inc/dif.hxx @@ -21,6 +21,7 @@ #define INCLUDED_SC_SOURCE_FILTER_INC_DIF_HXX #include <array> +#include <map> #include <memory> #include <vector> @@ -164,7 +165,7 @@ public: private: - std::array<std::unique_ptr<DifColumn>,MAXCOL + 1> mvCols; + std::map<SCCOL, std::unique_ptr<DifColumn>> maColMap; }; #endif |