[Libreoffice-commits] core.git: sc/source

Noel Grandin noelgrandin at gmail.com
Wed Oct 18 06:35:52 UTC 2017


 sc/source/filter/dif/difimp.cxx |   10 +++++-----
 sc/source/filter/inc/dif.hxx    |    3 ++-
 2 files changed, 7 insertions(+), 6 deletions(-)

New commits:
commit 77d6f56d70b3a7c43e50c53ff2d78583bb7400e8
Author: Noel Grandin <noelgrandin at gmail.com>
Date:   Tue Oct 17 20:04:17 2017 +0200

    dyncolcontainer: use std::map in DifAttrCache
    
    Change-Id: Ic3280c5548555ceeb722788dc0a90f8898f46c2e
    Reviewed-on: https://gerrit.libreoffice.org/43467
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

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


More information about the Libreoffice-commits mailing list