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

David Tardon dtardon at kemper.freedesktop.org
Mon Oct 3 23:48:49 PDT 2011


 svl/inc/svl/svarray.hxx         |    2 +-
 svl/inc/svl/svstdarr.hxx        |    7 +------
 svl/source/items/itemset.cxx    |    7 -------
 svl/source/items/nranges.cxx    |   15 +++++++++------
 svl/source/memtools/svarray.cxx |    2 --
 5 files changed, 11 insertions(+), 22 deletions(-)

New commits:
commit d4f1b520cdce59878d91c8224381662b0a131846
Author: Maciej Rumianowski <maciej.rumianowski at gmail.com>
Date:   Fri Sep 30 15:39:11 2011 +0200

    Get rid of SvNums
    
    SvNums is a define for SvUShort and SvULong, both are replaced with std::vector

diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx
index 0dba305..1a479ad 100644
--- a/svl/source/items/itemset.cxx
+++ b/svl/source/items/itemset.cxx
@@ -32,10 +32,7 @@
 #include <string.h>
 
 #include <cstdarg>
-#define _SVSTDARR_USHORTS
-#define _SVSTDARR_ULONGS
 
-#include <svl/svstdarr.hxx>
 #include <svl/itemset.hxx>
 #include <svl/itempool.hxx>
 #include <svl/itemiter.hxx>
@@ -58,19 +55,15 @@ DBG_NAME(SfxItemSet)
 //========================================================================
 
 #define NUMTYPE         sal_uInt16
-#define SvNums          SvUShorts
 #define SfxNumRanges    SfxUShortRanges
 #include "nranges.cxx"
 #undef NUMTYPE
-#undef SvNums
 #undef SfxNumRanges
 
 #define NUMTYPE         sal_uLong
-#define SvNums          SvULongs
 #define SfxNumRanges    SfxULongRanges
 #include "nranges.cxx"
 #undef NUMTYPE
-#undef SvNums
 #undef SfxNumRanges
 
 //========================================================================
diff --git a/svl/source/items/nranges.cxx b/svl/source/items/nranges.cxx
index 0b8942c..38b9e01 100644
--- a/svl/source/items/nranges.cxx
+++ b/svl/source/items/nranges.cxx
@@ -29,6 +29,7 @@
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_svl.hxx"
 
+#include <vector>
 // compiled via include from itemset.cxx only!
 
 //========================================================================
