simplify macros

Change-Id: Ib56bdc2f8a7015afc8ac83d7cfd6eb65089682bb
Reviewed-on: https://gerrit.libreoffice.org/31364
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2016-11-29 14:02:47 +02:00
parent 2833691149
commit 794c542953

View File

@@ -130,7 +130,7 @@ class PropertyValues : public std::vector< ucbhelper_impl::PropertyValue > {};
// Welcome to the macro hell...
#define GETVALUE_IMPL_TYPE( _type_, _type_name_, _member_name_, _cppu_type_ ) \
#define GETVALUE_IMPL( _type_, _type_name_, _member_name_ ) \
\
osl::MutexGuard aGuard( m_aMutex ); \
\
@@ -142,22 +142,22 @@ class PropertyValues : public std::vector< ucbhelper_impl::PropertyValue > {};
|| ( columnIndex > sal_Int32( m_pValues->size() ) ) ) \
{ \
OSL_FAIL( "PropertyValueSet - index out of range!" ); \
return aValue; \
} \
else \
{ \
ucbhelper_impl::PropertyValue& rValue \
= (*m_pValues)[ columnIndex - 1 ]; \
\
if ( rValue.nOrigValue != PropsSet::NONE ) \
{ \
if ( rValue.nOrigValue == PropsSet::NONE ) \
return aValue; \
\
if ( rValue.nPropsSet & _type_name_ ) \
{ \
/* Values is present natively... */ \
aValue = rValue._member_name_; \
m_bWasNull = false; \
return aValue; \
} \
else \
{ \
\
if ( !(rValue.nPropsSet & PropsSet::Object) ) \
{ \
/* Value is not (yet) available as Any. Create it. */ \
@@ -189,7 +189,7 @@ class PropertyValues : public std::vector< ucbhelper_impl::PropertyValue > {};
{ \
Any aConvAny = xConverter->convertTo( \
rValue.aObject, \
_cppu_type_ ); \
cppu::UnoType<_type_>::get() ); \
\
if ( aConvAny >>= aValue ) \
{ \
@@ -208,17 +208,8 @@ class PropertyValues : public std::vector< ucbhelper_impl::PropertyValue > {};
} \
} \
} \
} \
} \
} \
return aValue;
#define GETVALUE_IMPL( _type_, _type_name_, _member_name_ ) \
GETVALUE_IMPL_TYPE( _type_, \
_type_name_, \
_member_name_, \
cppu::UnoType<_type_>::get() )
#define SETVALUE_IMPL( _prop_name_, _type_name_, _member_name_, _value_ ) \
\
osl::MutexGuard aGuard( m_aMutex ); \
@@ -314,8 +305,7 @@ OUString SAL_CALL PropertyValueSet::getString( sal_Int32 columnIndex )
sal_Bool SAL_CALL PropertyValueSet::getBoolean( sal_Int32 columnIndex )
throw( SQLException, RuntimeException, std::exception )
{
GETVALUE_IMPL_TYPE(
bool, PropsSet::Boolean, bBoolean, cppu::UnoType<bool>::get() );
GETVALUE_IMPL( bool, PropsSet::Boolean, bBoolean );
}