sw/source/ui/index/cnttab.cxx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
New commits: commit c53bb3f1ec305eff1eb1da1542574eeffeb29d96 Author: Michael Stahl <[email protected]> Date: Wed Aug 22 21:45:27 2012 +0200 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 <[email protected]> Tested-by: Norbert Thiebaud <[email protected]> diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index cb07f71..e41f027 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)); _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
