Kaydet (Commit) c47505a4 authored tarafından Michael Stahl's avatar Michael Stahl

SwTokenWindow::InsertAtSelection: fix STL assertion:

 error: attempt to copy-construct an iterator from a singular iterator.
(regression from 39b8a5f8)

Change-Id: Iab29f4c356ea1cb5ca0f687bcfc5e54f185fbba3
üst 2cf1aac4
...@@ -3141,13 +3141,11 @@ void SwTokenWindow::InsertAtSelection( ...@@ -3141,13 +3141,11 @@ void SwTokenWindow::InsertAtSelection(
ctrl_iterator iterActive = std::find(aControlList.begin(), ctrl_iterator iterActive = std::find(aControlList.begin(),
aControlList.end(), pActiveCtrl); aControlList.end(), pActiveCtrl);
ctrl_iterator iterInsert = iterActive;
Size aControlSize(GetOutputSizePixel()); Size aControlSize(GetOutputSizePixel());
if( WINDOW_EDIT == pActiveCtrl->GetType()) if( WINDOW_EDIT == pActiveCtrl->GetType())
{ {
++iterInsert; ++iterActive;
Selection aSel = ((SwTOXEdit*)pActiveCtrl)->GetSelection(); Selection aSel = ((SwTOXEdit*)pActiveCtrl)->GetSelection();
aSel.Justify(); aSel.Justify();
...@@ -3163,7 +3161,7 @@ void SwTokenWindow::InsertAtSelection( ...@@ -3163,7 +3161,7 @@ void SwTokenWindow::InsertAtSelection(
SwFormToken aTmpToken(TOKEN_TEXT); SwFormToken aTmpToken(TOKEN_TEXT);
SwTOXEdit* pEdit = new SwTOXEdit(&aCtrlParentWin, this, aTmpToken); SwTOXEdit* pEdit = new SwTOXEdit(&aCtrlParentWin, this, aTmpToken);
iterInsert = aControlList.insert(iterInsert, pEdit); iterActive = aControlList.insert(iterActive, pEdit);
pEdit->SetText(sRight); pEdit->SetText(sRight);
pEdit->SetSizePixel(aControlSize); pEdit->SetSizePixel(aControlSize);
...@@ -3175,7 +3173,7 @@ void SwTokenWindow::InsertAtSelection( ...@@ -3175,7 +3173,7 @@ void SwTokenWindow::InsertAtSelection(
} }
else else
{ {
aControlList.erase(iterActive); iterActive = aControlList.erase(iterActive);
pActiveCtrl->Hide(); pActiveCtrl->Hide();
delete pActiveCtrl; delete pActiveCtrl;
} }
...@@ -3183,7 +3181,7 @@ void SwTokenWindow::InsertAtSelection( ...@@ -3183,7 +3181,7 @@ void SwTokenWindow::InsertAtSelection(
//now the new button //now the new button
SwTOXButton* pButton = new SwTOXButton(&aCtrlParentWin, this, aToInsertToken); SwTOXButton* pButton = new SwTOXButton(&aCtrlParentWin, this, aToInsertToken);
aControlList.insert(iterInsert, pButton); aControlList.insert(iterActive, pButton);
pButton->SetPrevNextLink(LINK(this, SwTokenWindow, NextItemBtnHdl)); pButton->SetPrevNextLink(LINK(this, SwTokenWindow, NextItemBtnHdl));
pButton->SetGetFocusHdl(LINK(this, SwTokenWindow, TbxFocusBtnHdl)); pButton->SetGetFocusHdl(LINK(this, SwTokenWindow, TbxFocusBtnHdl));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment