summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2012-11-08 16:09:11 -0500
committerPetr Mladek <pmladek@suse.cz>2012-11-21 12:11:29 +0100
commit5404bf540296d3a24d13b705d0dc2233e8070036 (patch)
tree5871ca674c784b983be6f6e8305499ed84ab1070
parent4d65f5fae0cbdb551c6bffc13bfab60a1301756e (diff)
fdo#54898: Test equality by order index (integer) which is more stable.
At the point where std::unique is called, we can use order indices to determine whether the two items are equal. This should be more stable than using CaseInsEqual() to assess equality. Change-Id: I88310fc7beede19fb1c629b9b7e3cb9a069b2b23 Reviewed-on: https://gerrit.libreoffice.org/1013 Reviewed-by: Tor Lillqvist <tml@iki.fi> Tested-by: Tor Lillqvist <tml@iki.fi>
-rw-r--r--sc/source/core/data/dpcache.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx
index c754fba1549d..1fbddfc5ef7c 100644
--- a/sc/source/core/data/dpcache.cxx
+++ b/sc/source/core/data/dpcache.cxx
@@ -279,11 +279,11 @@ struct LessByDataIndex : std::binary_function<Bucket, Bucket, bool>
}
};
-struct EqualByValue : std::binary_function<Bucket, Bucket, bool>
+struct EqualByOrderIndex : std::binary_function<Bucket, Bucket, bool>
{
bool operator() (const Bucket& left, const Bucket& right) const
{
- return left.maValue.IsCaseInsEqual(right.maValue);
+ return left.mnOrderIndex == right.mnOrderIndex;
}
};
@@ -359,7 +359,7 @@ void processBuckets(std::vector<Bucket>& aBuckets, ScDPCache::Field& rField)
// Unique by value.
std::vector<Bucket>::iterator itUniqueEnd =
- std::unique(aBuckets.begin(), aBuckets.end(), EqualByValue());
+ std::unique(aBuckets.begin(), aBuckets.end(), EqualByOrderIndex());
// Copy the unique values into items.
std::vector<Bucket>::iterator itBeg = aBuckets.begin();