summaryrefslogtreecommitdiff
path: root/sw/source/core/doc/docfld.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/doc/docfld.cxx')
-rw-r--r--sw/source/core/doc/docfld.cxx22
1 files changed, 8 insertions, 14 deletions
diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx
index 6f1fdf6d72b5..aa5156e39ff8 100644
--- a/sw/source/core/doc/docfld.cxx
+++ b/sw/source/core/doc/docfld.cxx
@@ -1106,12 +1106,10 @@ void SwDoc::FldsToCalc( SwCalc& rCalc, const _SetGetExpFld& rToThisFld )
if( !pUpdtFlds->GetSortLst()->empty() )
{
- _SetGetExpFlds::const_iterator itLast = pUpdtFlds->GetSortLst()->lower_bound( (_SetGetExpFld*)&rToThisFld );
- if (pUpdtFlds->GetSortLst()->end() != itLast && **itLast == rToThisFld)
- {
- ++itLast;
- }
-
+ _SetGetExpFlds::const_iterator const itLast = std::upper_bound(
+ pUpdtFlds->GetSortLst()->begin(),
+ pUpdtFlds->GetSortLst()->end(),
+ const_cast<_SetGetExpFld*>(&rToThisFld));
for( _SetGetExpFlds::const_iterator it = pUpdtFlds->GetSortLst()->begin(); it != itLast; ++it )
lcl_CalcFld( *this, rCalc, **it, pMgr );
}
@@ -1154,14 +1152,10 @@ void SwDoc::FldsToExpand( SwHash**& ppHashTbl, sal_uInt16& rTblSize,
ppHashTbl = new SwHash*[ rTblSize ];
memset( ppHashTbl, 0, sizeof( _HashStr* ) * rTblSize );
- _SetGetExpFlds::const_iterator itLast;
- {
- itLast = pUpdtFlds->GetSortLst()->lower_bound( (_SetGetExpFld*)&rToThisFld );
- if (pUpdtFlds->GetSortLst()->end() != itLast && **itLast == rToThisFld)
- {
- ++itLast;
- }
- }
+ _SetGetExpFlds::const_iterator const itLast = std::upper_bound(
+ pUpdtFlds->GetSortLst()->begin(),
+ pUpdtFlds->GetSortLst()->end(),
+ const_cast<_SetGetExpFld*>(&rToThisFld));
for( _SetGetExpFlds::const_iterator it = pUpdtFlds->GetSortLst()->begin(); it != itLast; ++it )
{