diff options
author | Kohei Yoshida <kyoshida@novell.com> | 2011-01-21 14:45:11 -0500 |
---|---|---|
committer | Kohei Yoshida <kyoshida@novell.com> | 2011-01-21 14:45:11 -0500 |
commit | cb3527334ebdb0f5d8b265a7335f17f37902d04b (patch) | |
tree | 3526119b8881592b98c088ffaf889b1968df8e8f /sc/source/core/data/dpobject.cxx | |
parent | 4255ad871ab9566f00545278f873b295155df157 (diff) |
renamed CheckValidate() to CheckSourceRange(), and cleaned it up.
Diffstat (limited to 'sc/source/core/data/dpobject.cxx')
-rw-r--r-- | sc/source/core/data/dpobject.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx index 5e1a43f1f..d5d7a3aef 100644 --- a/sc/source/core/data/dpobject.cxx +++ b/sc/source/core/data/dpobject.cxx @@ -2580,16 +2580,18 @@ ULONG ScDPObject::RefreshCache() CreateObjects(); ULONG nErrId = 0; if ( pSheetDesc) - nErrId = pSheetDesc->CheckValidate( pDoc ); + nErrId = pSheetDesc->CheckSourceRange( pDoc ); if ( nErrId == 0 ) { + // First remove the old cache if exists. ScDPCollection* pDPCollection = pDoc->GetDPCollection(); long nOldId = GetCacheId(); long nNewId = pDPCollection->GetNewDPObjectCacheId(); if ( nOldId >= 0 ) pDPCollection->RemoveDPObjectCache( nOldId ); - ScDPTableDataCache* pCache = NULL; + // Create a new cache. + ScDPTableDataCache* pCache = NULL; if ( pSheetDesc ) pCache = pSheetDesc->CreateCache( pDoc, nNewId ); else if ( pImpDesc ) @@ -2598,7 +2600,7 @@ ULONG ScDPObject::RefreshCache() if ( pCache == NULL ) { //cache failed - DBG_ASSERT( pCache , " pCache == NULL" ); + DBG_ASSERT( pCache , "pCache == NULL" ); return STR_ERR_DATAPILOTSOURCE; } @@ -2608,7 +2610,7 @@ ULONG ScDPObject::RefreshCache() size_t nCount = pDPCollection->GetCount(); for (size_t i=0; i<nCount; ++i) { //set new cache id - if ( (*pDPCollection)[i]->GetCacheId() == nOldId ) + if ( (*pDPCollection)[i]->GetCacheId() == nOldId ) { (*pDPCollection)[i]->SetCacheId( nNewId ); (*pDPCollection)[i]->SetRefresh(); |