diff options
author | Niklas Nebel <nn@openoffice.org> | 2011-03-09 11:44:16 +0100 |
---|---|---|
committer | Niklas Nebel <nn@openoffice.org> | 2011-03-09 11:44:16 +0100 |
commit | f887134f9e809d22b759ff9e0f87d1088c6d0b90 (patch) | |
tree | b221f810b13591d5959bf8c0da1ebca183e46812 /sc/source | |
parent | 609e196ad264ddf039bfec245c81a0d0a3232453 (diff) |
calc66: #i116504# don't use the same cache ID for a different range
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/core/data/documen2.cxx | 7 | ||||
-rw-r--r-- | sc/source/core/data/documen3.cxx | 5 | ||||
-rw-r--r-- | sc/source/core/data/dpobject.cxx | 4 | ||||
-rw-r--r-- | sc/source/core/data/dpsdbtab.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/dpshttab.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/dbgui/pvlaydlg.cxx | 2 |
6 files changed, 15 insertions, 7 deletions
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx index 22155543ee81..66432feb5644 100644 --- a/sc/source/core/data/documen2.cxx +++ b/sc/source/core/data/documen2.cxx @@ -447,7 +447,12 @@ ScDocument::~ScDocument() delete pChangeViewSettings; // und weg damit delete pVirtualDevice_100th_mm; - delete pDPCollection; + if (pDPCollection) + { + pDPCollection->FreeAll(); + RemoveUnusedDPObjectCaches(); + delete pDPCollection; + } // delete the EditEngine before destroying the xPoolHelper delete pCacheFieldEditEngine; diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx index def8edc2d1a4..3f8742ee1d56 100644 --- a/sc/source/core/data/documen3.cxx +++ b/sc/source/core/data/documen3.cxx @@ -2120,7 +2120,7 @@ void ScDocument::RemoveDPObjectCache( long nID ) void ScDocument::RemoveUnusedDPObjectCaches() { - for ( std::list<ScDPTableDataCache*>::iterator iter = m_listDPObjectsCaches.begin(); iter!=m_listDPObjectsCaches.end(); iter++ ) + for ( std::list<ScDPTableDataCache*>::iterator iter = m_listDPObjectsCaches.begin(); iter!=m_listDPObjectsCaches.end(); ) { long nID = (*iter)->GetId(); sal_uInt16 nCount = GetDPCollection()->GetCount(); @@ -2133,10 +2133,11 @@ void ScDocument::RemoveUnusedDPObjectCaches() if ( i == nCount ) { ScDPTableDataCache* pCache = *iter; - m_listDPObjectsCaches.erase( iter ); + iter = m_listDPObjectsCaches.erase( iter ); delete pCache; continue; } + ++iter; } } diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx index ad1932303da0..77dd1d67139d 100644 --- a/sc/source/core/data/dpobject.cxx +++ b/sc/source/core/data/dpobject.cxx @@ -292,7 +292,7 @@ void ScDPObject::SetSheetDesc(const ScSheetSourceDesc& rDesc) DELETEZ( pImpDesc ); DELETEZ( pServDesc ); - delete pImpDesc; + delete pSheetDesc; pSheetDesc = new ScSheetSourceDesc(rDesc); // make valid QueryParam @@ -304,6 +304,7 @@ void ScDPObject::SetSheetDesc(const ScSheetSourceDesc& rDesc) pSheetDesc->aQueryParam.bHasHeader = sal_True; InvalidateSource(); // new source must be created + SetCacheId( -1 ); // #i116504# don't use the same cache ID for a different range } void ScDPObject::SetImportDesc(const ScImportSourceDesc& rDesc) @@ -318,6 +319,7 @@ void ScDPObject::SetImportDesc(const ScImportSourceDesc& rDesc) pImpDesc = new ScImportSourceDesc(rDesc); InvalidateSource(); // new source must be created + SetCacheId( -1 ); } void ScDPObject::SetServiceData(const ScDPServiceDesc& rDesc) diff --git a/sc/source/core/data/dpsdbtab.cxx b/sc/source/core/data/dpsdbtab.cxx index f0e060e8cc7d..977be2e182a9 100644 --- a/sc/source/core/data/dpsdbtab.cxx +++ b/sc/source/core/data/dpsdbtab.cxx @@ -214,7 +214,7 @@ ScDatabaseDPData::ScDatabaseDPData( ScDocument* pDoc, const ScImportSourceDesc& rImport, long nCacheId /*=-1 */ ) : ScDPTableData(pDoc, rImport.GetCacheId( pDoc, nCacheId) ), - aCacheTable( pDoc, rImport.GetCacheId( pDoc, nCacheId)) + aCacheTable( pDoc, GetCacheId() ) // base class ID is initialized with the GetCacheId call above { } diff --git a/sc/source/core/data/dpshttab.cxx b/sc/source/core/data/dpshttab.cxx index 9fa4e37fc879..6c376209e035 100644 --- a/sc/source/core/data/dpshttab.cxx +++ b/sc/source/core/data/dpshttab.cxx @@ -67,7 +67,7 @@ ScSheetDPData::ScSheetDPData( ScDocument* pD, const ScSheetSourceDesc& rDesc , l pSpecial(NULL), bIgnoreEmptyRows( sal_False ), bRepeatIfEmpty(sal_False), - aCacheTable( pD, rDesc.GetCacheId( pD, nCacheId)) + aCacheTable( pD, GetCacheId() ) // base class ID is initialized with the GetCacheId call above { SCSIZE nEntryCount( aQuery.GetEntryCount()); pSpecial = new sal_Bool[nEntryCount]; diff --git a/sc/source/ui/dbgui/pvlaydlg.cxx b/sc/source/ui/dbgui/pvlaydlg.cxx index b43779ffa62b..3377fc16b924 100644 --- a/sc/source/ui/dbgui/pvlaydlg.cxx +++ b/sc/source/ui/dbgui/pvlaydlg.cxx @@ -99,7 +99,7 @@ ScPivotLayoutDlg::ScPivotLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window maFlAreas( this, ScResId( FL_OUTPUT ) ), maFtInArea( this, ScResId( FT_INAREA) ), - maEdInPos( this, ScResId( ED_INAREA) ), + maEdInPos( this, this, ScResId( ED_INAREA) ), maRbInPos( this, ScResId( RB_INAREA ), &maEdInPos, this ), maLbOutPos( this, ScResId( LB_OUTAREA ) ), maFtOutArea( this, ScResId( FT_OUTAREA ) ), |