[Libreoffice-commits] core.git: Branch 'private/kohei/xlsx-import-speedup' - sc/source

Kohei Yoshida kohei.yoshida at collabora.com
Tue Nov 5 21:04:28 CET 2013


 sc/source/filter/inc/formulabuffer.hxx |   18 +++++++-----------
 sc/source/filter/oox/formulabuffer.cxx |    6 ++----
 2 files changed, 9 insertions(+), 15 deletions(-)

New commits:
commit b2913e1fa1c988213718e256ebfd2d2631e59d77
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Tue Nov 5 14:55:21 2013 -0500

    Keep the integer type in sync and remove unused data members.
    
    Change-Id: Iaaf1ebddd3b946b3211952729d41b01f0967f374

diff --git a/sc/source/filter/inc/formulabuffer.hxx b/sc/source/filter/inc/formulabuffer.hxx
index dbb77bb..f9e5229 100644
--- a/sc/source/filter/inc/formulabuffer.hxx
+++ b/sc/source/filter/inc/formulabuffer.hxx
@@ -74,30 +74,26 @@ class FormulaBuffer : public WorkbookHelper
         TokenRangeAddressItem( const TokenAddressItem& rTokenAndAddress, const ::com::sun::star::table::CellRangeAddress& rCellRangeAddress ) : maTokenAndAddress( rTokenAndAddress ), maCellRangeAddress( rCellRangeAddress ) {}
     };
 
-    typedef ::std::map< sal_Int32, std::vector< TokenAddressItem > > FormulaDataMap;
-    typedef ::std::map< sal_Int32, std::vector< TokenRangeAddressItem > > ArrayFormulaDataMap;
+    typedef ::std::map< SCTAB, std::vector<TokenAddressItem> > FormulaDataMap;
+    typedef ::std::map< SCTAB, std::vector<TokenRangeAddressItem> > ArrayFormulaDataMap;
     // sheet -> list of shared formula descriptions
-    typedef ::std::map< sal_Int32, std::vector< SharedFormulaDesc > > SheetToSharedFormulaid;
+    typedef ::std::map< SCTAB, std::vector<SharedFormulaDesc> > SheetToSharedFormulaid;
     // sheet -> stuff needed to create shared formulae
-    typedef ::std::map< sal_Int32, std::vector< SharedFormulaEntry > >  SheetToFormulaEntryMap;
-    // sharedId -> tokedId
-    typedef ::std::map< sal_Int32, sal_Int32 > SharedIdToTokenIndex;
-    typedef ::std::map< sal_Int32, SharedIdToTokenIndex > SheetToSharedIdToTokenIndex;
+    typedef ::std::map< SCTAB, std::vector<SharedFormulaEntry> >  SheetToFormulaEntryMap;
+
     typedef ::std::pair< ::com::sun::star::table::CellAddress, double > ValueAddressPair;
-    typedef ::std::map< sal_Int32, std::vector< ValueAddressPair > > FormulaValueMap;
+    typedef ::std::map< SCTAB, std::vector<ValueAddressPair> > FormulaValueMap;
 
-    com::sun::star::uno::Reference< com::sun::star::sheet::XSpreadsheet > mxCurrSheet;
     FormulaDataMap maCellFormulas;
     ArrayFormulaDataMap maCellArrayFormulas;
     SheetToFormulaEntryMap maSharedFormulas;
     SheetToSharedFormulaid maSharedFormulaIds;
-    SheetToSharedIdToTokenIndex maTokenIndexes;
     FormulaValueMap maCellFormulaValues;
 
     void                applyArrayFormulas(  const std::vector< TokenRangeAddressItem >& rVector );
     void                applyCellFormulas(  const std::vector< TokenAddressItem >& rVector );
     void                applyCellFormulaValues( const std::vector< ValueAddressPair >& rVector );
-    void applySharedFormulas( sal_Int32 nTab );
+    void applySharedFormulas( SCTAB nTab );
 
 public:
     explicit            FormulaBuffer( const WorkbookHelper& rHelper );
diff --git a/sc/source/filter/oox/formulabuffer.cxx b/sc/source/filter/oox/formulabuffer.cxx
index 68e1d2e..04be139 100644
--- a/sc/source/filter/oox/formulabuffer.cxx
+++ b/sc/source/filter/oox/formulabuffer.cxx
@@ -54,13 +54,11 @@ void FormulaBuffer::finalizeImport()
     ISegmentProgressBarRef xFormulaBar = getProgressBar().createSegment( getProgressBar().getFreeLength() );
 
     ScDocument& rDoc = getScDocument();
-    Reference< XIndexAccess > xSheets( getDocument()->getSheets(), UNO_QUERY_THROW );
     rDoc.SetAutoNameCache( new ScAutoNameCache( &rDoc ) );
-    for ( sal_Int32 nTab = 0, nElem = xSheets->getCount(); nTab < nElem; ++nTab )
+    for (SCTAB nTab = 0, nElem = rDoc.GetTableCount(); nTab < nElem; ++nTab)
     {
         double fPosition = static_cast< double> (nTab + 1) /static_cast<double>(nElem);
         xFormulaBar->setPosition( fPosition );
-        mxCurrSheet = getSheetFromDoc( nTab );
 
         applySharedFormulas(nTab);
 
@@ -122,7 +120,7 @@ void FormulaBuffer::applyCellFormulaValues( const std::vector< ValueAddressPair
     }
 }
 
-void FormulaBuffer::applySharedFormulas( sal_Int32 nTab )
+void FormulaBuffer::applySharedFormulas( SCTAB nTab )
 {
     SheetToFormulaEntryMap::const_iterator itShared = maSharedFormulas.find(nTab);
     if (itShared == maSharedFormulas.end())


More information about the Libreoffice-commits mailing list