diff options
-rw-r--r-- | o3tl/inc/o3tl/sorted_vector.hxx | 5 | ||||
-rw-r--r-- | sw/source/core/doc/docfld.cxx | 12 |
2 files changed, 10 insertions, 7 deletions
diff --git a/o3tl/inc/o3tl/sorted_vector.hxx b/o3tl/inc/o3tl/sorted_vector.hxx index 3028f03e1a02..776fd5605e6f 100644 --- a/o3tl/inc/o3tl/sorted_vector.hxx +++ b/o3tl/inc/o3tl/sorted_vector.hxx @@ -122,6 +122,11 @@ public: return std::lower_bound( base_t::begin(), base_t::end(), x, Compare() ); } + const_iterator upper_bound( const Value& x ) const + { + return std::upper_bound( base_t::begin(), base_t::end(), x, Compare() ); + } + /* Searches the container for an element with a value of x * and returns an iterator to it if found, otherwise it returns an * iterator to sorted_vector::end (the element past the end of the container). diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx index 36ef16443e0a..fb8022bb7edc 100644 --- a/sw/source/core/doc/docfld.cxx +++ b/sw/source/core/doc/docfld.cxx @@ -1097,9 +1097,8 @@ void SwDoc::FldsToCalc( SwCalc& rCalc, const _SetGetExpFld& rToThisFld ) if( !mpUpdtFlds->GetSortLst()->empty() ) { - _SetGetExpFlds::const_iterator const itLast = std::upper_bound( - mpUpdtFlds->GetSortLst()->begin(), - mpUpdtFlds->GetSortLst()->end(), + _SetGetExpFlds::const_iterator const itLast = + mpUpdtFlds->GetSortLst()->upper_bound( const_cast<_SetGetExpFld*>(&rToThisFld)); for( _SetGetExpFlds::const_iterator it = mpUpdtFlds->GetSortLst()->begin(); it != itLast; ++it ) lcl_CalcFld( *this, rCalc, **it, pMgr ); @@ -1143,10 +1142,9 @@ void SwDoc::FldsToExpand( SwHash**& ppHashTbl, sal_uInt16& rTblSize, ppHashTbl = new SwHash*[ rTblSize ]; memset( ppHashTbl, 0, sizeof( _HashStr* ) * rTblSize ); - _SetGetExpFlds::const_iterator const itLast = std::upper_bound( - mpUpdtFlds->GetSortLst()->begin(), - mpUpdtFlds->GetSortLst()->end(), - const_cast<_SetGetExpFld*>(&rToThisFld)); + _SetGetExpFlds::const_iterator const itLast = + mpUpdtFlds->GetSortLst()->upper_bound( + const_cast<_SetGetExpFld*>(&rToThisFld)); for( _SetGetExpFlds::const_iterator it = mpUpdtFlds->GetSortLst()->begin(); it != itLast; ++it ) { |