View | Details | Raw Unified | Return to issue 120839
Collapse All | Expand All

(-)old/sc/source/filter/excel/read.cxx (-8 / +12 lines)
Lines 19-31 Link Here
19
 * 
19
 * 
20
 *************************************************************/
20
 *************************************************************/
21
21
22
23
24
// MARKER(update_precomp.py): autogen include statement, do not remove
22
// MARKER(update_precomp.py): autogen include statement, do not remove
25
#include "precompiled_sc.hxx"
23
#include "precompiled_sc.hxx"
26
24
27
28
29
//------------------------------------------------------------------------
25
//------------------------------------------------------------------------
30
26
31
#include <stdlib.h>
27
#include <stdlib.h>
Lines 1017-1023 FltError ImportExcel8::Read( void ) Link Here
1017
                        {
1013
                        {
1018
                            rNumFmtBfr.CreateScFormats();
1014
                            rNumFmtBfr.CreateScFormats();
1019
                            rXFBfr.CreateUserStyles();
1015
                            rXFBfr.CreateUserStyles();
1020
                            rPTableMgr.ReadPivotCaches( maStrm );
1016
                            //rPTableMgr.ReadPivotCaches( maStrm );
1021
                            eAkt = EXC_STATE_BEFORE_SHEET;
1017
                            eAkt = EXC_STATE_BEFORE_SHEET;
1022
                        }
1018
                        }
1023
                    break;
1019
                    break;
Lines 1203-1210 FltError ImportExcel8::Read( void ) Link Here
1203
        // #i45843# Convert pivot tables before calculation, so they are available
1199
        // #i45843# Convert pivot tables before calculation, so they are available
1204
        // for the GETPIVOTDATA function.
1200
        // for the GETPIVOTDATA function.
1205
        if( GetBiff() == EXC_BIFF8 )
1201
        if( GetBiff() == EXC_BIFF8 )
1206
            GetPivotTableManager().ConvertPivotTables();
1202
//            GetPivotTableManager().ConvertPivotTables();
1203
        {
1204
            SCTAB nTabCount = GetDoc().GetTableCount();
1205
1206
            GetPivotTableManager().ConvertPivotTables( maStrm );
1207
1207
1208
            for( SCTAB nDummyTab = GetDoc().GetTableCount() - 1; nDummyTab >= nTabCount; nDummyTab-- )
1209
                GetDoc().DeleteTab( nDummyTab );
1210
        }
1208
        pProgress.reset();
1211
        pProgress.reset();
1209
1212
1210
        if (pD->IsAdjustHeightEnabled())
1213
        if (pD->IsAdjustHeightEnabled())
Lines 1226-1233 FltError ImportExcel8::Read( void ) Link Here
1226
        else if( rAddrConv.IsColTruncated() )
1229
        else if( rAddrConv.IsColTruncated() )
1227
            eLastErr = SCWARN_IMPORT_COLUMN_OVERFLOW;
1230
            eLastErr = SCWARN_IMPORT_COLUMN_OVERFLOW;
1228
1231
1229
        if( GetBiff() == EXC_BIFF8 )                         
1232
// Refreshing pivot tables moves to the end of converting every table
1230
            GetPivotTableManager().MaybeRefreshPivotTables();
1233
//        if( GetBiff() == EXC_BIFF8 )                         
1234
//            GetPivotTableManager().MaybeRefreshPivotTables();
1231
    }
1235
    }
1232
1236
1233
	return eLastErr;
1237
	return eLastErr;
(-)old/sc/source/filter/excel/xipivot.cxx (-8 / +33 lines)
Lines 19-26 Link Here
19
 * 
19
 * 
20
 *************************************************************/
20
 *************************************************************/
21
21
22
23
24
// MARKER(update_precomp.py): autogen include statement, do not remove
22
// MARKER(update_precomp.py): autogen include statement, do not remove
25
#include "precompiled_sc.hxx"
23
#include "precompiled_sc.hxx"
26
24
Lines 1420-1425 void XclImpPivotTable::Convert() Link Here
1420
    mpDPObj = pDPObj;
1418
    mpDPObj = pDPObj;
1421
1419
1422
    ApplyMergeFlags(aOutRange, aSaveData);
1420
    ApplyMergeFlags(aOutRange, aSaveData);
1421
    MaybeRefresh();	// refresh after convert immediately
1422
    mxPCache = XclImpPivotCacheRef();	// release memory
