[Libreoffice-commits] .: svl/inc svl/source

Nigel Hawkins nhawkins at kemper.freedesktop.org
Tue Jun 14 07:08:49 PDT 2011


 svl/inc/svl/svstdarr.hxx        |   46 --------------------
 svl/source/memtools/svarray.cxx |   92 ----------------------------------------
 2 files changed, 138 deletions(-)

New commits:
commit a3b5299b08ea86cb745389f15f055fa91d9f8b24
Author: Nigel Hawkins <n.hawkins at gmx.com>
Date:   Tue Jun 14 15:07:37 2011 +0100

    Remove definitions of SvUShortsSort. LGPLv3+/MPL

diff --git a/svl/inc/svl/svstdarr.hxx b/svl/inc/svl/svstdarr.hxx
index d5a1cc7..2baa899 100644
--- a/svl/inc/svl/svstdarr.hxx
+++ b/svl/inc/svl/svstdarr.hxx
@@ -36,7 +36,6 @@
 *	PtrArr:		SvStrings, SvStringsDtor
 *	SortArr:	SvStringsSort, SvStringsSortDtor,
 *				SvStringsISort, SvStringsISortDtor,
-*				SvUShortsSort
 ***********************************************************************/
 
 #include "svl/svldllapi.h"
@@ -53,51 +52,6 @@ SV_DECL_VARARR_VISIBILITY( SvUShorts, sal_uInt16, 1, 1, SVL_DLLPUBLIC )
 #define _SVSTDARR_USHORTS_DECL
 #endif
 
-#ifndef _SVSTDARR_USHORTSSORT_DECL
-
-typedef sal_Bool (*FnForEach_SvUShortsSort)( const sal_uInt16&, void* );
-class SVL_DLLPUBLIC SvUShortsSort : private SvUShorts
-{
-public:
-    SvUShortsSort(sal_uInt8 nSize = 1, sal_uInt8 nG = 1)
-        : SvUShorts(nSize,nG) {}
-
-    void Insert( const SvUShortsSort *pI, sal_uInt16 nS=0, sal_uInt16 nE=USHRT_MAX );
-    sal_Bool Insert( const sal_uInt16 aE );
-    sal_Bool Insert( const sal_uInt16 aE, sal_uInt16& rP );
-    void Insert( const sal_uInt16 *pE, sal_uInt16 nL );
-    // remove ab Pos
-    void RemoveAt( const sal_uInt16 nP, sal_uInt16 nL = 1 );
-    // remove ab dem Eintrag
-    void Remove( const sal_uInt16 nP, sal_uInt16 nL = 1 );
-    sal_Bool Seek_Entry( const sal_uInt16 aE, sal_uInt16* pP = 0 ) const;
-
-    sal_uInt16 Count() const  {   return SvUShorts::Count();	}
-    const sal_uInt16* GetData() const { return (const sal_uInt16*)pData; }
-
-    const sal_uInt16& operator[](sal_uInt16 nP) const {
-        return SvUShorts::operator[]( nP );
-    }
-    const sal_uInt16& GetObject(sal_uInt16 nP) const {
-        return SvUShorts::GetObject( nP );
-    }
-    void ForEach( FnForEach_SvUShortsSort fnForEach, void* pArgs = 0 )
-    {
-        _ForEach( 0, nA, (FnForEach_SvUShorts)fnForEach, pArgs );
-    }
-    void ForEach( sal_uInt16 nS, sal_uInt16 nE,
-                    FnForEach_SvUShortsSort fnForEach, void* pArgs = 0 )
-    {
-        _ForEach( nS, nE, (FnForEach_SvUShorts)fnForEach, pArgs );
-    }
-private:
-    SvUShortsSort( const SvUShortsSort& );
-    SvUShortsSort& operator=( const SvUShortsSort& );
-};
-
-#define _SVSTDARR_USHORTSSORT_DECL
-#endif
-
 #include <tools/string.hxx>
 
 typedef String* StringPtr;
diff --git a/svl/source/memtools/svarray.cxx b/svl/source/memtools/svarray.cxx
index 012736d..df66a87 100644
--- a/svl/source/memtools/svarray.cxx
+++ b/svl/source/memtools/svarray.cxx
@@ -171,98 +171,6 @@ sal_Bool SvStringsISortDtor::Seek_Entry( const StringPtr aE, sal_uInt16* pP ) co
     return sal_False;
 }
 
-// ---------------- Ushorts -------------------------------------
-
-/* SortArray fuer UShorts */
-sal_Bool SvUShortsSort::Seek_Entry( const sal_uInt16 aE, sal_uInt16* pP ) const
-{
-    register sal_uInt16 nO  = SvUShorts::Count(),
-            nM,
-            nU = 0;
-    if( nO > 0 )
-    {
-        nO--;
-        while( nU <= nO )
-        {
-            nM = nU + ( nO - nU ) / 2;
-            if( *(pData + nM) == aE )
-            {
-                if( pP ) *pP = nM;
-                return sal_True;
-            }
-            else if( *(pData + nM) < aE )
-                nU = nM + 1;
-            else if( nM == 0 )
-            {
-                if( pP ) *pP = nU;
-                return sal_False;
-            }
-            else
-                nO = nM - 1;
-        }
-    }
-    if( pP ) *pP = nU;
-    return sal_False;
-}
-
-void SvUShortsSort::Insert( const SvUShortsSort * pI, sal_uInt16 nS, sal_uInt16 nE )
-{
-    if( USHRT_MAX == nE )
-        nE = pI->Count();
-    sal_uInt16 nP;
-    const sal_uInt16 * pIArr = pI->GetData();
-    for( ; nS < nE; ++nS )
-    {
-        if( ! Seek_Entry( *(pIArr+nS), &nP) )
-                SvUShorts::Insert( *(pIArr+nS), nP );
-        if( ++nP >= Count() )
-        {
-            SvUShorts::Insert( pI, nP, nS+1, nE );
-            nS = nE;
-        }
-    }
-}
-
-sal_Bool SvUShortsSort::Insert( const sal_uInt16 aE )
-{
-    sal_uInt16 nP;
-    sal_Bool bExist = Seek_Entry( aE, &nP );
-    if( !bExist )
-        SvUShorts::Insert( aE, nP );
-    return !bExist;
-}
-
-sal_Bool SvUShortsSort::Insert( const sal_uInt16 aE, sal_uInt16& rP )
-{
-    sal_Bool bExist = Seek_Entry( aE, &rP );
-    if( !bExist )
-        SvUShorts::Insert( aE, rP );
-    return !bExist;
-}
-
-void SvUShortsSort::Insert( const sal_uInt16* pE, sal_uInt16 nL)
-{
-    sal_uInt16 nP;
-    for( sal_uInt16 n = 0; n < nL; ++n )
-        if( ! Seek_Entry( *(pE+n), &nP ))
-            SvUShorts::Insert( *(pE+n), nP );
-}
-
-// remove ab Pos
-void SvUShortsSort::RemoveAt( const sal_uInt16 nP, sal_uInt16 nL )
-{
-    if( nL )
-        SvUShorts::Remove( nP, nL);
-}
-
-// remove ab dem Eintrag
-void SvUShortsSort::Remove( const sal_uInt16 aE, sal_uInt16 nL )
-{
-    sal_uInt16 nP;
-    if( nL && Seek_Entry( aE, &nP ) )
-        SvUShorts::Remove( nP, nL);
-}
-
 // ---------------- bytestrings -------------------------------------
 
 // Array mit anderer Seek-Methode!


More information about the Libreoffice-commits mailing list