diff options
author | Michael Stahl <mstahl@redhat.com> | 2012-08-22 21:45:27 +0200 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2012-08-29 19:29:20 +0000 |
commit | c53bb3f1ec305eff1eb1da1542574eeffeb29d96 (patch) | |
tree | 10174dfc4ca36dc8b21de3076717bf0bc088926d /sw/source | |
parent | f565dc51a7e6d8eccca38b2bf3383577d67dcaa1 (diff) |
SwTokenWindow::InsertAtSelection: fix STL assertion:
error: attempt to copy-construct an iterator from a singular iterator.
(regression from 39b8a5f87f55abe53488c9c3c35b65fb0df84cde)
Change-Id: Iab29f4c356ea1cb5ca0f687bcfc5e54f185fbba3
(cherry picked from commit c47505a4525c342694ba4196544715467c2bdb8e)
Reviewed-on: https://gerrit.libreoffice.org/460
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/ui/index/cnttab.cxx | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index cb07f717fe54..e41f0271f1b3 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -3153,13 +3153,11 @@ void SwTokenWindow::InsertAtSelection( ctrl_iterator iterActive = std::find(aControlList.begin(), aControlList.end(), pActiveCtrl); - ctrl_iterator iterInsert = iterActive; - Size aControlSize(GetOutputSizePixel()); if( WINDOW_EDIT == pActiveCtrl->GetType()) { - ++iterInsert; + ++iterActive; Selection aSel = ((SwTOXEdit*)pActiveCtrl)->GetSelection(); aSel.Justify(); @@ -3175,7 +3173,7 @@ void SwTokenWindow::InsertAtSelection( SwFormToken aTmpToken(TOKEN_TEXT); SwTOXEdit* pEdit = new SwTOXEdit(&aCtrlParentWin, this, aTmpToken); - iterInsert = aControlList.insert(iterInsert, pEdit); + iterActive = aControlList.insert(iterActive, pEdit); pEdit->SetText(sRight); pEdit->SetSizePixel(aControlSize); @@ -3187,7 +3185,7 @@ void SwTokenWindow::InsertAtSelection( } else { - aControlList.erase(iterActive); + iterActive = aControlList.erase(iterActive); pActiveCtrl->Hide(); delete pActiveCtrl; } @@ -3195,7 +3193,7 @@ void SwTokenWindow::InsertAtSelection( //now the new button SwTOXButton* pButton = new SwTOXButton(&aCtrlParentWin, this, aToInsertToken); - aControlList.insert(iterInsert, pButton); + aControlList.insert(iterActive, pButton); pButton->SetPrevNextLink(LINK(this, SwTokenWindow, NextItemBtnHdl)); pButton->SetGetFocusHdl(LINK(this, SwTokenWindow, TbxFocusBtnHdl)); |