diff options
author | Kohei Yoshida <kyoshida@novell.com> | 2011-01-21 16:56:06 -0500 |
---|---|---|
committer | Kohei Yoshida <kyoshida@novell.com> | 2011-01-21 16:56:06 -0500 |
commit | 5bdc813406c5839b1b7ac53dc37b234e15052572 (patch) | |
tree | b1adb6729fa0b060b59be84308c863adf05d2192 /sc | |
parent | 126321ebe679376a13e807ff3b1c38acdb0b2f98 (diff) |
Several of its methods now don't need to take ScDocument* as an arg.
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/dpshttab.hxx | 10 | ||||
-rw-r--r-- | sc/source/core/data/dpobject.cxx | 6 | ||||
-rw-r--r-- | sc/source/core/data/dpshttab.cxx | 46 |
3 files changed, 31 insertions, 31 deletions
diff --git a/sc/inc/dpshttab.hxx b/sc/inc/dpshttab.hxx index 737c0bfe4626..f8bbc40b1dc7 100644 --- a/sc/inc/dpshttab.hxx +++ b/sc/inc/dpshttab.hxx @@ -65,7 +65,7 @@ public: const ScQueryParam& GetQueryParam() const; bool operator== ( const ScSheetSourceDesc& rOther ) const; - ScDPTableDataCache* CreateCache( ScDocument* pDoc, long nID = -1) const; + ScDPTableDataCache* CreateCache(long nID = -1) const; /** * Check the sanity of the data source range. @@ -75,10 +75,10 @@ public: * @return 0 if the source range is sane, otherwise an error message ID is * returned. */ - ULONG CheckSourceRange( ScDocument* pDoc ) const; - ScDPTableDataCache* GetCache( ScDocument* pDoc, long nID ) const; - ScDPTableDataCache* GetExistDPObjectCache ( ScDocument* pDoc ) const; - long GetCacheId( ScDocument* pDoc, long nID ) const; + ULONG CheckSourceRange() const; + ScDPTableDataCache* GetCache(long nID) const; + ScDPTableDataCache* GetExistDPObjectCache () const; + long GetCacheId(long nID) const; private: ScRange maSourceRange; diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx index a98863204a75..f348bf47b10c 100644 --- a/sc/source/core/data/dpobject.cxx +++ b/sc/source/core/data/dpobject.cxx @@ -2585,7 +2585,7 @@ ULONG ScDPObject::RefreshCache() CreateObjects(); ULONG nErrId = 0; if ( pSheetDesc) - nErrId = pSheetDesc->CheckSourceRange( pDoc ); + nErrId = pSheetDesc->CheckSourceRange(); if ( nErrId == 0 ) { // First remove the old cache if exists. @@ -2598,9 +2598,9 @@ ULONG ScDPObject::RefreshCache() // Create a new cache. ScDPTableDataCache* pCache = NULL; if ( pSheetDesc ) - pCache = pSheetDesc->CreateCache( pDoc, nNewId ); + pCache = pSheetDesc->CreateCache(nNewId); else if ( pImpDesc ) - pCache = pImpDesc->CreateCache( pDoc, nNewId ); + pCache = pImpDesc->CreateCache(pDoc, nNewId); if ( pCache == NULL ) { diff --git a/sc/source/core/data/dpshttab.cxx b/sc/source/core/data/dpshttab.cxx index 7a3eb6d8cbd5..04f84cb3e824 100644 --- a/sc/source/core/data/dpshttab.cxx +++ b/sc/source/core/data/dpshttab.cxx @@ -61,12 +61,12 @@ using ::std::hash_set; // ----------------------------------------------------------------------- ScSheetDPData::ScSheetDPData( ScDocument* pD, const ScSheetSourceDesc& rDesc , long nCacheId) : - ScDPTableData(pD, rDesc.GetCacheId( pD, nCacheId) ), // DataPilot Migration - Cache&&Performance + ScDPTableData(pD, rDesc.GetCacheId(nCacheId) ), // DataPilot Migration - Cache&&Performance aQuery ( rDesc.GetQueryParam() ), pSpecial(NULL), bIgnoreEmptyRows( FALSE ), bRepeatIfEmpty(FALSE), - aCacheTable( pD, rDesc.GetCacheId( pD, nCacheId)) + aCacheTable( pD, rDesc.GetCacheId(nCacheId)) { SCSIZE nEntryCount( aQuery.GetEntryCount()); pSpecial = new bool[nEntryCount]; @@ -279,65 +279,65 @@ bool ScSheetSourceDesc::operator== (const ScSheetSourceDesc& rOther) const maQueryParam == rOther.maQueryParam; } -ScDPTableDataCache* ScSheetSourceDesc::CreateCache( ScDocument* pDoc , long nID ) const +ScDPTableDataCache* ScSheetSourceDesc::CreateCache(long nID) const { - if (!pDoc) + if (!mpDoc) return NULL; - ScDPTableDataCache* pCache = GetExistDPObjectCache( pDoc ); + ScDPTableDataCache* pCache = GetExistDPObjectCache(); if ( pCache && ( nID < 0 || nID == pCache->GetId() ) ) return pCache; - ULONG nErrId = CheckSourceRange( pDoc ); + ULONG nErrId = CheckSourceRange(); if (nErrId) { DBG_ERROR( "Error Create Cache\n" ); return NULL; } - pCache = new ScDPTableDataCache( pDoc ); + pCache = new ScDPTableDataCache(mpDoc); - pCache->InitFromDoc( pDoc, GetSourceRange() ); + pCache->InitFromDoc(mpDoc, GetSourceRange()); pCache->SetId( nID ); - pDoc->GetDPCollection()->AddDPObjectCache( pCache ); + mpDoc->GetDPCollection()->AddDPObjectCache(pCache); - DBG_TRACE1("Create a cache id = %d \n", pCache->GetId() ); + DBG_TRACE1("Create a cache id = %d \n", pCache->GetId()); return pCache; } -ScDPTableDataCache* ScSheetSourceDesc::GetExistDPObjectCache ( ScDocument* pDoc ) const +ScDPTableDataCache* ScSheetSourceDesc::GetExistDPObjectCache () const { - return pDoc->GetDPCollection()->GetUsedDPObjectCache( GetSourceRange() ); + return mpDoc->GetDPCollection()->GetUsedDPObjectCache( GetSourceRange() ); } -ScDPTableDataCache* ScSheetSourceDesc::GetCache( ScDocument* pDoc, long nID ) const +ScDPTableDataCache* ScSheetSourceDesc::GetCache(long nID) const { - if (!pDoc) + if (!mpDoc) return NULL; - ScDPTableDataCache* pCache = pDoc->GetDPCollection()->GetDPObjectCache( nID ); + ScDPTableDataCache* pCache = mpDoc->GetDPCollection()->GetDPObjectCache(nID); if (NULL == pCache) - pCache = GetExistDPObjectCache( pDoc ); + pCache = GetExistDPObjectCache(); if (NULL == pCache) - pCache = CreateCache( pDoc ); + pCache = CreateCache(); return pCache; } -long ScSheetSourceDesc::GetCacheId( ScDocument* pDoc, long nID ) const +long ScSheetSourceDesc::GetCacheId(long nID) const { - ScDPTableDataCache* pCache = GetCache( pDoc, nID); + ScDPTableDataCache* pCache = GetCache(nID); if ( NULL == pCache ) return -1; else return pCache->GetId(); } -ULONG ScSheetSourceDesc::CheckSourceRange( ScDocument* pDoc ) const +ULONG ScSheetSourceDesc::CheckSourceRange() const { - if (!pDoc) + if (!mpDoc) return STR_ERR_DATAPILOTSOURCE; const ScRange& aSrcRange = GetSourceRange(); @@ -345,11 +345,11 @@ ULONG ScSheetSourceDesc::CheckSourceRange( ScDocument* pDoc ) const const ScAddress& e = aSrcRange.aEnd; for (SCCOL nCol = aSrcRange.aStart.Col(); nCol <= e.Col(); ++nCol) { - if (pDoc->IsBlockEmpty(s.Tab(), nCol, s.Row(), nCol, s.Row())) + if (mpDoc->IsBlockEmpty(s.Tab(), nCol, s.Row(), nCol, s.Row())) return STR_PIVOT_FIRSTROWEMPTYERR; } - if (pDoc->IsBlockEmpty(s.Tab(), s.Col(), s.Row()+1, e.Col(), e.Row())) + if (mpDoc->IsBlockEmpty(s.Tab(), s.Col(), s.Row()+1, e.Col(), e.Row())) return STR_PIVOT_ONLYONEROWERR; return 0; |