vcl/source/window/btndlg.cxx |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

New commits:
commit 30f6ec7cfdf63cea265148bbe3a07d8df34e96d5
Author: Julien Nabet <serval2...@yahoo.fr>
Date:   Wed Feb 4 21:58:55 2015 +0100

    Resolves tdf#89129: crash when defining a specific relationship
    
    Returns early if comparison matches so you can reduce iterator scope and 
avoid last test for logging.
    
    /usr/include/c++/4.9/debug/safe_iterator.h:168:error: attempt to copy-
        construct an iterator from a singular iterator.
    
    Objects involved in the operation:
    iterator "this" @ 0x0x7fffffff3a30 {
    type = 
N11__gnu_debug14_Safe_iteratorIN9__gnu_cxx17__normal_iteratorIPPvNSt9__cxx19986vectorIS3_SaIS3_EEEEENSt7__debug6vectorIS3_S7_EEEE
 (mutable iterator);
      state = past-the-end;
      references sequence with type `NSt7__debug6vectorIPvSaIS1_EEE' @ 
0x0x7fffffff4088
    }
    iterator "other" @ 0x0x7fffffff3a90 {
    type = 
N11__gnu_debug14_Safe_iteratorIN9__gnu_cxx17__normal_iteratorIPPvNSt9__cxx19986vectorIS3_SaIS3_EEEEENSt7__debug6vectorIS3_S7_EEEE
 (mutable iterator);
      state = singular;
      references sequence with type `NSt7__debug6vectorIPvSaIS1_EEE' @ 
0x0x7fffffff4088
    }
    
    4  0x00002aaab193d6e9 in 
boost::void_ptr_iterator<__gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<void**,
 std::__cxx1998::vector<void*, std::allocator<void*> > >, 
std::__debug::vector<void*, std::allocator<void*> > >, ImplBtnDlgItem>::base 
(this=0x7fffffff3a90)
        at 
/home/julien/compile-libreoffice/libreoffice/workdir/UnpackedTarball/boost/boost/ptr_container/detail/void_ptr_iterator.hpp:121
    5  0x00002aaab193d269 in 
boost::operator==<__gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<void**,
 std::__cxx1998::vector<void*, std::allocator<void*> > >, 
std::__debug::vector<void*, std::allocator<void*> > >, ImplBtnDlgItem, 
__gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<void**, 
std::__cxx1998::vector<void*, std::allocator<void*> > >, 
std::__debug::vector<void*, std::allocator<void*> > >, ImplBtnDlgItem> (l=..., 
r=...)
        at 
/home/julien/compile-libreoffice/libreoffice/workdir/UnpackedTarball/boost/boost/ptr_container/detail/void_ptr_iterator.hpp:179
    6  0x00002aaab193c2ca in ButtonDialog::RemoveButton (this=0x7fffffff3d90, 
nId=1) at 
/home/julien/compile-libreoffice/libreoffice/vcl/source/window/btndlg.cxx:340
    7  0x00002aaad8ed109b in dbaui::ORelationTableView::lookForUiActivities 
(this=0x317ef30)
        at 
/home/julien/compile-libreoffice/libreoffice/dbaccess/source/ui/relationdesign/RelationTableView.cxx:342
    
    Change-Id: Ied45c222c94d2a362075a3b1550b6092aad77c62
    Reviewed-on: https://gerrit.libreoffice.org/14325
    Reviewed-by: Lionel Elie Mamane <lio...@mamane.lu>
    Tested-by: Lionel Elie Mamane <lio...@mamane.lu>

diff --git a/vcl/source/window/btndlg.cxx b/vcl/source/window/btndlg.cxx
index 3c98801..94862da 100644
--- a/vcl/source/window/btndlg.cxx
+++ b/vcl/source/window/btndlg.cxx
@@ -322,8 +322,7 @@ void ButtonDialog::AddButton( StandardButtonType eType, 
sal_uInt16 nId,
 
 void ButtonDialog::RemoveButton( sal_uInt16 nId )
 {
-    btn_iterator it;
-    for (it = maItemList.begin(); it != maItemList.end(); ++it)
+    for (btn_iterator it = maItemList.begin(); it != maItemList.end(); ++it)
     {
         if (it->mnId == nId)
         {
@@ -333,12 +332,11 @@ void ButtonDialog::RemoveButton( sal_uInt16 nId )
                 delete it->mpPushButton;
 
             maItemList.erase(it);
-            break;
+            return;
         }
     }
 
-    if (it == maItemList.end())
-        SAL_WARN( "vcl.window", "ButtonDialog::RemoveButton(): ButtonId 
invalid" );
+    SAL_WARN( "vcl.window", "ButtonDialog::RemoveButton(): ButtonId invalid" );
 }
 
 void ButtonDialog::Clear()
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to