@@ -75,18 +76,20 @@ NUMTYPE InitializeRanges_Impl( NUMTYPE *&rpRanges, va_list pArgs,
 {
     NUMTYPE nSize = 0, nIns = 0;
     sal_uInt16 nCnt = 0;
-    SvNums aNumArr( 11, 8 );
-    aNumArr.Insert( nWh1, nCnt++ );
-    aNumArr.Insert( nWh2, nCnt++ );
+    std::vector<NUMTYPE> aNumArr;
+    aNumArr.push_back( nWh1 );
+    aNumArr.push_back( nWh2 );
     DBG_ASSERT( nWh1 <= nWh2, "Ungueltiger Bereich" );
     nSize += nWh2 - nWh1 + 1;
-    aNumArr.Insert( nNull, nCnt++ );
+    aNumArr.push_back( nNull );
+    nCnt = aNumArr.size();
     while ( 0 !=
             ( nIns =
               sal::static_int_cast< NUMTYPE >(
                   va_arg( pArgs, NUMTYPE_ARG ) ) ) )
     {
-        aNumArr.Insert( nIns, nCnt++ );
+        aNumArr.push_back( nIns );
+        ++nCnt;
         if ( 0 == (nCnt & 1) )       // 4,6,8, usw.
         {
             DBG_ASSERT( aNumArr[ nCnt-2 ] <= nIns, "Ungueltiger Bereich" );
@@ -98,7 +101,7 @@ NUMTYPE InitializeRanges_Impl( NUMTYPE *&rpRanges, va_list pArgs,
 
     // so, jetzt sind alle Bereiche vorhanden und
     rpRanges = new NUMTYPE[ nCnt+1 ];
-    memcpy( rpRanges, aNumArr.GetData(), sizeof(NUMTYPE) * nCnt );
+    std::copy( aNumArr.begin(), aNumArr.begin()+nCnt, rpRanges);
     *(rpRanges+nCnt) = 0;
 
     return nSize;
commit ff76d2927bd92c6a6598fdd70f62cfb7de7ae925
Author: Maciej Rumianowski <maciej.rumianowski at gmail.com>
Date:   Fri Sep 30 15:55:58 2011 +0200

    Finally remove SvULongs
    
    In all places SvULongs have been replaced with std::vector, now can be totally removed.

diff --git a/svl/inc/svl/svarray.hxx b/svl/inc/svl/svarray.hxx
index 52b35ac..a0db903 100644
--- a/svl/inc/svl/svarray.hxx
+++ b/svl/inc/svl/svarray.hxx
@@ -81,7 +81,7 @@
 *           Sortierung mit Hilfe der Object-operatoren "<" und "=="
 *
 * JP 09.10.96:  vordefinierte Arrays:
-*   VarArr:     SvULongs, SvUShorts
+*   VarArr:     SvUShorts
 *   PtrArr:     SvStrings, SvStringsDtor
 *   SortArr:    SvStringsSort, SvStringsSortDtor,
 *               SvStringsISort, SvStringsISortDtor
diff --git a/svl/inc/svl/svstdarr.hxx b/svl/inc/svl/svstdarr.hxx
index 2dd5b89..6968cc6 100644
--- a/svl/inc/svl/svstdarr.hxx
+++ b/svl/inc/svl/svstdarr.hxx
@@ -32,7 +32,7 @@
 *   (die defines setzen sich aus "_SVSTDARR_" und dem Namen des Array
 *    ohne "Sv" zusammen)
 *
-*   VarArr:     SvULongs, SvUShorts
+*   VarArr:     SvUShorts
 *   PtrArr:     SvStrings, SvStringsDtor
 *   SortArr:    SvStringsSort, SvStringsSortDtor,
 *               SvStringsISort, SvStringsISortDtor,
@@ -42,11 +42,6 @@
 #include <svl/svarray.hxx>
 #include <deque>
 
-#ifndef _SVSTDARR_ULONGS_DECL
-SV_DECL_VARARR_VISIBILITY( SvULongs, sal_uLong, 1, 1, SVL_DLLPUBLIC )
-#define _SVSTDARR_ULONGS_DECL
-#endif
-
 #ifndef _SVSTDARR_USHORTS_DECL
 SV_DECL_VARARR_VISIBILITY( SvUShorts, sal_uInt16, 1, 1, SVL_DLLPUBLIC )
 #define _SVSTDARR_USHORTS_DECL
diff --git a/svl/source/memtools/svarray.cxx b/svl/source/memtools/svarray.cxx
index bdbadca..88cc111 100644
--- a/svl/source/memtools/svarray.cxx
+++ b/svl/source/memtools/svarray.cxx
@@ -31,7 +31,6 @@
 
 #define _SVARRAY_CXX
 
-#define _SVSTDARR_ULONGS
 #define _SVSTDARR_sal_uInt16S
 #define _SVSTDARR_STRINGS
 #define _SVSTDARR_STRINGSDTOR
@@ -62,7 +61,6 @@ sal_uInt16 SvPtrarr::GetPos( const VoidPtr& aElement ) const
     return ( n >= nA ? USHRT_MAX : n );
 }
 
-SV_IMPL_VARARR( SvULongs, sal_uLong )
 SV_IMPL_VARARR( SvUShorts, sal_uInt16 )
 
 SV_IMPL_PTRARR( SvStrings, StringPtr )


More information about the Libreoffice-commits mailing list