INTEGRATION: CWS warnings01 (1.12.74); FILE MERGED

2005/09/22 15:39:27 sb 1.12.74.3: RESYNC: (1.12-1.13); FILE MERGED
2005/09/07 11:05:30 sb 1.12.74.2: #i53898# Made code warning-free.
2005/08/31 16:24:56 sb 1.12.74.1: #i53898# Made code warning-free.
This commit is contained in:
Jens-Heiner Rechtien
2006-06-19 09:34:35 +00:00
parent 0f44758c63
commit a29b5070c3

View File

@@ -4,9 +4,9 @@
* *
* $RCSfile: propshlp.cxx,v $ * $RCSfile: propshlp.cxx,v $
* *
* $Revision: 1.13 $ * $Revision: 1.14 $
* *
* last change: $Author: rt $ $Date: 2005-09-08 09:28:37 $ * last change: $Author: hr $ $Date: 2006-06-19 10:34:35 $
* *
* The Contents of this file are made available subject to * The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1. * the terms of GNU Lesser General Public License Version 2.1.
@@ -67,11 +67,16 @@ inline const ::com::sun::star::uno::Type & getVetoableTypeIdentifier() SAL_THROW
return ::getCppuType( (Reference< XVetoableChangeListener > *)0 ); return ::getCppuType( (Reference< XVetoableChangeListener > *)0 );
} }
int SAL_CALL compare_OUString_Property_Impl( const void *arg1, const void *arg2 ) SAL_THROW( () ) extern "C" {
static int compare_OUString_Property_Impl( const void *arg1, const void *arg2 )
SAL_THROW_EXTERN_C()
{ {
return ((OUString *)arg1)->compareTo( ((Property *)arg2)->Name ); return ((OUString *)arg1)->compareTo( ((Property *)arg2)->Name );
} }
}
/** /**
* The class which implements the PropertySetInfo interface. * The class which implements the PropertySetInfo interface.
*/ */
@@ -709,7 +714,7 @@ void OPropertySetHelper::setFastPropertyValues(
pConvertedValues = new Any[ nHitCount ]; pConvertedValues = new Any[ nHitCount ];
pOldValues = new Any[ nHitCount ]; pOldValues = new Any[ nHitCount ];
sal_Int32 nHitCount = 0; sal_Int32 n = 0;
sal_Int32 i; sal_Int32 i;
{ {
@@ -725,12 +730,12 @@ void OPropertySetHelper::setFastPropertyValues(
throw PropertyVetoException(); throw PropertyVetoException();
} }
// Will the property change? // Will the property change?
if( convertFastPropertyValue( pConvertedValues[ nHitCount ], pOldValues[nHitCount], if( convertFastPropertyValue( pConvertedValues[ n ], pOldValues[n],
pHandles[i], pValues[i] ) ) pHandles[i], pValues[i] ) )
{ {
// only increment if the property really change // only increment if the property really change
pHandles[nHitCount] = pHandles[i]; pHandles[n] = pHandles[i];
nHitCount++; n++;
} }
} }
} }
@@ -738,13 +743,13 @@ void OPropertySetHelper::setFastPropertyValues(
} }
// fire vetoable events // fire vetoable events
fire( pHandles, pConvertedValues, pOldValues, nHitCount, sal_True ); fire( pHandles, pConvertedValues, pOldValues, n, sal_True );
{ {
// must lock the mutex outside the loop. // must lock the mutex outside the loop.
MutexGuard aGuard( rBHelper.rMutex ); MutexGuard aGuard( rBHelper.rMutex );
// Loop over all changed properties // Loop over all changed properties
for( i = 0; i < nHitCount; i++ ) for( i = 0; i < n; i++ )
{ {
// Will the property change? // Will the property change?
setFastPropertyValue_NoBroadcast( pHandles[i], pConvertedValues[i] ); setFastPropertyValue_NoBroadcast( pHandles[i], pConvertedValues[i] );
@@ -753,7 +758,7 @@ void OPropertySetHelper::setFastPropertyValues(
} }
// fire change events // fire change events
fire( pHandles, pConvertedValues, pOldValues, nHitCount, sal_False ); fire( pHandles, pConvertedValues, pOldValues, n, sal_False );
} }
catch( ... ) catch( ... )
{ {
@@ -809,7 +814,6 @@ Sequence<Any> OPropertySetHelper::getPropertyValues( const Sequence<OUString>& r
rPH.fillHandles( pHandles, rPropertyNames ); rPH.fillHandles( pHandles, rPropertyNames );
Any * pValues = aValues.getArray(); Any * pValues = aValues.getArray();
const OUString * pNames = rPropertyNames.getConstArray();
MutexGuard aGuard( rBHelper.rMutex ); MutexGuard aGuard( rBHelper.rMutex );
// fill the sequence with the values // fill the sequence with the values
@@ -944,11 +948,16 @@ void OPropertySetHelper::removePropertyStateChangeListener( const OUString& aPro
// return ow; // return ow;
// } // }
int SAL_CALL compare_Property_Impl( const void *arg1, const void *arg2 ) SAL_THROW( () ) extern "C" {
static int compare_Property_Impl( const void *arg1, const void *arg2 )
SAL_THROW_EXTERN_C()
{ {
return ((Property *)arg1)->Name.compareTo( ((Property *)arg2)->Name ); return ((Property *)arg1)->Name.compareTo( ((Property *)arg2)->Name );
} }
}
void OPropertyArrayHelper::init( sal_Bool bSorted ) SAL_THROW( () ) void OPropertyArrayHelper::init( sal_Bool bSorted ) SAL_THROW( () )
{ {
sal_Int32 i, nElements = aInfos.getLength(); sal_Int32 i, nElements = aInfos.getLength();
@@ -958,7 +967,9 @@ void OPropertyArrayHelper::init( sal_Bool bSorted ) SAL_THROW( () )
{ {
if( pProperties[i-1].Name >= pProperties[i].Name ) if( pProperties[i-1].Name >= pProperties[i].Name )
{ {
OSL_ENSURE( !bSorted, "Property array is not sorted" ); if (bSorted) {
OSL_ENSURE( false, "Property array is not sorted" );
}
// not sorted // not sorted
qsort( aInfos.getArray(), nElements, sizeof( Property ), qsort( aInfos.getArray(), nElements, sizeof( Property ),
compare_Property_Impl ); compare_Property_Impl );