summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tlillqvist@suse.com>2011-09-15 15:40:10 +0300
committerTor Lillqvist <tlillqvist@suse.com>2011-09-15 15:42:33 +0300
commitdb2d9b4076d5e15b433d1bdcaed0fe629b78e52b (patch)
treee450a6aa3c1ec1d946b72c171cf11ddfd28aecf3
parent9b5c26fe2d9f25dbbe51e92b0f261dd89072dca9 (diff)
Fix lower_bound() comparator class problem for MSVC with _DEBUG
-rw-r--r--oox/source/helper/containerhelper.cxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/oox/source/helper/containerhelper.cxx b/oox/source/helper/containerhelper.cxx
index b4af73591530..23bad220e452 100644
--- a/oox/source/helper/containerhelper.cxx
+++ b/oox/source/helper/containerhelper.cxx
@@ -52,7 +52,10 @@ namespace {
struct ValueRangeComp
{
- inline bool operator()( const ValueRange& rRange, sal_Int32 nValue ) const { return rRange.mnLast < nValue; }
+ inline bool operator()( const ValueRange& rLHS, const ValueRange& rRHS ) const
+ {
+ return rLHS.mnLast < rRHS.mnFirst;
+ }
};
} // namespace
@@ -64,7 +67,7 @@ void ValueRangeSet::insert( const ValueRange& rRange )
// find the first range that contains or follows the starting point of the passed range
ValueRangeVector::iterator aBeg = maRanges.begin();
ValueRangeVector::iterator aEnd = maRanges.end();
- ValueRangeVector::iterator aIt = ::std::lower_bound( aBeg, aEnd, rRange.mnFirst, ValueRangeComp() );
+ ValueRangeVector::iterator aIt = ::std::lower_bound( aBeg, aEnd, rRange, ValueRangeComp() );
// nothing to do if found range contains passed range
if( (aIt != aEnd) && aIt->contains( rRange ) ) return;
// check if previous range can be used to merge with the passed range
@@ -93,7 +96,7 @@ ValueRangeVector ValueRangeSet::getIntersection( const ValueRange& rRange ) cons
{
ValueRangeVector aRanges;
// find the range that contains nFirst or the first range that follows nFirst
- ValueRangeVector::const_iterator aIt = ::std::lower_bound( maRanges.begin(), maRanges.end(), rRange.mnFirst, ValueRangeComp() );
+ ValueRangeVector::const_iterator aIt = ::std::lower_bound( maRanges.begin(), maRanges.end(), rRange, ValueRangeComp() );
for( ValueRangeVector::const_iterator aEnd = maRanges.end(); (aIt != aEnd) && (aIt->mnFirst <= rRange.mnLast); ++aIt )
aRanges.push_back( ValueRange( ::std::max( aIt->mnFirst, rRange.mnFirst ), ::std::min( aIt->mnLast, rRange.mnLast ) ) );
return aRanges;