coverity#706280 Uncaught exception

Change-Id: I41d841718da2eab8a6f424df694ba8ea4e450bac
This commit is contained in:
Caolán McNamara 2014-06-13 11:18:47 +01:00
parent c8b78a1ca2
commit 63312dbbd3

View File

@ -113,32 +113,33 @@ void SAL_CALL ChainablePropertySet::removeVetoableChangeListener( const OUString
} }
// XMultiPropertySet // XMultiPropertySet
void SAL_CALL ChainablePropertySet::setPropertyValues( const Sequence< OUString >& aPropertyNames, const Sequence< Any >& aValues ) void SAL_CALL ChainablePropertySet::setPropertyValues(const Sequence< OUString >& rPropertyNames, const Sequence< Any >& rValues)
throw(PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException, std::exception) throw (PropertyVetoException, IllegalArgumentException,
WrappedTargetException, RuntimeException, std::exception)
{ {
// acquire mutex in c-tor and releases it in the d-tor (exception safe!). // acquire mutex in c-tor and releases it in the d-tor (exception safe!).
boost::scoped_ptr< osl::Guard< comphelper::SolarMutex > > pMutexGuard; boost::scoped_ptr< osl::Guard< comphelper::SolarMutex > > pMutexGuard;
if (mpMutex) if (mpMutex)
pMutexGuard.reset( new osl::Guard< comphelper::SolarMutex >(mpMutex) ); pMutexGuard.reset( new osl::Guard< comphelper::SolarMutex >(mpMutex) );
const sal_Int32 nCount = aPropertyNames.getLength(); const sal_Int32 nCount = rPropertyNames.getLength();
if( nCount != aValues.getLength() ) if( nCount != rValues.getLength() )
throw IllegalArgumentException(); throw IllegalArgumentException();
if( nCount ) if( nCount )
{ {
_preSetValues(); _preSetValues();
const Any * pAny = aValues.getConstArray(); const Any * pAny = rValues.getConstArray();
const OUString * pString = aPropertyNames.getConstArray(); const OUString * pString = rPropertyNames.getConstArray();
PropertyInfoHash::const_iterator aEnd = mpInfo->maMap.end(), aIter; PropertyInfoHash::const_iterator aEnd = mpInfo->maMap.end(), aIter;
for ( sal_Int32 i = 0; i < nCount; ++i, ++pString, ++pAny ) for ( sal_Int32 i = 0; i < nCount; ++i, ++pString, ++pAny )
{ {
aIter = mpInfo->maMap.find ( *pString ); aIter = mpInfo->maMap.find ( *pString );
if ( aIter == aEnd ) if ( aIter == aEnd )
throw UnknownPropertyException( *pString, static_cast< XPropertySet* >( this ) ); throw RuntimeException( *pString, static_cast< XPropertySet* >( this ) );
_setSingleValue ( *((*aIter).second), *pAny ); _setSingleValue ( *((*aIter).second), *pAny );
} }
@ -147,7 +148,7 @@ void SAL_CALL ChainablePropertySet::setPropertyValues( const Sequence< OUString
} }
} }
Sequence< Any > SAL_CALL ChainablePropertySet::getPropertyValues( const Sequence< OUString >& aPropertyNames ) Sequence< Any > SAL_CALL ChainablePropertySet::getPropertyValues(const Sequence< OUString >& rPropertyNames)
throw (RuntimeException, std::exception) throw (RuntimeException, std::exception)
{ {
// acquire mutex in c-tor and releases it in the d-tor (exception safe!). // acquire mutex in c-tor and releases it in the d-tor (exception safe!).
@ -155,7 +156,7 @@ Sequence< Any > SAL_CALL ChainablePropertySet::getPropertyValues( const Sequence
if (mpMutex) if (mpMutex)
pMutexGuard.reset( new osl::Guard< comphelper::SolarMutex >(mpMutex) ); pMutexGuard.reset( new osl::Guard< comphelper::SolarMutex >(mpMutex) );
const sal_Int32 nCount = aPropertyNames.getLength(); const sal_Int32 nCount = rPropertyNames.getLength();
Sequence < Any > aValues ( nCount ); Sequence < Any > aValues ( nCount );
@ -164,14 +165,14 @@ Sequence< Any > SAL_CALL ChainablePropertySet::getPropertyValues( const Sequence
_preGetValues(); _preGetValues();
Any * pAny = aValues.getArray(); Any * pAny = aValues.getArray();
const OUString * pString = aPropertyNames.getConstArray(); const OUString * pString = rPropertyNames.getConstArray();
PropertyInfoHash::const_iterator aEnd = mpInfo->maMap.end(), aIter; PropertyInfoHash::const_iterator aEnd = mpInfo->maMap.end(), aIter;
for ( sal_Int32 i = 0; i < nCount; ++i, ++pString, ++pAny ) for ( sal_Int32 i = 0; i < nCount; ++i, ++pString, ++pAny )
{ {
aIter = mpInfo->maMap.find ( *pString ); aIter = mpInfo->maMap.find ( *pString );
if ( aIter == aEnd ) if ( aIter == aEnd )
throw UnknownPropertyException( *pString, static_cast< XPropertySet* >( this ) ); throw RuntimeException( *pString, static_cast< XPropertySet* >( this ) );
_getSingleValue ( *((*aIter).second), *pAny ); _getSingleValue ( *((*aIter).second), *pAny );
} }