diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2013-12-12 12:48:55 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-12-12 15:10:35 +0100 |
commit | ab9e014d6fc1050de8510dbec816535972569bab (patch) | |
tree | 7d35a3fd5f93f32bd65914ae953ab237bbd5cef5 /comphelper | |
parent | 3f3c755475728b2f73ac45be3229970b5d616496 (diff) |
Some clean-up
Change-Id: I8ea3018efb01069b9a0555d9ac4ddfa89a990ba8
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/source/property/ChainablePropertySetInfo.cxx | 31 | ||||
-rw-r--r-- | comphelper/source/property/MasterPropertySetInfo.cxx | 38 |
2 files changed, 17 insertions, 52 deletions
diff --git a/comphelper/source/property/ChainablePropertySetInfo.cxx b/comphelper/source/property/ChainablePropertySetInfo.cxx index 97be665f5b65..5188331db2ad 100644 --- a/comphelper/source/property/ChainablePropertySetInfo.cxx +++ b/comphelper/source/property/ChainablePropertySetInfo.cxx @@ -32,9 +32,14 @@ using ::com::sun::star::beans::XPropertySetInfo; using ::com::sun::star::beans::UnknownPropertyException; ChainablePropertySetInfo::ChainablePropertySetInfo( PropertyInfo const * pMap ) - throw() { - add ( pMap ); + for( ; !pMap->maName.isEmpty(); ++pMap ) + { + SAL_WARN_IF( + maMap.find(pMap->maName) != maMap.end(), + "comphelper", "Duplicate property name \"" << pMap->maName << "\""); + maMap[pMap->maName] = pMap; + } } ChainablePropertySetInfo::~ChainablePropertySetInfo() @@ -42,29 +47,7 @@ ChainablePropertySetInfo::~ChainablePropertySetInfo() { } -void ChainablePropertySetInfo::add( PropertyInfo const * pMap, sal_Int32 nCount ) - throw() -{ - // nCount < 0 => add all - // nCount == 0 => add nothing - // nCount > 0 => add at most nCount entries - if( maProperties.getLength() ) - maProperties.realloc( 0 ); - - while( !pMap->maName.isEmpty() && ( ( nCount < 0) || ( nCount-- > 0 ) ) ) - { -#ifdef DBG_UTIL - PropertyInfoHash::iterator aIter = maMap.find( pMap->maName ); - if( aIter != maMap.end() ) - OSL_FAIL( "Warning: PropertyInfo added twice, possible error!"); -#endif - maMap[pMap->maName] = pMap; - ++pMap; - } -} - void ChainablePropertySetInfo::remove( const OUString& aName ) - throw() { maMap.erase ( aName ); if ( maProperties.getLength() ) diff --git a/comphelper/source/property/MasterPropertySetInfo.cxx b/comphelper/source/property/MasterPropertySetInfo.cxx index d6f1496dfb4b..5628e641e5bc 100644 --- a/comphelper/source/property/MasterPropertySetInfo.cxx +++ b/comphelper/source/property/MasterPropertySetInfo.cxx @@ -32,9 +32,14 @@ using ::com::sun::star::beans::XPropertySetInfo; using ::com::sun::star::beans::UnknownPropertyException; MasterPropertySetInfo::MasterPropertySetInfo( PropertyInfo const * pMap ) - throw() { - add ( pMap ); + for ( ; !pMap->maName.isEmpty(); ++pMap ) + { + SAL_WARN_IF( + maMap.find(pMap->maName) != maMap.end(), + "comphelper", "Duplicate property name \"" << pMap->maName << "\""); + maMap[pMap->maName] = new PropertyData ( 0, pMap ); + } } MasterPropertySetInfo::~MasterPropertySetInfo() @@ -48,28 +53,7 @@ MasterPropertySetInfo::~MasterPropertySetInfo() } } -void MasterPropertySetInfo::add( PropertyInfo const * pMap, sal_Int32 nCount, sal_uInt8 nMapId ) - throw() -{ - // nCount < 0 => add all - // nCount == 0 => add nothing - // nCount > 0 => add at most nCount entries - if( maProperties.getLength() ) - maProperties.realloc( 0 ); - - for ( ; !pMap->maName.isEmpty() && ( ( nCount < 0 ) || ( nCount > 0 ) ); --nCount, ++pMap ) - { -#ifdef DBG_UTIL - PropertyDataHash::iterator aIter = maMap.find( pMap->maName ); - if( aIter != maMap.end() ) - OSL_FAIL( "Warning: PropertyInfo added twice, possible error!"); -#endif - maMap[pMap->maName] = new PropertyData ( nMapId, pMap ); - } -} - void MasterPropertySetInfo::add( PropertyInfoHash &rHash, sal_uInt8 nMapId ) - throw() { if( maProperties.getLength() ) maProperties.realloc( 0 ); @@ -77,11 +61,9 @@ void MasterPropertySetInfo::add( PropertyInfoHash &rHash, sal_uInt8 nMapId ) while ( aIter != aEnd ) { -#ifdef DBG_UTIL - PropertyDataHash::iterator aDebugIter = maMap.find( (*aIter).first ); - if( aDebugIter != maMap.end() ) - OSL_FAIL( "Warning: PropertyInfo added twice, possible error!"); -#endif + SAL_WARN_IF( + maMap.find(aIter->first) != maMap.end(), + "comphelper", "Duplicate property name \"" << aIter->first << "\""); maMap[(*aIter).first] = new PropertyData ( nMapId, (*aIter).second ); ++aIter; } |