summaryrefslogtreecommitdiff
path: root/toolkit
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2012-03-11 13:14:36 +0200
committerMichael Stahl <mstahl@redhat.com>2012-03-13 23:19:54 +0100
commita4a7b956dc0ad439b52ef188ba0f4e5bcc215f91 (patch)
tree4dcc15c4a07efb327d3d0412a04c83ae18d3c008 /toolkit
parentaa998adbe3f7132998ba5aff438b540ff18a10bb (diff)
Convert tools/table.hxx usage to std::set in toolkit module in UnoPropertyArrayHelper class
Diffstat (limited to 'toolkit')
-rw-r--r--toolkit/inc/toolkit/helper/unopropertyarrayhelper.hxx5
-rw-r--r--toolkit/source/helper/unopropertyarrayhelper.cxx26
2 files changed, 15 insertions, 16 deletions
diff --git a/toolkit/inc/toolkit/helper/unopropertyarrayhelper.hxx b/toolkit/inc/toolkit/helper/unopropertyarrayhelper.hxx
index c109528beed9..8fc5aefca230 100644
--- a/toolkit/inc/toolkit/helper/unopropertyarrayhelper.hxx
+++ b/toolkit/inc/toolkit/helper/unopropertyarrayhelper.hxx
@@ -32,9 +32,8 @@
#include <toolkit/dllapi.h>
#include <cppuhelper/propshlp.hxx>
-#include <tools/table.hxx>
-
#include <list>
+#include <set>
#include "toolkit/dllapi.h"
// ----------------------------------------------------
@@ -43,7 +42,7 @@
class TOOLKIT_DLLPUBLIC UnoPropertyArrayHelper : public ::cppu::IPropertyArrayHelper
{
private:
- Table maIDs;
+ std::set<sal_Int32> maIDs;
protected:
sal_Bool ImplHasProperty( sal_uInt16 nPropId ) const;
diff --git a/toolkit/source/helper/unopropertyarrayhelper.cxx b/toolkit/source/helper/unopropertyarrayhelper.cxx
index 59403f897263..17f518e0c0c8 100644
--- a/toolkit/source/helper/unopropertyarrayhelper.cxx
+++ b/toolkit/source/helper/unopropertyarrayhelper.cxx
@@ -29,6 +29,7 @@
#include <toolkit/helper/unopropertyarrayhelper.hxx>
#include <toolkit/helper/property.hxx>
+#include <map>
// ----------------------------------------------------
// class UnoPropertyArrayHelper
@@ -39,14 +40,14 @@ UnoPropertyArrayHelper::UnoPropertyArrayHelper( const ::com::sun::star::uno::Seq
sal_Int32 nIDs = rIDs.getLength();
const sal_Int32* pIDs = rIDs.getConstArray();
for ( sal_Int32 n = 0; n < nIDs; n++ )
- maIDs.Insert( pIDs[n], (void*)1L );
+ maIDs.insert( pIDs[n] );
}
UnoPropertyArrayHelper::UnoPropertyArrayHelper( const std::list< sal_uInt16 > &rIDs )
{
std::list< sal_uInt16 >::const_iterator iter;
for( iter = rIDs.begin(); iter != rIDs.end(); ++iter)
- maIDs.Insert( *iter, (void*)1L);
+ maIDs.insert( *iter );
}
sal_Bool UnoPropertyArrayHelper::ImplHasProperty( sal_uInt16 nPropId ) const
@@ -54,7 +55,7 @@ sal_Bool UnoPropertyArrayHelper::ImplHasProperty( sal_uInt16 nPropId ) const
if ( ( nPropId >= BASEPROPERTY_FONTDESCRIPTORPART_START ) && ( nPropId <= BASEPROPERTY_FONTDESCRIPTORPART_END ) )
nPropId = BASEPROPERTY_FONTDESCRIPTOR;
- return maIDs.Get( nPropId ) ? sal_True : sal_False;
+ return maIDs.find( nPropId ) != maIDs.end() ? sal_True : sal_False;
}
// ::cppu::IPropertyArrayHelper
@@ -76,29 +77,28 @@ sal_Bool UnoPropertyArrayHelper::fillPropertyMembersByHandle( ::rtl::OUString *
{
// Sortiert nach Namen...
- Table aSortedPropsIds;
- sal_uInt32 nProps = maIDs.Count();
- for ( sal_uInt32 s = 0; s < nProps; s++ )
+ std::map<sal_Int32, sal_uInt16> aSortedPropsIds;
+ for( std::set<sal_Int32>::const_iterator it = maIDs.begin(); it != maIDs.end(); ++it)
{
- sal_uInt16 nId = sal::static_int_cast< sal_uInt16 >(
- maIDs.GetObjectKey( s ));
- aSortedPropsIds.Insert( 1+GetPropertyOrderNr( nId ), (void*)(sal_uIntPtr)nId );
+ sal_uInt16 nId = sal::static_int_cast< sal_uInt16 >(*it);
+ aSortedPropsIds[ 1+GetPropertyOrderNr( nId ) ] = nId;
if ( nId == BASEPROPERTY_FONTDESCRIPTOR )
{
// Einzelproperties...
for ( sal_uInt16 i = BASEPROPERTY_FONTDESCRIPTORPART_START; i <= BASEPROPERTY_FONTDESCRIPTORPART_END; i++ )
- aSortedPropsIds.Insert( 1+GetPropertyOrderNr( i ), (void*)(sal_uIntPtr)i );
+ aSortedPropsIds[ 1+GetPropertyOrderNr( i ) ] = i;
}
}
- nProps = aSortedPropsIds.Count(); // koennen jetzt mehr sein
+ sal_uInt32 nProps = aSortedPropsIds.size(); // koennen jetzt mehr sein
::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property> aProps( nProps );
::com::sun::star::beans::Property* pProps = aProps.getArray();
- for ( sal_uInt32 n = 0; n < nProps; n++ )
+ std::map<sal_Int32, sal_uInt16>::const_iterator it = aSortedPropsIds.begin();
+ for ( sal_uInt32 n = 0; n < nProps; n++, ++it )
{
- sal_uInt16 nId = (sal_uInt16)(sal_uLong)aSortedPropsIds.GetObject( n );
+ sal_uInt16 nId = it->second;
pProps[n].Name = GetPropertyName( nId );
pProps[n].Handle = nId;
pProps[n].Type = *GetPropertyType( nId );