summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-12-17 23:53:38 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-12-18 00:12:51 +0100
commit313575bd0d307ab37b0f3ab0d2c47330d546eaa1 (patch)
tree2a32744d471c33c2da8ea8081b9742e55de17349
parent4d46369f128393441ca87945cb419fe1350d1feb (diff)
first check that the number of cells has not been reached yet, fdo#58346
Change-Id: I0fea5719f524584acdbbc560c47b3c427c174845
-rw-r--r--sc/source/core/data/conditio.cxx16
1 files changed, 8 insertions, 8 deletions
diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index e4d3d75ac804..935ff4818c35 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -865,10 +865,10 @@ bool ScConditionEntry::IsTopNElement( double nArg ) const
for(ScConditionEntryCache::ValueCacheType::const_reverse_iterator itr = mpCache->maValues.rbegin(),
itrEnd = mpCache->maValues.rend(); itr != itrEnd; ++itr)
{
- if(itr->first <= nArg)
- return true;
if(nCells >= nVal1)
return false;
+ if(itr->first <= nArg)
+ return true;
nCells += itr->second;
}
@@ -886,10 +886,10 @@ bool ScConditionEntry::IsBottomNElement( double nArg ) const
for(ScConditionEntryCache::ValueCacheType::const_iterator itr = mpCache->maValues.begin(),
itrEnd = mpCache->maValues.end(); itr != itrEnd; ++itr)
{
- if(itr->first >= nArg)
- return true;
if(nCells >= nVal1)
return false;
+ if(itr->first >= nArg)
+ return true;
nCells += itr->second;
}
@@ -905,10 +905,10 @@ bool ScConditionEntry::IsTopNPercent( double nArg ) const
for(ScConditionEntryCache::ValueCacheType::const_reverse_iterator itr = mpCache->maValues.rbegin(),
itrEnd = mpCache->maValues.rend(); itr != itrEnd; ++itr)
{
- if(itr->first <= nArg)
- return true;
if(nCells >= nLimitCells)
return false;
+ if(itr->first <= nArg)
+ return true;
nCells += itr->second;
}
@@ -924,10 +924,10 @@ bool ScConditionEntry::IsBottomNPercent( double nArg ) const
for(ScConditionEntryCache::ValueCacheType::const_iterator itr = mpCache->maValues.begin(),
itrEnd = mpCache->maValues.end(); itr != itrEnd; ++itr)
{
- if(itr->first >= nArg)
- return true;
if(nCells >= nLimitCells)
return false;
+ if(itr->first >= nArg)
+ return true;
nCells += itr->second;
}