diff options
Diffstat (limited to 'sw/source/ui/index/cnttab.cxx')
-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 ffacb5d0ef7e..5b8fef5a3e50 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -3147,13 +3147,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(); @@ -3169,7 +3167,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); @@ -3181,7 +3179,7 @@ void SwTokenWindow::InsertAtSelection( } else { - aControlList.erase(iterActive); + iterActive = aControlList.erase(iterActive); pActiveCtrl->Hide(); delete pActiveCtrl; } @@ -3189,7 +3187,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)); |