[Libreoffice-commits] .: svtools/source

Nigel Hawkins nhawkins at kemper.freedesktop.org
Fri May 27 09:26:03 PDT 2011


 svtools/source/contnr/svlbox.cxx |   19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

New commits:
commit e36f8075d7c6322003692b8928026d8f3d59e411
Author: Nigel Hawkins <n.hawkins at gmx.com>
Date:   Fri May 27 17:13:19 2011 +0100

    Remove use of SvULongsSort in svlbox.cxx. LGPLv3+/MPL.

diff --git a/svtools/source/contnr/svlbox.cxx b/svtools/source/contnr/svlbox.cxx
index bf27aff..7b07a59 100644
--- a/svtools/source/contnr/svlbox.cxx
+++ b/svtools/source/contnr/svlbox.cxx
@@ -45,12 +45,11 @@
 #include <unotools/accessiblestatesethelper.hxx>
 #include <rtl/instance.hxx>
 
-#define _SVSTDARR_ULONGSSORT
-#include <svl/svstdarr.hxx>
-
 #include <svtools/svmedit.hxx>
 #include <svtools/svlbitm.hxx>
 
+#include <set>
+
 using namespace ::com::sun::star::accessibility;
 
 // Drag&Drop
@@ -1933,30 +1932,30 @@ sal_Bool SvLBox::NotifyAcceptDrop( SvLBoxEntry* )
 
 namespace
 {
-    struct SortLBoxes : public rtl::Static<SvULongsSort, SortLBoxes> {};
+    struct SortLBoxes : public rtl::Static<std::set<sal_uLong>, SortLBoxes> {};
 }
 
 void SvLBox::AddBoxToDDList_Impl( const SvLBox& rB )
 {
     sal_uLong nVal = (sal_uLong)&rB;
-    SortLBoxes::get().Insert( nVal );
+    SortLBoxes::get().insert( nVal );
 }
 
 void SvLBox::RemoveBoxFromDDList_Impl( const SvLBox& rB )
 {
     sal_uLong nVal = (sal_uLong)&rB;
-    SortLBoxes::get().Remove( nVal );
+    SortLBoxes::get().erase( nVal );
 }
 
 IMPL_STATIC_LINK( SvLBox, DragFinishHdl_Impl, sal_Int8*, pAction )
 {
     sal_uLong nVal = (sal_uLong)pThis;
-    sal_uInt16 nFnd;
-    SvULongsSort &rSortLBoxes = SortLBoxes::get();
-    if( rSortLBoxes.Seek_Entry( nVal, &nFnd ) )
+    std::set<sal_uLong> &rSortLBoxes = SortLBoxes::get();
+    std::set<sal_uLong>::const_iterator it = rSortLBoxes.find(nVal);
+    if( it != rSortLBoxes.end() )
     {
         pThis->DragFinished( *pAction );
-        rSortLBoxes.Remove( nFnd, 1 );
+        rSortLBoxes.erase( it );
     }
     return 0;
 }


More information about the Libreoffice-commits mailing list