summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-08-22 21:45:27 +0200
committerMiklos Vajna <vmiklos@suse.cz>2012-08-23 13:09:31 +0000
commit3f88a4b00c6140c4294583cbaf75954486f5f5b6 (patch)
tree3acebd30f1cd1f8a1c211695ebf1e8b1f36d7ff9 /sw
parent95cedcc822ec1faa88f74771e3d435da926850d4 (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/458 Reviewed-by: Miklos Vajna <vmiklos@suse.cz> Tested-by: Miklos Vajna <vmiklos@suse.cz>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/ui/index/cnttab.cxx10
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));