diff options
author | Michael Stahl <mstahl@redhat.com> | 2012-07-17 15:20:52 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-07-17 15:33:41 +0200 |
commit | 39ea1402d8be477a4d9645c368e9bbc680e91cc8 (patch) | |
tree | 4de00660d4c4d0b7bd30bba9965018a462c775b4 | |
parent | 66c7b8fe56fd7aa518ba28986a4cfd773bf1319b (diff) |
fix previous STL conversion commit:
Check that iterators are not end() before incrementing.
Change-Id: I9c29c707f165306261523e320099dfa6f0527f30
-rw-r--r-- | sw/source/core/doc/docfld.cxx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx index 435330fe58a6..4e4710cb7a09 100644 --- a/sw/source/core/doc/docfld.cxx +++ b/sw/source/core/doc/docfld.cxx @@ -1107,8 +1107,10 @@ void SwDoc::FldsToCalc( SwCalc& rCalc, const _SetGetExpFld& rToThisFld ) if( !pUpdtFlds->GetSortLst()->empty() ) { _SetGetExpFlds::const_iterator itLast = pUpdtFlds->GetSortLst()->lower_bound( (_SetGetExpFld*)&rToThisFld ); - if( **itLast == rToThisFld ) + if (pUpdtFlds->GetSortLst()->end() != itLast && **itLast == rToThisFld) + { ++itLast; + } for( _SetGetExpFlds::const_iterator it = pUpdtFlds->GetSortLst()->begin(); it != itLast; ++it ) lcl_CalcFld( *this, rCalc, **it, pMgr ); @@ -1132,7 +1134,9 @@ void SwDoc::FldsToCalc( SwCalc& rCalc, sal_uLong nLastNd, sal_uInt16 nLastCnt ) ( (*it)->GetNode() == nLastNd && (*it)->GetCntnt() <= nLastCnt ) ); ++it ) + { lcl_CalcFld( *this, rCalc, **it, pMgr ); + } pMgr->CloseAll(sal_False); } @@ -1153,8 +1157,10 @@ void SwDoc::FldsToExpand( SwHash**& ppHashTbl, sal_uInt16& rTblSize, _SetGetExpFlds::const_iterator itLast; { itLast = pUpdtFlds->GetSortLst()->lower_bound( (_SetGetExpFld*)&rToThisFld ); - if( **itLast == rToThisFld ) + if (pUpdtFlds->GetSortLst()->end() != itLast && **itLast == rToThisFld) + { ++itLast; + } } for( _SetGetExpFlds::const_iterator it = pUpdtFlds->GetSortLst()->begin(); it != itLast; ++it ) |