diff options
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 |