diff options
author | Michael Stahl <mstahl@redhat.com> | 2012-08-22 21:45:27 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-08-22 23:12:26 +0200 |
commit | c47505a4525c342694ba4196544715467c2bdb8e (patch) | |
tree | e4a86f0c29c34f9fa8733c97853df922f068f1f5 | |
parent | 2cf1aac49bfcb986e1a87d4992c8e132ec9ba729 (diff) |
SwTokenWindow::InsertAtSelection: fix STL assertion:
error: attempt to copy-construct an iterator from a singular iterator.
(regression from 39b8a5f87f55abe53488c9c3c35b65fb0df84cde)
Change-Id: Iab29f4c356ea1cb5ca0f687bcfc5e54f185fbba3
-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 94bf14fd8a0a..30425bfe4a0e 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -3141,13 +3141,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(); @@ -3163,7 +3161,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); @@ -3175,7 +3173,7 @@ void SwTokenWindow::InsertAtSelection( } else { - aControlList.erase(iterActive); + iterActive = aControlList.erase(iterActive); pActiveCtrl->Hide(); delete pActiveCtrl; } @@ -3183,7 +3181,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)); |