diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-02-11 10:00:41 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-02-11 12:11:42 +0000 |
commit | 4ba25fbab6d4ee0990d71a0d91c843b04670837d (patch) | |
tree | 8946a1d8aab0656077ee05b2f18b3f8b83b2dc18 /reportdesign | |
parent | 7c19ff431b5b9f7b5fd3a72d85d0da4acef3e0da (diff) |
coverity#705112 Using invalid iterator
Change-Id: I6d05e418436b9d0b12be977b7842e1230ba3c7b1
Diffstat (limited to 'reportdesign')
-rw-r--r-- | reportdesign/source/ui/dlg/GroupsSorting.cxx | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/reportdesign/source/ui/dlg/GroupsSorting.cxx b/reportdesign/source/ui/dlg/GroupsSorting.cxx index fa705dd0d6d0..60cdac3ed691 100644 --- a/reportdesign/source/ui/dlg/GroupsSorting.cxx +++ b/reportdesign/source/ui/dlg/GroupsSorting.cxx @@ -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(); } |