Kaydet (Commit) 77d6f56d authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Noel Grandin

dyncolcontainer: use std::map in DifAttrCache

Change-Id: Ic3280c5548555ceeb722788dc0a90f8898f46c2e
Reviewed-on: https://gerrit.libreoffice.org/43467Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 2ed9c741
...@@ -679,18 +679,18 @@ void DifAttrCache::SetNumFormat( const SCCOL nCol, const SCROW nRow, const sal_u ...@@ -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!" ); OSL_ENSURE( ValidCol(nCol), "-DifAttrCache::SetNumFormat(): Col too big!" );
if( !mvCols[ nCol ] ) if( !maColMap.count(nCol) )
mvCols[ nCol ].reset( new DifColumn ); maColMap[ nCol ].reset( new DifColumn );
mvCols[ nCol ]->SetNumFormat( nRow, nNumFormat ); maColMap[ nCol ]->SetNumFormat( nRow, nNumFormat );
} }
void DifAttrCache::Apply( ScDocument& rDoc, SCTAB nTab ) void DifAttrCache::Apply( ScDocument& rDoc, SCTAB nTab )
{ {
for( SCCOL nCol : rDoc.GetColumnsRange(nTab, 0, MAXCOL) ) for( SCCOL nCol : rDoc.GetColumnsRange(nTab, 0, MAXCOL) )
{ {
if( mvCols[ nCol ] ) if( maColMap.count(nCol) )
mvCols[ nCol ]->Apply( rDoc, nCol, nTab ); maColMap[ nCol ]->Apply( rDoc, nCol, nTab );
} }
} }
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#define INCLUDED_SC_SOURCE_FILTER_INC_DIF_HXX #define INCLUDED_SC_SOURCE_FILTER_INC_DIF_HXX
#include <array> #include <array>
#include <map>
#include <memory> #include <memory>
#include <vector> #include <vector>
...@@ -164,7 +165,7 @@ public: ...@@ -164,7 +165,7 @@ public:
private: private:
std::array<std::unique_ptr<DifColumn>,MAXCOL + 1> mvCols; std::map<SCCOL, std::unique_ptr<DifColumn>> maColMap;
}; };
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment