diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-12-19 10:30:29 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-12-19 11:31:10 +0000 |
commit | 5a3cbd3b7ad7b99afef920338b3c42a3867b0412 (patch) | |
tree | 8f1150490cea7346d23f89b7288b3ff5cc88a56c /sw | |
parent | bea15d037b89f017f203aa48ff2ae102ea09cb0c (diff) |
CID#736021 (unlikely) invalid iterator use
Change-Id: Ic23ccd99a573765ba434fd2fb7bbfe1d3491fcd3
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/ui/index/cnttab.cxx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index 28a10b7ba6f4..5410ab40011d 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -3090,12 +3090,15 @@ void SwTokenWindow::RemoveControl(SwTOXButton* pDel, sal_Bool bInternalCall ) ctrl_iterator it = std::find(aControlList.begin(), aControlList.end(), pDel); - OSL_ENSURE(it != aControlList.end(), "Control does not exist!"); + assert(it != aControlList.end()); //Control does not exist! + if (it == aControlList.end()) + return; // the two neighbours of the box must be merged // the properties of the right one will be lost - OSL_ENSURE(it != aControlList.begin() && it != aControlList.end() - 1, - "Button at first or last position?"); + assert(it != aControlList.begin() && it != aControlList.end() - 1); //Button at first or last position? + if (it == aControlList.begin() || it == aControlList.end() - 1) + return; ctrl_iterator itLeft = it, itRight = it; --itLeft; |