cppuhelper: sal_Bool -> bool

Change-Id: I6e0e6c1e4880a652ea4d8f0cccf9d8103c2cbbef
This commit is contained in:
Stephan Bergmann
2014-02-16 20:57:55 +01:00
parent 34a44156b3
commit 7f902e1697
7 changed files with 36 additions and 36 deletions

View File

@@ -148,14 +148,14 @@ void OComponentHelper::dispose()
// Guard dispose against multible threading // Guard dispose against multible threading
// Remark: It is an error to call dispose more than once // Remark: It is an error to call dispose more than once
sal_Bool bDoDispose = sal_False; bool bDoDispose = false;
{ {
MutexGuard aGuard( rBHelper.rMutex ); MutexGuard aGuard( rBHelper.rMutex );
if( !rBHelper.bDisposed && !rBHelper.bInDispose ) if( !rBHelper.bDisposed && !rBHelper.bInDispose )
{ {
// only one call go into this section // only one call go into this section
rBHelper.bInDispose = sal_True; rBHelper.bInDispose = sal_True;
bDoDispose = sal_True; bDoDispose = true;
} }
} }

View File

@@ -275,7 +275,7 @@ public:
ComponentInstantiation pCreateFunction_, ComponentInstantiation pCreateFunction_,
ComponentFactoryFunc fptr, ComponentFactoryFunc fptr,
const Sequence< OUString > * pServiceNames_, const Sequence< OUString > * pServiceNames_,
sal_Bool bOneInstance_ = sal_False ) bool bOneInstance_ = false )
SAL_THROW(()) SAL_THROW(())
: OComponentHelper( aMutex ) : OComponentHelper( aMutex )
, OSingleFactoryHelper( rServiceManager, rImplementationName_, pCreateFunction_, fptr, pServiceNames_ ) , OSingleFactoryHelper( rServiceManager, rImplementationName_, pCreateFunction_, fptr, pServiceNames_ )
@@ -322,11 +322,11 @@ public:
private: private:
Reference<XInterface > xTheInstance; Reference<XInterface > xTheInstance;
sal_Bool bOneInstance; bool bOneInstance;
protected: protected:
// needed for implementing XUnloadingPreference in inheriting classes // needed for implementing XUnloadingPreference in inheriting classes
sal_Bool isOneInstance() {return bOneInstance;} bool isOneInstance() {return bOneInstance;}
sal_Bool isInstance() {return xTheInstance.is();} bool isInstance() {return xTheInstance.is();}
}; };
@@ -494,7 +494,7 @@ public:
const Reference<XMultiServiceFactory > & rServiceManager, const Reference<XMultiServiceFactory > & rServiceManager,
const OUString & rImplementationName_, const OUString & rImplementationName_,
const Reference<XRegistryKey > & xImplementationKey_, const Reference<XRegistryKey > & xImplementationKey_,
sal_Bool bOneInstance_ = sal_False ) SAL_THROW(()) bool bOneInstance_ = false ) SAL_THROW(())
: OFactoryComponentHelper( : OFactoryComponentHelper(
rServiceManager, rImplementationName_, 0, 0, 0, bOneInstance_ ), rServiceManager, rImplementationName_, 0, 0, 0, bOneInstance_ ),
OPropertySetHelper( OComponentHelper::rBHelper ), OPropertySetHelper( OComponentHelper::rBHelper ),
@@ -868,10 +868,10 @@ Sequence< OUString > ORegistryFactoryHelper::getSupportedServiceNames(void)
sal_Bool SAL_CALL ORegistryFactoryHelper::releaseOnNotification() throw(::com::sun::star::uno::RuntimeException) sal_Bool SAL_CALL ORegistryFactoryHelper::releaseOnNotification() throw(::com::sun::star::uno::RuntimeException)
{ {
sal_Bool retVal= sal_True; bool retVal= true;
if( isOneInstance() && isInstance()) if( isOneInstance() && isInstance())
{ {
retVal= sal_False; retVal= false;
} }
else if( ! isOneInstance()) else if( ! isOneInstance())
{ {
@@ -986,7 +986,7 @@ Reference<XSingleServiceFactory > SAL_CALL createSingleFactory(
SAL_THROW(()) SAL_THROW(())
{ {
return new OFactoryComponentHelper( return new OFactoryComponentHelper(
rServiceManager, rImplementationName, pCreateFunction, 0, &rServiceNames, sal_False ); rServiceManager, rImplementationName, pCreateFunction, 0, &rServiceNames, false );
} }
// global function // global function
@@ -1008,7 +1008,7 @@ Reference<XSingleServiceFactory > SAL_CALL createOneInstanceFactory(
SAL_THROW(()) SAL_THROW(())
{ {
return new OFactoryComponentHelper( return new OFactoryComponentHelper(
rServiceManager, rImplementationName, pCreateFunction, 0, &rServiceNames, sal_True ); rServiceManager, rImplementationName, pCreateFunction, 0, &rServiceNames, true );
} }
// global function // global function
@@ -1019,7 +1019,7 @@ Reference<XSingleServiceFactory > SAL_CALL createSingleRegistryFactory(
SAL_THROW(()) SAL_THROW(())
{ {
return new ORegistryFactoryHelper( return new ORegistryFactoryHelper(
rServiceManager, rImplementationName, rImplementationKey, sal_False ); rServiceManager, rImplementationName, rImplementationKey, false );
} }
// global function // global function
@@ -1030,7 +1030,7 @@ Reference<XSingleServiceFactory > SAL_CALL createOneInstanceRegistryFactory(
SAL_THROW(()) SAL_THROW(())
{ {
return new ORegistryFactoryHelper( return new ORegistryFactoryHelper(
rServiceManager, rImplementationName, rImplementationKey, sal_True ); rServiceManager, rImplementationName, rImplementationKey, true );
} }
//################################################################################################## //##################################################################################################
@@ -1042,7 +1042,7 @@ Reference< lang::XSingleComponentFactory > SAL_CALL createSingleComponentFactory
SAL_THROW(()) SAL_THROW(())
{ {
return new OFactoryComponentHelper( return new OFactoryComponentHelper(
Reference< XMultiServiceFactory >(), rImplementationName, 0, fptr, &rServiceNames, sal_False ); Reference< XMultiServiceFactory >(), rImplementationName, 0, fptr, &rServiceNames, false );
} }
Reference< lang::XSingleComponentFactory > SAL_CALL createOneInstanceComponentFactory( Reference< lang::XSingleComponentFactory > SAL_CALL createOneInstanceComponentFactory(
@@ -1053,7 +1053,7 @@ Reference< lang::XSingleComponentFactory > SAL_CALL createOneInstanceComponentFa
SAL_THROW(()) SAL_THROW(())
{ {
return new OFactoryComponentHelper( return new OFactoryComponentHelper(
Reference< XMultiServiceFactory >(), rImplementationName, 0, fptr, &rServiceNames, sal_True ); Reference< XMultiServiceFactory >(), rImplementationName, 0, fptr, &rServiceNames, true );
} }
} }

View File

@@ -157,7 +157,7 @@ Sequence< sal_Int8 > ClassData::getImplementationId() SAL_THROW(())
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
static inline sal_Bool td_equals( static inline bool td_equals(
typelib_TypeDescription * pTD, typelib_TypeDescriptionReference * pType ) typelib_TypeDescription * pTD, typelib_TypeDescriptionReference * pType )
SAL_THROW(()) SAL_THROW(())
{ {

View File

@@ -31,7 +31,7 @@ sal_Bool component_writeInfoHelper(
SAL_UNUSED_PARAMETER void *, void * pRegistryKey, SAL_UNUSED_PARAMETER void *, void * pRegistryKey,
ImplementationEntry const * entries) ImplementationEntry const * entries)
{ {
sal_Bool bRet = sal_False; bool bRet = false;
try try
{ {
if( pRegistryKey ) if( pRegistryKey )
@@ -47,7 +47,7 @@ sal_Bool component_writeInfoHelper(
for ( sal_Int32 nPos = 0 ; nPos < seq.getLength(); nPos ++ ) for ( sal_Int32 nPos = 0 ; nPos < seq.getLength(); nPos ++ )
xNewKey->createKey( pArray[nPos] ); xNewKey->createKey( pArray[nPos] );
} }
bRet = sal_True; bRet = true;
} }
} }
catch ( InvalidRegistryException & ) catch ( InvalidRegistryException & )

View File

@@ -95,7 +95,7 @@ OInterfaceIteratorHelper::OInterfaceIteratorHelper( OInterfaceContainerHelper &
OInterfaceIteratorHelper::~OInterfaceIteratorHelper() SAL_THROW(()) OInterfaceIteratorHelper::~OInterfaceIteratorHelper() SAL_THROW(())
{ {
sal_Bool bShared; bool bShared;
{ {
MutexGuard aGuard( rCont.rMutex ); MutexGuard aGuard( rCont.rMutex );
// bResetInUse protect the iterator against recursion // bResetInUse protect the iterator against recursion

View File

@@ -465,7 +465,7 @@ void OPropertySetHelper::setDependentFastPropertyValue( sal_Int32 i_handle, cons
// to change their value. // to change their value.
Any aConverted, aOld; Any aConverted, aOld;
sal_Bool bChanged = convertFastPropertyValue( aConverted, aOld, i_handle, i_value ); bool bChanged = convertFastPropertyValue( aConverted, aOld, i_handle, i_value );
if ( !bChanged ) if ( !bChanged )
return; return;
@@ -524,7 +524,7 @@ void OPropertySetHelper::setFastPropertyValue( sal_Int32 nHandle, const Any& rVa
Any aOldVal; Any aOldVal;
// Will the property change? // Will the property change?
sal_Bool bChanged; bool bChanged;
{ {
MutexGuard aGuard( rBHelper.rMutex ); MutexGuard aGuard( rBHelper.rMutex );
bChanged = convertFastPropertyValue( aConvertedVal, aOldVal, nHandle, rValue ); bChanged = convertFastPropertyValue( aConvertedVal, aOldVal, nHandle, rValue );

View File

@@ -59,16 +59,16 @@ inline void SAL_CALL convertPropertyValue( sal_Bool & b , const ::com::sun::st
if( ::com::sun::star::uno::TypeClass_LONG == tc ) { if( ::com::sun::star::uno::TypeClass_LONG == tc ) {
sal_Int32 i32 = 0; sal_Int32 i32 = 0;
a >>= i32; a >>= i32;
b = ( sal_Bool )i32; b = i32 != 0;
} }
else if ( ::com::sun::star::uno::TypeClass_CHAR == tc ) { else if ( ::com::sun::star::uno::TypeClass_CHAR == tc ) {
sal_Unicode c = *(sal_Unicode*) a.getValue(); sal_Unicode c = *(sal_Unicode*) a.getValue();
b = ( sal_Bool ) c; b = c != 0;
} }
else if ( ::com::sun::star::uno::TypeClass_SHORT == tc ) { else if ( ::com::sun::star::uno::TypeClass_SHORT == tc ) {
sal_Int16 i16 = 0; sal_Int16 i16 = 0;
a >>= i16; a >>= i16;
b = ( sal_Bool ) i16; b = i16 != 0;
} }
else if ( ::com::sun::star::uno::TypeClass_BOOLEAN == tc ) { else if ( ::com::sun::star::uno::TypeClass_BOOLEAN == tc ) {
b = *((sal_Bool*)a.getValue()); b = *((sal_Bool*)a.getValue());
@@ -76,17 +76,17 @@ inline void SAL_CALL convertPropertyValue( sal_Bool & b , const ::com::sun::st
else if ( ::com::sun::star::uno::TypeClass_BYTE == tc ) { else if ( ::com::sun::star::uno::TypeClass_BYTE == tc ) {
sal_Int8 i8 = 0; sal_Int8 i8 = 0;
a >>= i8; a >>= i8;
b = ( sal_Bool ) i8; b = i8 != 0;
} }
else if ( ::com::sun::star::uno::TypeClass_UNSIGNED_SHORT == tc ) { else if ( ::com::sun::star::uno::TypeClass_UNSIGNED_SHORT == tc ) {
sal_uInt16 i16 = 0; sal_uInt16 i16 = 0;
a >>= i16; a >>= i16;
b = ( sal_Bool ) i16; b = i16 != 0;
} }
else if ( ::com::sun::star::uno::TypeClass_UNSIGNED_LONG == tc ) { else if ( ::com::sun::star::uno::TypeClass_UNSIGNED_LONG == tc ) {
sal_uInt32 i32 = 0; sal_uInt32 i32 = 0;
a >>= i32; a >>= i32;
b = ( sal_Bool ) i32; b = i32 != 0;
} }
else { else {
throw ::com::sun::star::lang::IllegalArgumentException(); throw ::com::sun::star::lang::IllegalArgumentException();
@@ -122,7 +122,7 @@ inline void SAL_CALL convertPropertyValue( sal_Int64 & i , const ::com::sun::st
i = ( sal_Int64 ) i16; i = ( sal_Int64 ) i16;
} }
else if ( ::com::sun::star::uno::TypeClass_BOOLEAN == tc ) { else if ( ::com::sun::star::uno::TypeClass_BOOLEAN == tc ) {
sal_Bool b; bool b;
b = *((sal_Bool * )a.getValue()); b = *((sal_Bool * )a.getValue());
i = ( sal_Int64 ) b; i = ( sal_Int64 ) b;
} }
@@ -176,7 +176,7 @@ inline void SAL_CALL convertPropertyValue( sal_uInt64 & i , const ::com::sun::s
i = ( sal_uInt64 ) i16; i = ( sal_uInt64 ) i16;
} }
else if ( ::com::sun::star::uno::TypeClass_BOOLEAN == tc ) { else if ( ::com::sun::star::uno::TypeClass_BOOLEAN == tc ) {
sal_Bool b; bool b;
b = *((sal_Bool * )a.getValue()); b = *((sal_Bool * )a.getValue());
i = ( sal_uInt64 ) b; i = ( sal_uInt64 ) b;
} }
@@ -221,7 +221,7 @@ inline void SAL_CALL convertPropertyValue( sal_Int32 & i , const ::com::sun::st
i = ( sal_Int32 ) i16; i = ( sal_Int32 ) i16;
} }
else if ( ::com::sun::star::uno::TypeClass_BOOLEAN == tc ) { else if ( ::com::sun::star::uno::TypeClass_BOOLEAN == tc ) {
sal_Bool b; bool b;
b = *((sal_Bool * )a.getValue()); b = *((sal_Bool * )a.getValue());
i = ( sal_Int32 ) b; i = ( sal_Int32 ) b;
} }
@@ -269,7 +269,7 @@ inline void SAL_CALL convertPropertyValue( sal_uInt32 & i , const ::com::sun::s
i = ( sal_uInt32 ) i16; i = ( sal_uInt32 ) i16;
} }
else if ( ::com::sun::star::uno::TypeClass_BOOLEAN == tc ) { else if ( ::com::sun::star::uno::TypeClass_BOOLEAN == tc ) {
sal_Bool b; bool b;
b = *((sal_Bool * )a.getValue()); b = *((sal_Bool * )a.getValue());
i = ( sal_uInt32 ) b; i = ( sal_uInt32 ) b;
} }
@@ -303,7 +303,7 @@ inline void SAL_CALL convertPropertyValue( sal_Int16 & i , const ::com::sun::st
i = ( sal_Int16 ) c; i = ( sal_Int16 ) c;
} }
else if ( ::com::sun::star::uno::TypeClass_BOOLEAN == tc ) { else if ( ::com::sun::star::uno::TypeClass_BOOLEAN == tc ) {
sal_Bool b; bool b;
b = *((sal_Bool * )a.getValue()); b = *((sal_Bool * )a.getValue());
i = ( sal_Int16 ) b; i = ( sal_Int16 ) b;
} }
@@ -336,7 +336,7 @@ inline void SAL_CALL convertPropertyValue( sal_uInt16 & i , const ::com::sun::s
i = ( sal_Int16 ) c; i = ( sal_Int16 ) c;
} }
else if ( ::com::sun::star::uno::TypeClass_BOOLEAN == tc ) { else if ( ::com::sun::star::uno::TypeClass_BOOLEAN == tc ) {
sal_Bool b; bool b;
b = *((sal_Bool * )a.getValue()); b = *((sal_Bool * )a.getValue());
i = ( sal_Int16 ) b; i = ( sal_Int16 ) b;
} }
@@ -364,7 +364,7 @@ inline void SAL_CALL convertPropertyValue( sal_Int8 & i , const ::com::sun::sta
a >>= i; a >>= i;
} }
else if ( ::com::sun::star::uno::TypeClass_BOOLEAN == tc ) { else if ( ::com::sun::star::uno::TypeClass_BOOLEAN == tc ) {
sal_Bool b; bool b;
b = *((sal_Bool * )a.getValue()); b = *((sal_Bool * )a.getValue());
i = ( sal_Int8 ) b; i = ( sal_Int8 ) b;
} }
@@ -413,7 +413,7 @@ inline void SAL_CALL convertPropertyValue( float &f , const ::com::sun::star::un
f = ( float ) i16; f = ( float ) i16;
} }
else if ( ::com::sun::star::uno::TypeClass_BOOLEAN == tc ) { else if ( ::com::sun::star::uno::TypeClass_BOOLEAN == tc ) {
sal_Bool b; bool b;
b = *((sal_Bool * )a.getValue()); b = *((sal_Bool * )a.getValue());
f = ( float ) b; f = ( float ) b;
} }
@@ -480,7 +480,7 @@ inline void SAL_CALL convertPropertyValue( double &d , const ::com::sun::star::u
d = (double) i16; d = (double) i16;
} }
else if ( ::com::sun::star::uno::TypeClass_BOOLEAN == tc ) { else if ( ::com::sun::star::uno::TypeClass_BOOLEAN == tc ) {
sal_Bool b; bool b;
b = *((sal_Bool * )a.getValue()); b = *((sal_Bool * )a.getValue());
d = (double) b; d = (double) b;
} }