Kaydet (Commit) 39ea1402 authored tarafından Michael Stahl's avatar Michael Stahl

fix previous STL conversion commit:

Check that iterators are not end() before incrementing.

Change-Id: I9c29c707f165306261523e320099dfa6f0527f30
üst 66c7b8fe
......@@ -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,9 +1157,11 @@ 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 )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment