coverity#705112 Using invalid iterator

Change-Id: I6d05e418436b9d0b12be977b7842e1230ba3c7b1
This commit is contained in:
Caolán McNamara
2014-02-11 10:00:41 +00:00
parent 7c19ff431b
commit 4ba25fbab6

View File

@@ -772,11 +772,14 @@ void OFieldExpressionControl::DeleteRows()
m_pParent->m_pController->executeChecked(SID_GROUP_REMOVE,aArgs);
::std::vector<sal_Int32>::iterator aFind = ::std::find(m_aGroupPositions.begin(),m_aGroupPositions.end(),nGroupPos);
*aFind = NO_GROUP;
::std::vector<sal_Int32>::iterator aEnd = m_aGroupPositions.end();
for(++aFind;aFind != aEnd;++aFind)
if ( *aFind != NO_GROUP )
--*aFind;
if (aFind != m_aGroupPositions.end())
{
*aFind = NO_GROUP;
::std::vector<sal_Int32>::iterator aEnd = m_aGroupPositions.end();
for(++aFind;aFind != aEnd;++aFind)
if ( *aFind != NO_GROUP )
--*aFind;
}
}
nIndex = NextSelectedRow();
}