Check for existance of cache before creating a new one.
Sometimes a cache is passed onto the cache table at construction time, in which case the cache is already there by the time CreateCacheTable() is called. We need to check that.
This commit is contained in:
parent
dddc5972da
commit
effc42d64e
4 changed files with 12 additions and 2 deletions
|
@ -170,6 +170,7 @@ public:
|
|||
void clear();
|
||||
bool empty() const;
|
||||
void setCache(ScDPCache* p);
|
||||
bool hasCache() const;
|
||||
|
||||
private:
|
||||
ScDPCacheTable();
|
||||
|
|
|
@ -417,6 +417,11 @@ void ScDPCacheTable::setCache(ScDPCache* p)
|
|||
mpCache = p;
|
||||
}
|
||||
|
||||
bool ScDPCacheTable::hasCache() const
|
||||
{
|
||||
return mpCache != NULL;
|
||||
}
|
||||
|
||||
bool ScDPCacheTable::isRowQualified(sal_Int32 nRow, const vector<Criterion>& rCriteria,
|
||||
const boost::unordered_set<sal_Int32>& rRepeatIfEmptyDims) const
|
||||
{
|
||||
|
|
|
@ -214,7 +214,9 @@ void ScDatabaseDPData::CreateCacheTable()
|
|||
if (!aCacheTable.empty())
|
||||
return;
|
||||
|
||||
aCacheTable.setCache(mrImport.CreateCache());
|
||||
if (!aCacheTable.hasCache())
|
||||
aCacheTable.setCache(mrImport.CreateCache());
|
||||
|
||||
aCacheTable.fillTable();
|
||||
}
|
||||
|
||||
|
|
|
@ -201,7 +201,9 @@ void ScSheetDPData::CreateCacheTable()
|
|||
// already cached.
|
||||
return;
|
||||
|
||||
aCacheTable.setCache(mrDesc.CreateCache());
|
||||
if (!aCacheTable.hasCache())
|
||||
aCacheTable.setCache(mrDesc.CreateCache());
|
||||
|
||||
aCacheTable.fillTable(aQuery, pSpecial, bIgnoreEmptyRows, bRepeatIfEmpty);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue