[Libreoffice-commits] .: Branch 'libreoffice-3-6' - sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Aug 23 06:09:50 PDT 2012


 sw/source/ui/index/cnttab.cxx |   10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

New commits:
commit 3f88a4b00c6140c4294583cbaf75954486f5f5b6
Author: Michael Stahl <mstahl at redhat.com>
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/458
    Reviewed-by: Miklos Vajna <vmiklos at suse.cz>
    Tested-by: Miklos Vajna <vmiklos at suse.cz>

diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index ffacb5d..5b8fef5 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));


More information about the Libreoffice-commits mailing list