1423
}
1423
}
1424
1424
1425
void XclImpPivotTable::MaybeRefresh()
1425
void XclImpPivotTable::MaybeRefresh()
Lines 1612-1634 void XclImpPivotTableManager::ReadSxView Link Here
1612
1612
1613
// ----------------------------------------------------------------------------
1613
// ----------------------------------------------------------------------------
1614
1614
1615
void XclImpPivotTableManager::ReadPivotCaches( XclImpStream& rStrm )
1615
// Reading all used pivot caches at one time and then converting all pivot tables together will consume too much memory, forbid this action
1616
// ConvertPivotTables will change to read cache one by one and convert it then release the memory
1617
/*void XclImpPivotTableManager::ReadPivotCaches( XclImpStream& rStrm )
1616
{
1618
{
1617
    for( XclImpPivotCacheVec::iterator aIt = maPCaches.begin(), aEnd = maPCaches.end(); aIt != aEnd; ++aIt )
1619
    for( XclImpPivotCacheVec::iterator aIt = maPCaches.begin(), aEnd = maPCaches.end(); aIt != aEnd; ++aIt )
1618
        (*aIt)->ReadPivotCacheStream( rStrm );
1620
        (*aIt)->ReadPivotCacheStream( rStrm );
1619
}
1621
}*/
1620
1622
1621
void XclImpPivotTableManager::ConvertPivotTables()
1623
void XclImpPivotTableManager::ConvertPivotTables( XclImpStream & rStm/* guoyanp: for DP memory */ )
1622
{
1624
{
1625
//    for( XclImpPivotTableVec::iterator aIt = maPTables.begin(), aEnd = maPTables.end(); aIt != aEnd; ++aIt )
1626
//        (*aIt)->Convert();
1627
1628
    std::map< sal_uInt16, std::list< XclImpPivotTableRef > > aMap;
1629
1623
    for( XclImpPivotTableVec::iterator aIt = maPTables.begin(), aEnd = maPTables.end(); aIt != aEnd; ++aIt )
1630
    for( XclImpPivotTableVec::iterator aIt = maPTables.begin(), aEnd = maPTables.end(); aIt != aEnd; ++aIt )
1624
        (*aIt)->Convert();
1631
        aMap[(*aIt)->GetCacheId()].push_back( *aIt );
1632
1633
    size_t iCache = 0;
1634
1635
    for( std::map< sal_uInt16, std::list< XclImpPivotTableRef > >::iterator i = aMap.begin(); i != aMap.end(); i++, iCache++ )
1636
    {
1637
        if( i->first >= maPCaches.size() ) continue;
1638
1639
        maPCaches[iCache]->ReadPivotCacheStream( rStm );
1640
1641
        for( std::list< XclImpPivotTableRef >::iterator j = i->second.begin(); j != i->second.end(); j++ )
1642
            (*j)->Convert();
1643
1644
        maPCaches[iCache] = XclImpPivotCacheRef();
1645
    }
1625
}
1646
}
1626
1647
1627
void XclImpPivotTableManager::MaybeRefreshPivotTables()
1648
// Reading all used pivot caches at one time and then converting all pivot tables together will consume too much memory, forbid that action
1649
// ConvertPivotTables will change to read cache one by one and convert it then release the memory
1650
// So refreshing all pivot tables at one time is forbidden too because the cache already released
1651
// Need to refresh one by one after convert every pivot table
1652
/*void XclImpPivotTableManager::MaybeRefreshPivotTables()
1628
{
1653
{
1629
    for( XclImpPivotTableVec::iterator aIt = maPTables.begin(), aEnd = maPTables.end(); aIt != aEnd; ++aIt )
1654
    for( XclImpPivotTableVec::iterator aIt = maPTables.begin(), aEnd = maPTables.end(); aIt != aEnd; ++aIt )
1630
        (*aIt)->MaybeRefresh();
1655
        (*aIt)->MaybeRefresh();
1631
}
1656
}*/
1632
1657
1633
// ============================================================================
1658
// ============================================================================
1634
1659
(-)old/sc/source/filter/inc/xipivot.hxx (-6 / +6 lines)
Lines 19-26 Link Here
19
 * 
19
 * 
20
 *************************************************************/
20
 *************************************************************/
21
21
22
23
24
#ifndef SC_XIPIVOT_HXX
22
#ifndef SC_XIPIVOT_HXX
25
#define SC_XIPIVOT_HXX
23
#define SC_XIPIVOT_HXX
26
24
Lines 358-363 public: Link Here
358
356
359
    void                ApplyMergeFlags(const ScRange& rOutRange, const ScDPSaveData& rSaveData);
357
    void                ApplyMergeFlags(const ScRange& rOutRange, const ScDPSaveData& rSaveData);
360
358
359
    sal_uInt16          GetCacheId() const { return maPTInfo.mnCacheIdx; };
360
361
    // ------------------------------------------------------------------------
361
    // ------------------------------------------------------------------------
362
private:
362
private:
363
    typedef ::std::vector< XclImpPTFieldRef > XclImpPTFieldVec;
363
    typedef ::std::vector< XclImpPTFieldRef > XclImpPTFieldVec;
Lines 433-443 public: Link Here
433
    // ------------------------------------------------------------------------
433
    // ------------------------------------------------------------------------
434
434
435
    /** Reads all used pivot caches and creates additional sheets for external data sources. */
435
    /** Reads all used pivot caches and creates additional sheets for external data sources. */
436
    void                ReadPivotCaches( XclImpStream& rStrm );
436
//    void                ReadPivotCaches( XclImpStream& rStrm );
437
    /** Inserts all pivot tables into the Calc document. */
437
    /** Inserts all pivot tables into the Calc document. */
438
    void                ConvertPivotTables();
438
//    void                ConvertPivotTables();
439
439
    void                ConvertPivotTables( XclImpStream & );
440
    void                MaybeRefreshPivotTables();
440
//    void                MaybeRefreshPivotTables();
441
441
442
private:
442
private:
443
    typedef ::std::vector< XclImpPivotCacheRef >    XclImpPivotCacheVec;
443
    typedef ::std::vector< XclImpPivotCacheRef >    XclImpPivotCacheVec;

Return to issue 120839