Let C++ inline functions return bool instead of sal_Bool
...to improve diagnosing misuses of boolean expressions in client code (cf. compilerplugins/clang/implicitboolconversion.cxx). This change should be transparent to client code. Change-Id: Ife614637082036dd17412f247be79233326c4f0b
This commit is contained in:
@@ -443,13 +443,13 @@ void Test::testBigStruct() {
|
|||||||
CPPUNIT_ASSERT_EQUAL(guard.p->m12.getLength(), static_cast< sal_Int32 >(0));
|
CPPUNIT_ASSERT_EQUAL(guard.p->m12.getLength(), static_cast< sal_Int32 >(0));
|
||||||
CPPUNIT_ASSERT_EQUAL(
|
CPPUNIT_ASSERT_EQUAL(
|
||||||
+guard.p->m13.getTypeClass(), +com::sun::star::uno::TypeClass_VOID);
|
+guard.p->m13.getTypeClass(), +com::sun::star::uno::TypeClass_VOID);
|
||||||
CPPUNIT_ASSERT_EQUAL(guard.p->m14.hasValue(), sal_False);
|
CPPUNIT_ASSERT_EQUAL(guard.p->m14.hasValue(), false);
|
||||||
CPPUNIT_ASSERT_EQUAL(guard.p->m15.getLength(), static_cast< sal_Int32 >(0));
|
CPPUNIT_ASSERT_EQUAL(guard.p->m15.getLength(), static_cast< sal_Int32 >(0));
|
||||||
CPPUNIT_ASSERT_EQUAL(
|
CPPUNIT_ASSERT_EQUAL(
|
||||||
+guard.p->m16, +test::codemaker::cppumaker::HelperEnum_ZERO);
|
+guard.p->m16, +test::codemaker::cppumaker::HelperEnum_ZERO);
|
||||||
CPPUNIT_ASSERT_EQUAL(guard.p->m17.m1, sal_False);
|
CPPUNIT_ASSERT_EQUAL(guard.p->m17.m1, sal_False);
|
||||||
CPPUNIT_ASSERT_EQUAL(guard.p->m17.m2.is(), sal_False);
|
CPPUNIT_ASSERT_EQUAL(guard.p->m17.m2.is(), false);
|
||||||
CPPUNIT_ASSERT_EQUAL(guard.p->m18.is(), sal_False);
|
CPPUNIT_ASSERT_EQUAL(guard.p->m18.is(), false);
|
||||||
CPPUNIT_ASSERT_EQUAL(guard.p->m19, static_cast< sal_Int8 >(0));
|
CPPUNIT_ASSERT_EQUAL(guard.p->m19, static_cast< sal_Int8 >(0));
|
||||||
CPPUNIT_ASSERT_EQUAL(
|
CPPUNIT_ASSERT_EQUAL(
|
||||||
+guard.p->m20, +test::codemaker::cppumaker::HelperEnum_ZERO);
|
+guard.p->m20, +test::codemaker::cppumaker::HelperEnum_ZERO);
|
||||||
|
@@ -147,7 +147,7 @@ public:
|
|||||||
|
|
||||||
@return true if any has a value, false otherwise
|
@return true if any has a value, false otherwise
|
||||||
*/
|
*/
|
||||||
inline sal_Bool SAL_CALL hasValue() const SAL_THROW(())
|
inline bool SAL_CALL hasValue() const SAL_THROW(())
|
||||||
{ return (typelib_TypeClass_VOID != pType->eTypeClass); }
|
{ return (typelib_TypeClass_VOID != pType->eTypeClass); }
|
||||||
|
|
||||||
/** Gets a pointer to the set value.
|
/** Gets a pointer to the set value.
|
||||||
@@ -205,7 +205,7 @@ public:
|
|||||||
@param rType destination type
|
@param rType destination type
|
||||||
@return true if this any is extractable to value of given type (e.g. using >>= operator)
|
@return true if this any is extractable to value of given type (e.g. using >>= operator)
|
||||||
*/
|
*/
|
||||||
inline sal_Bool SAL_CALL isExtractableTo( const Type & rType ) const SAL_THROW(());
|
inline bool SAL_CALL isExtractableTo( const Type & rType ) const SAL_THROW(());
|
||||||
|
|
||||||
/** Tests whether this any can provide a value of specified type.
|
/** Tests whether this any can provide a value of specified type.
|
||||||
Widening conversion without data loss is taken into account.
|
Widening conversion without data loss is taken into account.
|
||||||
@@ -222,14 +222,14 @@ public:
|
|||||||
@param rAny another any (right side)
|
@param rAny another any (right side)
|
||||||
@return true if both any contains equal values
|
@return true if both any contains equal values
|
||||||
*/
|
*/
|
||||||
inline sal_Bool SAL_CALL operator == ( const Any & rAny ) const SAL_THROW(());
|
inline bool SAL_CALL operator == ( const Any & rAny ) const SAL_THROW(());
|
||||||
/** Unequality operator: compares two anys.
|
/** Unequality operator: compares two anys.
|
||||||
The values need not be of equal type, e.g. a short integer is compared to a long integer.
|
The values need not be of equal type, e.g. a short integer is compared to a long integer.
|
||||||
|
|
||||||
@param rAny another any (right side)
|
@param rAny another any (right side)
|
||||||
@return true if both any contains unequal values
|
@return true if both any contains unequal values
|
||||||
*/
|
*/
|
||||||
inline sal_Bool SAL_CALL operator != ( const Any & rAny ) const SAL_THROW(());
|
inline bool SAL_CALL operator != ( const Any & rAny ) const SAL_THROW(());
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/// @cond INTERNAL
|
/// @cond INTERNAL
|
||||||
@@ -283,7 +283,7 @@ inline void SAL_CALL operator <<= ( Any & rAny, bool const & value )
|
|||||||
@return true if assignment was possible without data loss
|
@return true if assignment was possible without data loss
|
||||||
*/
|
*/
|
||||||
template< class C >
|
template< class C >
|
||||||
inline sal_Bool SAL_CALL operator >>= ( const Any & rAny, C & value ) SAL_THROW(());
|
inline bool SAL_CALL operator >>= ( const Any & rAny, C & value ) SAL_THROW(());
|
||||||
|
|
||||||
/** Template equality operator: compares set value of left side any to right side value.
|
/** Template equality operator: compares set value of left side any to right side value.
|
||||||
The values need not be of equal type, e.g. a short integer is compared to a long integer.
|
The values need not be of equal type, e.g. a short integer is compared to a long integer.
|
||||||
@@ -296,7 +296,7 @@ inline sal_Bool SAL_CALL operator >>= ( const Any & rAny, C & value ) SAL_THROW(
|
|||||||
@return true if values are equal, false otherwise
|
@return true if values are equal, false otherwise
|
||||||
*/
|
*/
|
||||||
template< class C >
|
template< class C >
|
||||||
inline sal_Bool SAL_CALL operator == ( const Any & rAny, const C & value ) SAL_THROW(());
|
inline bool SAL_CALL operator == ( const Any & rAny, const C & value ) SAL_THROW(());
|
||||||
/** Template unequality operator: compares set value of left side any to right side value.
|
/** Template unequality operator: compares set value of left side any to right side value.
|
||||||
The values need not be of equal type, e.g. a short integer is compared to a long integer.
|
The values need not be of equal type, e.g. a short integer is compared to a long integer.
|
||||||
This operator can be implemented as template member function, if all supported compilers
|
This operator can be implemented as template member function, if all supported compilers
|
||||||
@@ -308,43 +308,43 @@ inline sal_Bool SAL_CALL operator == ( const Any & rAny, const C & value ) SAL_T
|
|||||||
@return true if values are unequal, false otherwise
|
@return true if values are unequal, false otherwise
|
||||||
*/
|
*/
|
||||||
template< class C >
|
template< class C >
|
||||||
inline sal_Bool SAL_CALL operator != ( const Any & rAny, const C & value ) SAL_THROW(());
|
inline bool SAL_CALL operator != ( const Any & rAny, const C & value ) SAL_THROW(());
|
||||||
|
|
||||||
// additional specialized >>= and == operators
|
// additional specialized >>= and == operators
|
||||||
// bool
|
// bool
|
||||||
inline sal_Bool SAL_CALL operator >>= ( const Any & rAny, sal_Bool & value ) SAL_THROW(());
|
inline bool SAL_CALL operator >>= ( const Any & rAny, sal_Bool & value ) SAL_THROW(());
|
||||||
inline sal_Bool SAL_CALL operator == ( const Any & rAny, const sal_Bool & value ) SAL_THROW(());
|
inline bool SAL_CALL operator == ( const Any & rAny, const sal_Bool & value ) SAL_THROW(());
|
||||||
template<>
|
template<>
|
||||||
inline sal_Bool SAL_CALL operator >>= ( Any const & rAny, bool & value )
|
inline bool SAL_CALL operator >>= ( Any const & rAny, bool & value )
|
||||||
SAL_THROW(());
|
SAL_THROW(());
|
||||||
template<>
|
template<>
|
||||||
inline sal_Bool SAL_CALL operator == ( Any const & rAny, bool const & value )
|
inline bool SAL_CALL operator == ( Any const & rAny, bool const & value )
|
||||||
SAL_THROW(());
|
SAL_THROW(());
|
||||||
// byte
|
// byte
|
||||||
inline sal_Bool SAL_CALL operator >>= ( const Any & rAny, sal_Int8 & value ) SAL_THROW(());
|
inline bool SAL_CALL operator >>= ( const Any & rAny, sal_Int8 & value ) SAL_THROW(());
|
||||||
// short
|
// short
|
||||||
inline sal_Bool SAL_CALL operator >>= ( const Any & rAny, sal_Int16 & value ) SAL_THROW(());
|
inline bool SAL_CALL operator >>= ( const Any & rAny, sal_Int16 & value ) SAL_THROW(());
|
||||||
inline sal_Bool SAL_CALL operator >>= ( const Any & rAny, sal_uInt16 & value ) SAL_THROW(());
|
inline bool SAL_CALL operator >>= ( const Any & rAny, sal_uInt16 & value ) SAL_THROW(());
|
||||||
// long
|
// long
|
||||||
inline sal_Bool SAL_CALL operator >>= ( const Any & rAny, sal_Int32 & value ) SAL_THROW(());
|
inline bool SAL_CALL operator >>= ( const Any & rAny, sal_Int32 & value ) SAL_THROW(());
|
||||||
inline sal_Bool SAL_CALL operator >>= ( const Any & rAny, sal_uInt32 & value ) SAL_THROW(());
|
inline bool SAL_CALL operator >>= ( const Any & rAny, sal_uInt32 & value ) SAL_THROW(());
|
||||||
// hyper
|
// hyper
|
||||||
inline sal_Bool SAL_CALL operator >>= ( const Any & rAny, sal_Int64 & value ) SAL_THROW(());
|
inline bool SAL_CALL operator >>= ( const Any & rAny, sal_Int64 & value ) SAL_THROW(());
|
||||||
inline sal_Bool SAL_CALL operator >>= ( const Any & rAny, sal_uInt64 & value ) SAL_THROW(());
|
inline bool SAL_CALL operator >>= ( const Any & rAny, sal_uInt64 & value ) SAL_THROW(());
|
||||||
// float
|
// float
|
||||||
inline sal_Bool SAL_CALL operator >>= ( const Any & rAny, float & value ) SAL_THROW(());
|
inline bool SAL_CALL operator >>= ( const Any & rAny, float & value ) SAL_THROW(());
|
||||||
// double
|
// double
|
||||||
inline sal_Bool SAL_CALL operator >>= ( const Any & rAny, double & value ) SAL_THROW(());
|
inline bool SAL_CALL operator >>= ( const Any & rAny, double & value ) SAL_THROW(());
|
||||||
// string
|
// string
|
||||||
inline sal_Bool SAL_CALL operator >>= ( const Any & rAny, ::rtl::OUString & value ) SAL_THROW(());
|
inline bool SAL_CALL operator >>= ( const Any & rAny, ::rtl::OUString & value ) SAL_THROW(());
|
||||||
inline sal_Bool SAL_CALL operator == ( const Any & rAny, const ::rtl::OUString & value ) SAL_THROW(());
|
inline bool SAL_CALL operator == ( const Any & rAny, const ::rtl::OUString & value ) SAL_THROW(());
|
||||||
// type
|
// type
|
||||||
inline sal_Bool SAL_CALL operator >>= ( const Any & rAny, Type & value ) SAL_THROW(());
|
inline bool SAL_CALL operator >>= ( const Any & rAny, Type & value ) SAL_THROW(());
|
||||||
inline sal_Bool SAL_CALL operator == ( const Any & rAny, const Type & value ) SAL_THROW(());
|
inline bool SAL_CALL operator == ( const Any & rAny, const Type & value ) SAL_THROW(());
|
||||||
// any
|
// any
|
||||||
inline sal_Bool SAL_CALL operator >>= ( const Any & rAny, Any & value ) SAL_THROW(());
|
inline bool SAL_CALL operator >>= ( const Any & rAny, Any & value ) SAL_THROW(());
|
||||||
// interface
|
// interface
|
||||||
inline sal_Bool SAL_CALL operator == ( const Any & rAny, const BaseReference & value ) SAL_THROW(());
|
inline bool SAL_CALL operator == ( const Any & rAny, const BaseReference & value ) SAL_THROW(());
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -140,7 +140,7 @@ inline void Any::clear() SAL_THROW(())
|
|||||||
this, (uno_ReleaseFunc)cpp_release );
|
this, (uno_ReleaseFunc)cpp_release );
|
||||||
}
|
}
|
||||||
//__________________________________________________________________________________________________
|
//__________________________________________________________________________________________________
|
||||||
inline sal_Bool Any::isExtractableTo( const Type & rType ) const SAL_THROW(())
|
inline bool Any::isExtractableTo( const Type & rType ) const SAL_THROW(())
|
||||||
{
|
{
|
||||||
return ::uno_type_isAssignableFromData(
|
return ::uno_type_isAssignableFromData(
|
||||||
rType.getTypeLibType(), pData, pType,
|
rType.getTypeLibType(), pData, pType,
|
||||||
@@ -163,14 +163,14 @@ template <>
|
|||||||
bool Any::has<sal_uInt16>() const;
|
bool Any::has<sal_uInt16>() const;
|
||||||
|
|
||||||
//__________________________________________________________________________________________________
|
//__________________________________________________________________________________________________
|
||||||
inline sal_Bool Any::operator == ( const Any & rAny ) const SAL_THROW(())
|
inline bool Any::operator == ( const Any & rAny ) const SAL_THROW(())
|
||||||
{
|
{
|
||||||
return ::uno_type_equalData(
|
return ::uno_type_equalData(
|
||||||
pData, pType, rAny.pData, rAny.pType,
|
pData, pType, rAny.pData, rAny.pType,
|
||||||
(uno_QueryInterfaceFunc)cpp_queryInterface, (uno_ReleaseFunc)cpp_release );
|
(uno_QueryInterfaceFunc)cpp_queryInterface, (uno_ReleaseFunc)cpp_release );
|
||||||
}
|
}
|
||||||
//__________________________________________________________________________________________________
|
//__________________________________________________________________________________________________
|
||||||
inline sal_Bool Any::operator != ( const Any & rAny ) const SAL_THROW(())
|
inline bool Any::operator != ( const Any & rAny ) const SAL_THROW(())
|
||||||
{
|
{
|
||||||
return (! ::uno_type_equalData(
|
return (! ::uno_type_equalData(
|
||||||
pData, pType, rAny.pData, rAny.pType,
|
pData, pType, rAny.pData, rAny.pType,
|
||||||
@@ -238,7 +238,7 @@ inline void SAL_CALL operator <<= ( Any & rAny, const rtl::OUStringConcat< C1, C
|
|||||||
#endif
|
#endif
|
||||||
//__________________________________________________________________________________________________
|
//__________________________________________________________________________________________________
|
||||||
template< class C >
|
template< class C >
|
||||||
inline sal_Bool SAL_CALL operator >>= ( const Any & rAny, C & value ) SAL_THROW(())
|
inline bool SAL_CALL operator >>= ( const Any & rAny, C & value ) SAL_THROW(())
|
||||||
{
|
{
|
||||||
const Type & rType = ::cppu::getTypeFavourUnsigned(&value);
|
const Type & rType = ::cppu::getTypeFavourUnsigned(&value);
|
||||||
return ::uno_type_assignData(
|
return ::uno_type_assignData(
|
||||||
@@ -250,17 +250,17 @@ inline sal_Bool SAL_CALL operator >>= ( const Any & rAny, C & value ) SAL_THROW(
|
|||||||
|
|
||||||
// bool
|
// bool
|
||||||
//__________________________________________________________________________________________________
|
//__________________________________________________________________________________________________
|
||||||
inline sal_Bool SAL_CALL operator >>= ( const ::com::sun::star::uno::Any & rAny, sal_Bool & value ) SAL_THROW(())
|
inline bool SAL_CALL operator >>= ( const ::com::sun::star::uno::Any & rAny, sal_Bool & value ) SAL_THROW(())
|
||||||
{
|
{
|
||||||
if (typelib_TypeClass_BOOLEAN == rAny.pType->eTypeClass)
|
if (typelib_TypeClass_BOOLEAN == rAny.pType->eTypeClass)
|
||||||
{
|
{
|
||||||
value = (* reinterpret_cast< const sal_Bool * >( rAny.pData ) != sal_False);
|
value = (* reinterpret_cast< const sal_Bool * >( rAny.pData ) != sal_False);
|
||||||
return sal_True;
|
return true;
|
||||||
}
|
}
|
||||||
return sal_False;
|
return false;
|
||||||
}
|
}
|
||||||
//__________________________________________________________________________________________________
|
//__________________________________________________________________________________________________
|
||||||
inline sal_Bool SAL_CALL operator == ( const Any & rAny, const sal_Bool & value ) SAL_THROW(())
|
inline bool SAL_CALL operator == ( const Any & rAny, const sal_Bool & value ) SAL_THROW(())
|
||||||
{
|
{
|
||||||
return (typelib_TypeClass_BOOLEAN == rAny.pType->eTypeClass &&
|
return (typelib_TypeClass_BOOLEAN == rAny.pType->eTypeClass &&
|
||||||
(value != sal_False) == (* reinterpret_cast< const sal_Bool * >( rAny.pData ) != sal_False));
|
(value != sal_False) == (* reinterpret_cast< const sal_Bool * >( rAny.pData ) != sal_False));
|
||||||
@@ -268,7 +268,7 @@ inline sal_Bool SAL_CALL operator == ( const Any & rAny, const sal_Bool & value
|
|||||||
|
|
||||||
//______________________________________________________________________________
|
//______________________________________________________________________________
|
||||||
template<>
|
template<>
|
||||||
inline sal_Bool SAL_CALL operator >>= ( Any const & rAny, bool & value )
|
inline bool SAL_CALL operator >>= ( Any const & rAny, bool & value )
|
||||||
SAL_THROW(())
|
SAL_THROW(())
|
||||||
{
|
{
|
||||||
if (rAny.pType->eTypeClass == typelib_TypeClass_BOOLEAN)
|
if (rAny.pType->eTypeClass == typelib_TypeClass_BOOLEAN)
|
||||||
@@ -282,7 +282,7 @@ inline sal_Bool SAL_CALL operator >>= ( Any const & rAny, bool & value )
|
|||||||
|
|
||||||
//______________________________________________________________________________
|
//______________________________________________________________________________
|
||||||
template<>
|
template<>
|
||||||
inline sal_Bool SAL_CALL operator == ( Any const & rAny, bool const & value )
|
inline bool SAL_CALL operator == ( Any const & rAny, bool const & value )
|
||||||
SAL_THROW(())
|
SAL_THROW(())
|
||||||
{
|
{
|
||||||
return (rAny.pType->eTypeClass == typelib_TypeClass_BOOLEAN &&
|
return (rAny.pType->eTypeClass == typelib_TypeClass_BOOLEAN &&
|
||||||
@@ -293,240 +293,240 @@ inline sal_Bool SAL_CALL operator == ( Any const & rAny, bool const & value )
|
|||||||
|
|
||||||
// byte
|
// byte
|
||||||
//__________________________________________________________________________________________________
|
//__________________________________________________________________________________________________
|
||||||
inline sal_Bool SAL_CALL operator >>= ( const ::com::sun::star::uno::Any & rAny, sal_Int8 & value ) SAL_THROW(())
|
inline bool SAL_CALL operator >>= ( const ::com::sun::star::uno::Any & rAny, sal_Int8 & value ) SAL_THROW(())
|
||||||
{
|
{
|
||||||
if (typelib_TypeClass_BYTE == rAny.pType->eTypeClass)
|
if (typelib_TypeClass_BYTE == rAny.pType->eTypeClass)
|
||||||
{
|
{
|
||||||
value = * reinterpret_cast< const sal_Int8 * >( rAny.pData );
|
value = * reinterpret_cast< const sal_Int8 * >( rAny.pData );
|
||||||
return sal_True;
|
return true;
|
||||||
}
|
}
|
||||||
return sal_False;
|
return false;
|
||||||
}
|
}
|
||||||
// short
|
// short
|
||||||
//__________________________________________________________________________________________________
|
//__________________________________________________________________________________________________
|
||||||
inline sal_Bool SAL_CALL operator >>= ( const Any & rAny, sal_Int16 & value ) SAL_THROW(())
|
inline bool SAL_CALL operator >>= ( const Any & rAny, sal_Int16 & value ) SAL_THROW(())
|
||||||
{
|
{
|
||||||
switch (rAny.pType->eTypeClass)
|
switch (rAny.pType->eTypeClass)
|
||||||
{
|
{
|
||||||
case typelib_TypeClass_BYTE:
|
case typelib_TypeClass_BYTE:
|
||||||
value = * reinterpret_cast< const sal_Int8 * >( rAny.pData );
|
value = * reinterpret_cast< const sal_Int8 * >( rAny.pData );
|
||||||
return sal_True;
|
return true;
|
||||||
case typelib_TypeClass_SHORT:
|
case typelib_TypeClass_SHORT:
|
||||||
case typelib_TypeClass_UNSIGNED_SHORT:
|
case typelib_TypeClass_UNSIGNED_SHORT:
|
||||||
value = * reinterpret_cast< const sal_Int16 * >( rAny.pData );
|
value = * reinterpret_cast< const sal_Int16 * >( rAny.pData );
|
||||||
return sal_True;
|
return true;
|
||||||
default:
|
default:
|
||||||
return sal_False;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//__________________________________________________________________________________________________
|
//__________________________________________________________________________________________________
|
||||||
inline sal_Bool SAL_CALL operator >>= ( const Any & rAny, sal_uInt16 & value ) SAL_THROW(())
|
inline bool SAL_CALL operator >>= ( const Any & rAny, sal_uInt16 & value ) SAL_THROW(())
|
||||||
{
|
{
|
||||||
switch (rAny.pType->eTypeClass)
|
switch (rAny.pType->eTypeClass)
|
||||||
{
|
{
|
||||||
case typelib_TypeClass_BYTE:
|
case typelib_TypeClass_BYTE:
|
||||||
value = (sal_uInt16)( * reinterpret_cast< const sal_Int8 * >( rAny.pData ) );
|
value = (sal_uInt16)( * reinterpret_cast< const sal_Int8 * >( rAny.pData ) );
|
||||||
return sal_True;
|
return true;
|
||||||
case typelib_TypeClass_SHORT:
|
case typelib_TypeClass_SHORT:
|
||||||
case typelib_TypeClass_UNSIGNED_SHORT:
|
case typelib_TypeClass_UNSIGNED_SHORT:
|
||||||
value = * reinterpret_cast< const sal_uInt16 * >( rAny.pData );
|
value = * reinterpret_cast< const sal_uInt16 * >( rAny.pData );
|
||||||
return sal_True;
|
return true;
|
||||||
default:
|
default:
|
||||||
return sal_False;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// long
|
// long
|
||||||
//__________________________________________________________________________________________________
|
//__________________________________________________________________________________________________
|
||||||
inline sal_Bool SAL_CALL operator >>= ( const Any & rAny, sal_Int32 & value ) SAL_THROW(())
|
inline bool SAL_CALL operator >>= ( const Any & rAny, sal_Int32 & value ) SAL_THROW(())
|
||||||
{
|
{
|
||||||
switch (rAny.pType->eTypeClass)
|
switch (rAny.pType->eTypeClass)
|
||||||
{
|
{
|
||||||
case typelib_TypeClass_BYTE:
|
case typelib_TypeClass_BYTE:
|
||||||
value = * reinterpret_cast< const sal_Int8 * >( rAny.pData );
|
value = * reinterpret_cast< const sal_Int8 * >( rAny.pData );
|
||||||
return sal_True;
|
return true;
|
||||||
case typelib_TypeClass_SHORT:
|
case typelib_TypeClass_SHORT:
|
||||||
value = * reinterpret_cast< const sal_Int16 * >( rAny.pData );
|
value = * reinterpret_cast< const sal_Int16 * >( rAny.pData );
|
||||||
return sal_True;
|
return true;
|
||||||
case typelib_TypeClass_UNSIGNED_SHORT:
|
case typelib_TypeClass_UNSIGNED_SHORT:
|
||||||
value = * reinterpret_cast< const sal_uInt16 * >( rAny.pData );
|
value = * reinterpret_cast< const sal_uInt16 * >( rAny.pData );
|
||||||
return sal_True;
|
return true;
|
||||||
case typelib_TypeClass_LONG:
|
case typelib_TypeClass_LONG:
|
||||||
case typelib_TypeClass_UNSIGNED_LONG:
|
case typelib_TypeClass_UNSIGNED_LONG:
|
||||||
value = * reinterpret_cast< const sal_Int32 * >( rAny.pData );
|
value = * reinterpret_cast< const sal_Int32 * >( rAny.pData );
|
||||||
return sal_True;
|
return true;
|
||||||
default:
|
default:
|
||||||
return sal_False;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//__________________________________________________________________________________________________
|
//__________________________________________________________________________________________________
|
||||||
inline sal_Bool SAL_CALL operator >>= ( const Any & rAny, sal_uInt32 & value ) SAL_THROW(())
|
inline bool SAL_CALL operator >>= ( const Any & rAny, sal_uInt32 & value ) SAL_THROW(())
|
||||||
{
|
{
|
||||||
switch (rAny.pType->eTypeClass)
|
switch (rAny.pType->eTypeClass)
|
||||||
{
|
{
|
||||||
case typelib_TypeClass_BYTE:
|
case typelib_TypeClass_BYTE:
|
||||||
value = (sal_uInt32)( * reinterpret_cast< const sal_Int8 * >( rAny.pData ) );
|
value = (sal_uInt32)( * reinterpret_cast< const sal_Int8 * >( rAny.pData ) );
|
||||||
return sal_True;
|
return true;
|
||||||
case typelib_TypeClass_SHORT:
|
case typelib_TypeClass_SHORT:
|
||||||
value = (sal_uInt32)( * reinterpret_cast< const sal_Int16 * >( rAny.pData ) );
|
value = (sal_uInt32)( * reinterpret_cast< const sal_Int16 * >( rAny.pData ) );
|
||||||
return sal_True;
|
return true;
|
||||||
case typelib_TypeClass_UNSIGNED_SHORT:
|
case typelib_TypeClass_UNSIGNED_SHORT:
|
||||||
value = * reinterpret_cast< const sal_uInt16 * >( rAny.pData );
|
value = * reinterpret_cast< const sal_uInt16 * >( rAny.pData );
|
||||||
return sal_True;
|
return true;
|
||||||
case typelib_TypeClass_LONG:
|
case typelib_TypeClass_LONG:
|
||||||
case typelib_TypeClass_UNSIGNED_LONG:
|
case typelib_TypeClass_UNSIGNED_LONG:
|
||||||
value = * reinterpret_cast< const sal_uInt32 * >( rAny.pData );
|
value = * reinterpret_cast< const sal_uInt32 * >( rAny.pData );
|
||||||
return sal_True;
|
return true;
|
||||||
default:
|
default:
|
||||||
return sal_False;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// hyper
|
// hyper
|
||||||
//__________________________________________________________________________________________________
|
//__________________________________________________________________________________________________
|
||||||
inline sal_Bool SAL_CALL operator >>= ( const Any & rAny, sal_Int64 & value ) SAL_THROW(())
|
inline bool SAL_CALL operator >>= ( const Any & rAny, sal_Int64 & value ) SAL_THROW(())
|
||||||
{
|
{
|
||||||
switch (rAny.pType->eTypeClass)
|
switch (rAny.pType->eTypeClass)
|
||||||
{
|
{
|
||||||
case typelib_TypeClass_BYTE:
|
case typelib_TypeClass_BYTE:
|
||||||
value = * reinterpret_cast< const sal_Int8 * >( rAny.pData );
|
value = * reinterpret_cast< const sal_Int8 * >( rAny.pData );
|
||||||
return sal_True;
|
return true;
|
||||||
case typelib_TypeClass_SHORT:
|
case typelib_TypeClass_SHORT:
|
||||||
value = * reinterpret_cast< const sal_Int16 * >( rAny.pData );
|
value = * reinterpret_cast< const sal_Int16 * >( rAny.pData );
|
||||||
return sal_True;
|
return true;
|
||||||
case typelib_TypeClass_UNSIGNED_SHORT:
|
case typelib_TypeClass_UNSIGNED_SHORT:
|
||||||
value = * reinterpret_cast< const sal_uInt16 * >( rAny.pData );
|
value = * reinterpret_cast< const sal_uInt16 * >( rAny.pData );
|
||||||
return sal_True;
|
return true;
|
||||||
case typelib_TypeClass_LONG:
|
case typelib_TypeClass_LONG:
|
||||||
value = * reinterpret_cast< const sal_Int32 * >( rAny.pData );
|
value = * reinterpret_cast< const sal_Int32 * >( rAny.pData );
|
||||||
return sal_True;
|
return true;
|
||||||
case typelib_TypeClass_UNSIGNED_LONG:
|
case typelib_TypeClass_UNSIGNED_LONG:
|
||||||
value = * reinterpret_cast< const sal_uInt32 * >( rAny.pData );
|
value = * reinterpret_cast< const sal_uInt32 * >( rAny.pData );
|
||||||
return sal_True;
|
return true;
|
||||||
case typelib_TypeClass_HYPER:
|
case typelib_TypeClass_HYPER:
|
||||||
case typelib_TypeClass_UNSIGNED_HYPER:
|
case typelib_TypeClass_UNSIGNED_HYPER:
|
||||||
value = * reinterpret_cast< const sal_Int64 * >( rAny.pData );
|
value = * reinterpret_cast< const sal_Int64 * >( rAny.pData );
|
||||||
return sal_True;
|
return true;
|
||||||
default:
|
default:
|
||||||
return sal_False;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//__________________________________________________________________________________________________
|
//__________________________________________________________________________________________________
|
||||||
inline sal_Bool SAL_CALL operator >>= ( const Any & rAny, sal_uInt64 & value ) SAL_THROW(())
|
inline bool SAL_CALL operator >>= ( const Any & rAny, sal_uInt64 & value ) SAL_THROW(())
|
||||||
{
|
{
|
||||||
switch (rAny.pType->eTypeClass)
|
switch (rAny.pType->eTypeClass)
|
||||||
{
|
{
|
||||||
case typelib_TypeClass_BYTE:
|
case typelib_TypeClass_BYTE:
|
||||||
value = (sal_uInt64)( * reinterpret_cast< const sal_Int8 * >( rAny.pData ) );
|
value = (sal_uInt64)( * reinterpret_cast< const sal_Int8 * >( rAny.pData ) );
|
||||||
return sal_True;
|
return true;
|
||||||
case typelib_TypeClass_SHORT:
|
case typelib_TypeClass_SHORT:
|
||||||
value = (sal_uInt64)( * reinterpret_cast< const sal_Int16 * >( rAny.pData ) );
|
value = (sal_uInt64)( * reinterpret_cast< const sal_Int16 * >( rAny.pData ) );
|
||||||
return sal_True;
|
return true;
|
||||||
case typelib_TypeClass_UNSIGNED_SHORT:
|
case typelib_TypeClass_UNSIGNED_SHORT:
|
||||||
value = * reinterpret_cast< const sal_uInt16 * >( rAny.pData );
|
value = * reinterpret_cast< const sal_uInt16 * >( rAny.pData );
|
||||||
return sal_True;
|
return true;
|
||||||
case typelib_TypeClass_LONG:
|
case typelib_TypeClass_LONG:
|
||||||
value = (sal_uInt64)( * reinterpret_cast< const sal_Int32 * >( rAny.pData ) );
|
value = (sal_uInt64)( * reinterpret_cast< const sal_Int32 * >( rAny.pData ) );
|
||||||
return sal_True;
|
return true;
|
||||||
case typelib_TypeClass_UNSIGNED_LONG:
|
case typelib_TypeClass_UNSIGNED_LONG:
|
||||||
value = * reinterpret_cast< const sal_uInt32 * >( rAny.pData );
|
value = * reinterpret_cast< const sal_uInt32 * >( rAny.pData );
|
||||||
return sal_True;
|
return true;
|
||||||
case typelib_TypeClass_HYPER:
|
case typelib_TypeClass_HYPER:
|
||||||
case typelib_TypeClass_UNSIGNED_HYPER:
|
case typelib_TypeClass_UNSIGNED_HYPER:
|
||||||
value = * reinterpret_cast< const sal_uInt64 * >( rAny.pData );
|
value = * reinterpret_cast< const sal_uInt64 * >( rAny.pData );
|
||||||
return sal_True;
|
return true;
|
||||||
default:
|
default:
|
||||||
return sal_False;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// float
|
// float
|
||||||
//__________________________________________________________________________________________________
|
//__________________________________________________________________________________________________
|
||||||
inline sal_Bool SAL_CALL operator >>= ( const Any & rAny, float & value ) SAL_THROW(())
|
inline bool SAL_CALL operator >>= ( const Any & rAny, float & value ) SAL_THROW(())
|
||||||
{
|
{
|
||||||
switch (rAny.pType->eTypeClass)
|
switch (rAny.pType->eTypeClass)
|
||||||
{
|
{
|
||||||
case typelib_TypeClass_BYTE:
|
case typelib_TypeClass_BYTE:
|
||||||
value = * reinterpret_cast< const sal_Int8 * >( rAny.pData );
|
value = * reinterpret_cast< const sal_Int8 * >( rAny.pData );
|
||||||
return sal_True;
|
return true;
|
||||||
case typelib_TypeClass_SHORT:
|
case typelib_TypeClass_SHORT:
|
||||||
value = * reinterpret_cast< const sal_Int16 * >( rAny.pData );
|
value = * reinterpret_cast< const sal_Int16 * >( rAny.pData );
|
||||||
return sal_True;
|
return true;
|
||||||
case typelib_TypeClass_UNSIGNED_SHORT:
|
case typelib_TypeClass_UNSIGNED_SHORT:
|
||||||
value = * reinterpret_cast< const sal_uInt16 * >( rAny.pData );
|
value = * reinterpret_cast< const sal_uInt16 * >( rAny.pData );
|
||||||
return sal_True;
|
return true;
|
||||||
case typelib_TypeClass_FLOAT:
|
case typelib_TypeClass_FLOAT:
|
||||||
value = * reinterpret_cast< const float * >( rAny.pData );
|
value = * reinterpret_cast< const float * >( rAny.pData );
|
||||||
return sal_True;
|
return true;
|
||||||
default:
|
default:
|
||||||
return sal_False;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// double
|
// double
|
||||||
//__________________________________________________________________________________________________
|
//__________________________________________________________________________________________________
|
||||||
inline sal_Bool SAL_CALL operator >>= ( const Any & rAny, double & value ) SAL_THROW(())
|
inline bool SAL_CALL operator >>= ( const Any & rAny, double & value ) SAL_THROW(())
|
||||||
{
|
{
|
||||||
switch (rAny.pType->eTypeClass)
|
switch (rAny.pType->eTypeClass)
|
||||||
{
|
{
|
||||||
case typelib_TypeClass_BYTE:
|
case typelib_TypeClass_BYTE:
|
||||||
value = * reinterpret_cast< const sal_Int8 * >( rAny.pData );
|
value = * reinterpret_cast< const sal_Int8 * >( rAny.pData );
|
||||||
return sal_True;
|
return true;
|
||||||
case typelib_TypeClass_SHORT:
|
case typelib_TypeClass_SHORT:
|
||||||
value = * reinterpret_cast< const sal_Int16 * >( rAny.pData );
|
value = * reinterpret_cast< const sal_Int16 * >( rAny.pData );
|
||||||
return sal_True;
|
return true;
|
||||||
case typelib_TypeClass_UNSIGNED_SHORT:
|
case typelib_TypeClass_UNSIGNED_SHORT:
|
||||||
value = * reinterpret_cast< const sal_uInt16 * >( rAny.pData );
|
value = * reinterpret_cast< const sal_uInt16 * >( rAny.pData );
|
||||||
return sal_True;
|
return true;
|
||||||
case typelib_TypeClass_LONG:
|
case typelib_TypeClass_LONG:
|
||||||
value = * reinterpret_cast< const sal_Int32 * >( rAny.pData );
|
value = * reinterpret_cast< const sal_Int32 * >( rAny.pData );
|
||||||
return sal_True;
|
return true;
|
||||||
case typelib_TypeClass_UNSIGNED_LONG:
|
case typelib_TypeClass_UNSIGNED_LONG:
|
||||||
value = * reinterpret_cast< const sal_uInt32 * >( rAny.pData );
|
value = * reinterpret_cast< const sal_uInt32 * >( rAny.pData );
|
||||||
return sal_True;
|
return true;
|
||||||
case typelib_TypeClass_FLOAT:
|
case typelib_TypeClass_FLOAT:
|
||||||
value = * reinterpret_cast< const float * >( rAny.pData );
|
value = * reinterpret_cast< const float * >( rAny.pData );
|
||||||
return sal_True;
|
return true;
|
||||||
case typelib_TypeClass_DOUBLE:
|
case typelib_TypeClass_DOUBLE:
|
||||||
value = * reinterpret_cast< const double * >( rAny.pData );
|
value = * reinterpret_cast< const double * >( rAny.pData );
|
||||||
return sal_True;
|
return true;
|
||||||
default:
|
default:
|
||||||
return sal_False;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// string
|
// string
|
||||||
//__________________________________________________________________________________________________
|
//__________________________________________________________________________________________________
|
||||||
inline sal_Bool SAL_CALL operator >>= ( const Any & rAny, ::rtl::OUString & value ) SAL_THROW(())
|
inline bool SAL_CALL operator >>= ( const Any & rAny, ::rtl::OUString & value ) SAL_THROW(())
|
||||||
{
|
{
|
||||||
if (typelib_TypeClass_STRING == rAny.pType->eTypeClass)
|
if (typelib_TypeClass_STRING == rAny.pType->eTypeClass)
|
||||||
{
|
{
|
||||||
value = * reinterpret_cast< const ::rtl::OUString * >( rAny.pData );
|
value = * reinterpret_cast< const ::rtl::OUString * >( rAny.pData );
|
||||||
return sal_True;
|
return true;
|
||||||
}
|
}
|
||||||
return sal_False;
|
return false;
|
||||||
}
|
}
|
||||||
//__________________________________________________________________________________________________
|
//__________________________________________________________________________________________________
|
||||||
inline sal_Bool SAL_CALL operator == ( const Any & rAny, const ::rtl::OUString & value ) SAL_THROW(())
|
inline bool SAL_CALL operator == ( const Any & rAny, const ::rtl::OUString & value ) SAL_THROW(())
|
||||||
{
|
{
|
||||||
return (typelib_TypeClass_STRING == rAny.pType->eTypeClass &&
|
return (typelib_TypeClass_STRING == rAny.pType->eTypeClass &&
|
||||||
value.equals( * reinterpret_cast< const ::rtl::OUString * >( rAny.pData ) ));
|
value.equals( * reinterpret_cast< const ::rtl::OUString * >( rAny.pData ) ));
|
||||||
}
|
}
|
||||||
// type
|
// type
|
||||||
//__________________________________________________________________________________________________
|
//__________________________________________________________________________________________________
|
||||||
inline sal_Bool SAL_CALL operator >>= ( const Any & rAny, Type & value ) SAL_THROW(())
|
inline bool SAL_CALL operator >>= ( const Any & rAny, Type & value ) SAL_THROW(())
|
||||||
{
|
{
|
||||||
if (typelib_TypeClass_TYPE == rAny.pType->eTypeClass)
|
if (typelib_TypeClass_TYPE == rAny.pType->eTypeClass)
|
||||||
{
|
{
|
||||||
value = * reinterpret_cast< const Type * >( rAny.pData );
|
value = * reinterpret_cast< const Type * >( rAny.pData );
|
||||||
return sal_True;
|
return true;
|
||||||
}
|
}
|
||||||
return sal_False;
|
return false;
|
||||||
}
|
}
|
||||||
//__________________________________________________________________________________________________
|
//__________________________________________________________________________________________________
|
||||||
inline sal_Bool SAL_CALL operator == ( const Any & rAny, const Type & value ) SAL_THROW(())
|
inline bool SAL_CALL operator == ( const Any & rAny, const Type & value ) SAL_THROW(())
|
||||||
{
|
{
|
||||||
return (typelib_TypeClass_TYPE == rAny.pType->eTypeClass &&
|
return (typelib_TypeClass_TYPE == rAny.pType->eTypeClass &&
|
||||||
value.equals( * reinterpret_cast< const Type * >( rAny.pData ) ));
|
value.equals( * reinterpret_cast< const Type * >( rAny.pData ) ));
|
||||||
}
|
}
|
||||||
// any
|
// any
|
||||||
//__________________________________________________________________________________________________
|
//__________________________________________________________________________________________________
|
||||||
inline sal_Bool SAL_CALL operator >>= ( const Any & rAny, Any & value ) SAL_THROW(())
|
inline bool SAL_CALL operator >>= ( const Any & rAny, Any & value ) SAL_THROW(())
|
||||||
{
|
{
|
||||||
if (&rAny != &value)
|
if (&rAny != &value)
|
||||||
{
|
{
|
||||||
@@ -534,23 +534,23 @@ inline sal_Bool SAL_CALL operator >>= ( const Any & rAny, Any & value ) SAL_THRO
|
|||||||
&value, rAny.pData, rAny.pType,
|
&value, rAny.pData, rAny.pType,
|
||||||
(uno_AcquireFunc)cpp_acquire, (uno_ReleaseFunc)cpp_release );
|
(uno_AcquireFunc)cpp_acquire, (uno_ReleaseFunc)cpp_release );
|
||||||
}
|
}
|
||||||
return sal_True;
|
return true;
|
||||||
}
|
}
|
||||||
// interface
|
// interface
|
||||||
//__________________________________________________________________________________________________
|
//__________________________________________________________________________________________________
|
||||||
inline sal_Bool SAL_CALL operator == ( const Any & rAny, const BaseReference & value ) SAL_THROW(())
|
inline bool SAL_CALL operator == ( const Any & rAny, const BaseReference & value ) SAL_THROW(())
|
||||||
{
|
{
|
||||||
if (typelib_TypeClass_INTERFACE == rAny.pType->eTypeClass)
|
if (typelib_TypeClass_INTERFACE == rAny.pType->eTypeClass)
|
||||||
{
|
{
|
||||||
return reinterpret_cast< const BaseReference * >( rAny.pData )->operator == ( value );
|
return reinterpret_cast< const BaseReference * >( rAny.pData )->operator == ( value );
|
||||||
}
|
}
|
||||||
return sal_False;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// operator to compare to an any.
|
// operator to compare to an any.
|
||||||
//__________________________________________________________________________________________________
|
//__________________________________________________________________________________________________
|
||||||
template< class C >
|
template< class C >
|
||||||
inline sal_Bool SAL_CALL operator == ( const Any & rAny, const C & value ) SAL_THROW(())
|
inline bool SAL_CALL operator == ( const Any & rAny, const C & value ) SAL_THROW(())
|
||||||
{
|
{
|
||||||
const Type & rType = ::cppu::getTypeFavourUnsigned(&value);
|
const Type & rType = ::cppu::getTypeFavourUnsigned(&value);
|
||||||
return ::uno_type_equalData(
|
return ::uno_type_equalData(
|
||||||
@@ -561,7 +561,7 @@ inline sal_Bool SAL_CALL operator == ( const Any & rAny, const C & value ) SAL_T
|
|||||||
// operator to compare to an any. may use specialized operators ==.
|
// operator to compare to an any. may use specialized operators ==.
|
||||||
//__________________________________________________________________________________________________
|
//__________________________________________________________________________________________________
|
||||||
template< class C >
|
template< class C >
|
||||||
inline sal_Bool SAL_CALL operator != ( const Any & rAny, const C & value ) SAL_THROW(())
|
inline bool SAL_CALL operator != ( const Any & rAny, const C & value ) SAL_THROW(())
|
||||||
{
|
{
|
||||||
return (! operator == ( rAny, value ));
|
return (! operator == ( rAny, value ));
|
||||||
}
|
}
|
||||||
|
@@ -88,7 +88,7 @@ public:
|
|||||||
|
|
||||||
@return true if reference acquires an interface, i.e. true if it is not null
|
@return true if reference acquires an interface, i.e. true if it is not null
|
||||||
*/
|
*/
|
||||||
inline sal_Bool SAL_CALL is() const SAL_THROW(())
|
inline bool SAL_CALL is() const SAL_THROW(())
|
||||||
{ return (0 != _pInterface); }
|
{ return (0 != _pInterface); }
|
||||||
|
|
||||||
/** Equality operator: compares two interfaces
|
/** Equality operator: compares two interfaces
|
||||||
@@ -97,14 +97,14 @@ public:
|
|||||||
@param pInterface another interface
|
@param pInterface another interface
|
||||||
@return true if both references are null or refer to the same object, false otherwise
|
@return true if both references are null or refer to the same object, false otherwise
|
||||||
*/
|
*/
|
||||||
inline sal_Bool SAL_CALL operator == ( XInterface * pInterface ) const SAL_THROW(());
|
inline bool SAL_CALL operator == ( XInterface * pInterface ) const SAL_THROW(());
|
||||||
/** Unequality operator: compares two interfaces
|
/** Unequality operator: compares two interfaces
|
||||||
Checks if both references are null or refer to the same object.
|
Checks if both references are null or refer to the same object.
|
||||||
|
|
||||||
@param pInterface another interface
|
@param pInterface another interface
|
||||||
@return false if both references are null or refer to the same object, true otherwise
|
@return false if both references are null or refer to the same object, true otherwise
|
||||||
*/
|
*/
|
||||||
inline sal_Bool SAL_CALL operator != ( XInterface * pInterface ) const SAL_THROW(());
|
inline bool SAL_CALL operator != ( XInterface * pInterface ) const SAL_THROW(());
|
||||||
|
|
||||||
/** Equality operator: compares two interfaces
|
/** Equality operator: compares two interfaces
|
||||||
Checks if both references are null or refer to the same object.
|
Checks if both references are null or refer to the same object.
|
||||||
@@ -112,21 +112,21 @@ public:
|
|||||||
@param rRef another reference
|
@param rRef another reference
|
||||||
@return true if both references are null or refer to the same object, false otherwise
|
@return true if both references are null or refer to the same object, false otherwise
|
||||||
*/
|
*/
|
||||||
inline sal_Bool SAL_CALL operator == ( const BaseReference & rRef ) const SAL_THROW(());
|
inline bool SAL_CALL operator == ( const BaseReference & rRef ) const SAL_THROW(());
|
||||||
/** Unequality operator: compares two interfaces
|
/** Unequality operator: compares two interfaces
|
||||||
Checks if both references are null or refer to the same object.
|
Checks if both references are null or refer to the same object.
|
||||||
|
|
||||||
@param rRef another reference
|
@param rRef another reference
|
||||||
@return false if both references are null or refer to the same object, true otherwise
|
@return false if both references are null or refer to the same object, true otherwise
|
||||||
*/
|
*/
|
||||||
inline sal_Bool SAL_CALL operator != ( const BaseReference & rRef ) const SAL_THROW(());
|
inline bool SAL_CALL operator != ( const BaseReference & rRef ) const SAL_THROW(());
|
||||||
|
|
||||||
/** Needed by some STL containers.
|
/** Needed by some STL containers.
|
||||||
|
|
||||||
@param rRef another reference
|
@param rRef another reference
|
||||||
@return true, if this reference is less than rRef
|
@return true, if this reference is less than rRef
|
||||||
*/
|
*/
|
||||||
inline sal_Bool SAL_CALL operator < ( const BaseReference & rRef ) const SAL_THROW(());
|
inline bool SAL_CALL operator < ( const BaseReference & rRef ) const SAL_THROW(());
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Enum defining UNO_QUERY for implicit interface query.
|
/** Enum defining UNO_QUERY for implicit interface query.
|
||||||
@@ -420,13 +420,13 @@ public:
|
|||||||
@param rRef another reference
|
@param rRef another reference
|
||||||
@return true, if non-null interface was set
|
@return true, if non-null interface was set
|
||||||
*/
|
*/
|
||||||
inline sal_Bool SAL_CALL set( const Reference< interface_type > & rRef ) SAL_THROW(());
|
inline bool SAL_CALL set( const Reference< interface_type > & rRef ) SAL_THROW(());
|
||||||
/** Sets the given interface. An interface already set will be released.
|
/** Sets the given interface. An interface already set will be released.
|
||||||
|
|
||||||
@param pInterface another interface
|
@param pInterface another interface
|
||||||
@return true, if non-null interface was set
|
@return true, if non-null interface was set
|
||||||
*/
|
*/
|
||||||
inline sal_Bool SAL_CALL set( interface_type * pInterface ) SAL_THROW(());
|
inline bool SAL_CALL set( interface_type * pInterface ) SAL_THROW(());
|
||||||
|
|
||||||
/** Sets interface pointer without acquiring it. An interface already set will be released.
|
/** Sets interface pointer without acquiring it. An interface already set will be released.
|
||||||
|
|
||||||
@@ -434,7 +434,7 @@ public:
|
|||||||
@param dummy SAL_NO_ACQUIRE to force obvious distinction to set methods
|
@param dummy SAL_NO_ACQUIRE to force obvious distinction to set methods
|
||||||
@return true, if non-null interface was set
|
@return true, if non-null interface was set
|
||||||
*/
|
*/
|
||||||
inline sal_Bool SAL_CALL set( interface_type * pInterface, __sal_NoAcquire dummy) SAL_THROW(());
|
inline bool SAL_CALL set( interface_type * pInterface, __sal_NoAcquire dummy) SAL_THROW(());
|
||||||
/** Sets interface pointer without acquiring it. An interface already set will be released.
|
/** Sets interface pointer without acquiring it. An interface already set will be released.
|
||||||
Deprecated, please use SAL_NO_ACQUIRE version.
|
Deprecated, please use SAL_NO_ACQUIRE version.
|
||||||
|
|
||||||
@@ -443,7 +443,7 @@ public:
|
|||||||
@param dummy UNO_REF_NO_ACQUIRE to force obvious distinction to set methods
|
@param dummy UNO_REF_NO_ACQUIRE to force obvious distinction to set methods
|
||||||
@return true, if non-null interface was set
|
@return true, if non-null interface was set
|
||||||
*/
|
*/
|
||||||
inline sal_Bool SAL_CALL set( interface_type * pInterface, UnoReference_NoAcquire dummy) SAL_THROW(());
|
inline bool SAL_CALL set( interface_type * pInterface, UnoReference_NoAcquire dummy) SAL_THROW(());
|
||||||
|
|
||||||
/** Queries given interface for reference interface type (interface_type) and sets it.
|
/** Queries given interface for reference interface type (interface_type) and sets it.
|
||||||
An interface already set will be released.
|
An interface already set will be released.
|
||||||
@@ -452,7 +452,7 @@ public:
|
|||||||
@param dummy UNO_QUERY to force obvious distinction to set methods
|
@param dummy UNO_QUERY to force obvious distinction to set methods
|
||||||
@return true, if non-null interface was set
|
@return true, if non-null interface was set
|
||||||
*/
|
*/
|
||||||
inline sal_Bool SAL_CALL set( XInterface * pInterface, UnoReference_Query dummy ) SAL_THROW( (RuntimeException) );
|
inline bool SAL_CALL set( XInterface * pInterface, UnoReference_Query dummy ) SAL_THROW( (RuntimeException) );
|
||||||
/** Queries given interface for reference interface type (interface_type) and sets it.
|
/** Queries given interface for reference interface type (interface_type) and sets it.
|
||||||
An interface already set will be released.
|
An interface already set will be released.
|
||||||
|
|
||||||
@@ -460,7 +460,7 @@ public:
|
|||||||
@param dummy UNO_QUERY to force obvious distinction to set methods
|
@param dummy UNO_QUERY to force obvious distinction to set methods
|
||||||
@return true, if non-null interface was set
|
@return true, if non-null interface was set
|
||||||
*/
|
*/
|
||||||
inline sal_Bool SAL_CALL set( const BaseReference & rRef, UnoReference_Query dummy) SAL_THROW( (RuntimeException) );
|
inline bool SAL_CALL set( const BaseReference & rRef, UnoReference_Query dummy) SAL_THROW( (RuntimeException) );
|
||||||
|
|
||||||
/** Queries given any for reference interface type (interface_type)
|
/** Queries given any for reference interface type (interface_type)
|
||||||
and sets it. An interface already set will be released.
|
and sets it. An interface already set will be released.
|
||||||
|
@@ -215,7 +215,7 @@ inline void Reference< interface_type >::clear() SAL_THROW(())
|
|||||||
}
|
}
|
||||||
//__________________________________________________________________________________________________
|
//__________________________________________________________________________________________________
|
||||||
template< class interface_type >
|
template< class interface_type >
|
||||||
inline sal_Bool Reference< interface_type >::set(
|
inline bool Reference< interface_type >::set(
|
||||||
interface_type * pInterface ) SAL_THROW(())
|
interface_type * pInterface ) SAL_THROW(())
|
||||||
{
|
{
|
||||||
if (pInterface)
|
if (pInterface)
|
||||||
@@ -228,7 +228,7 @@ inline sal_Bool Reference< interface_type >::set(
|
|||||||
}
|
}
|
||||||
//__________________________________________________________________________________________________
|
//__________________________________________________________________________________________________
|
||||||
template< class interface_type >
|
template< class interface_type >
|
||||||
inline sal_Bool Reference< interface_type >::set(
|
inline bool Reference< interface_type >::set(
|
||||||
interface_type * pInterface, __sal_NoAcquire ) SAL_THROW(())
|
interface_type * pInterface, __sal_NoAcquire ) SAL_THROW(())
|
||||||
{
|
{
|
||||||
XInterface * const pOld = _pInterface;
|
XInterface * const pOld = _pInterface;
|
||||||
@@ -239,7 +239,7 @@ inline sal_Bool Reference< interface_type >::set(
|
|||||||
}
|
}
|
||||||
//__________________________________________________________________________________________________
|
//__________________________________________________________________________________________________
|
||||||
template< class interface_type >
|
template< class interface_type >
|
||||||
inline sal_Bool Reference< interface_type >::set(
|
inline bool Reference< interface_type >::set(
|
||||||
interface_type * pInterface, UnoReference_NoAcquire ) SAL_THROW(())
|
interface_type * pInterface, UnoReference_NoAcquire ) SAL_THROW(())
|
||||||
{
|
{
|
||||||
return set( pInterface, SAL_NO_ACQUIRE );
|
return set( pInterface, SAL_NO_ACQUIRE );
|
||||||
@@ -247,21 +247,21 @@ inline sal_Bool Reference< interface_type >::set(
|
|||||||
|
|
||||||
//__________________________________________________________________________________________________
|
//__________________________________________________________________________________________________
|
||||||
template< class interface_type >
|
template< class interface_type >
|
||||||
inline sal_Bool Reference< interface_type >::set(
|
inline bool Reference< interface_type >::set(
|
||||||
const Reference< interface_type > & rRef ) SAL_THROW(())
|
const Reference< interface_type > & rRef ) SAL_THROW(())
|
||||||
{
|
{
|
||||||
return set( castFromXInterface( rRef._pInterface ) );
|
return set( castFromXInterface( rRef._pInterface ) );
|
||||||
}
|
}
|
||||||
//__________________________________________________________________________________________________
|
//__________________________________________________________________________________________________
|
||||||
template< class interface_type >
|
template< class interface_type >
|
||||||
inline sal_Bool Reference< interface_type >::set(
|
inline bool Reference< interface_type >::set(
|
||||||
XInterface * pInterface, UnoReference_Query ) SAL_THROW( (RuntimeException) )
|
XInterface * pInterface, UnoReference_Query ) SAL_THROW( (RuntimeException) )
|
||||||
{
|
{
|
||||||
return set( castFromXInterface(iquery( pInterface )), SAL_NO_ACQUIRE );
|
return set( castFromXInterface(iquery( pInterface )), SAL_NO_ACQUIRE );
|
||||||
}
|
}
|
||||||
//__________________________________________________________________________________________________
|
//__________________________________________________________________________________________________
|
||||||
template< class interface_type >
|
template< class interface_type >
|
||||||
inline sal_Bool Reference< interface_type >::set(
|
inline bool Reference< interface_type >::set(
|
||||||
const BaseReference & rRef, UnoReference_Query ) SAL_THROW( (RuntimeException) )
|
const BaseReference & rRef, UnoReference_Query ) SAL_THROW( (RuntimeException) )
|
||||||
{
|
{
|
||||||
return set( castFromXInterface(iquery( rRef.get() )), SAL_NO_ACQUIRE );
|
return set( castFromXInterface(iquery( rRef.get() )), SAL_NO_ACQUIRE );
|
||||||
@@ -358,10 +358,10 @@ inline Reference< interface_type > Reference< interface_type >::query(
|
|||||||
//##################################################################################################
|
//##################################################################################################
|
||||||
|
|
||||||
//__________________________________________________________________________________________________
|
//__________________________________________________________________________________________________
|
||||||
inline sal_Bool BaseReference::operator == ( XInterface * pInterface ) const SAL_THROW(())
|
inline bool BaseReference::operator == ( XInterface * pInterface ) const SAL_THROW(())
|
||||||
{
|
{
|
||||||
if (_pInterface == pInterface)
|
if (_pInterface == pInterface)
|
||||||
return sal_True;
|
return true;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// only the query to XInterface must return the same pointer if they belong to same objects
|
// only the query to XInterface must return the same pointer if they belong to same objects
|
||||||
@@ -371,16 +371,16 @@ inline sal_Bool BaseReference::operator == ( XInterface * pInterface ) const SAL
|
|||||||
}
|
}
|
||||||
catch (RuntimeException &)
|
catch (RuntimeException &)
|
||||||
{
|
{
|
||||||
return sal_False;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//______________________________________________________________________________
|
//______________________________________________________________________________
|
||||||
inline sal_Bool BaseReference::operator < (
|
inline bool BaseReference::operator < (
|
||||||
const BaseReference & rRef ) const SAL_THROW(())
|
const BaseReference & rRef ) const SAL_THROW(())
|
||||||
{
|
{
|
||||||
if (_pInterface == rRef._pInterface)
|
if (_pInterface == rRef._pInterface)
|
||||||
return sal_False;
|
return false;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// only the query to XInterface must return the same pointer:
|
// only the query to XInterface must return the same pointer:
|
||||||
@@ -390,22 +390,22 @@ inline sal_Bool BaseReference::operator < (
|
|||||||
}
|
}
|
||||||
catch (RuntimeException &)
|
catch (RuntimeException &)
|
||||||
{
|
{
|
||||||
return sal_False;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//__________________________________________________________________________________________________
|
//__________________________________________________________________________________________________
|
||||||
inline sal_Bool BaseReference::operator != ( XInterface * pInterface ) const SAL_THROW(())
|
inline bool BaseReference::operator != ( XInterface * pInterface ) const SAL_THROW(())
|
||||||
{
|
{
|
||||||
return (! operator == ( pInterface ));
|
return (! operator == ( pInterface ));
|
||||||
}
|
}
|
||||||
//__________________________________________________________________________________________________
|
//__________________________________________________________________________________________________
|
||||||
inline sal_Bool BaseReference::operator == ( const BaseReference & rRef ) const SAL_THROW(())
|
inline bool BaseReference::operator == ( const BaseReference & rRef ) const SAL_THROW(())
|
||||||
{
|
{
|
||||||
return operator == ( rRef._pInterface );
|
return operator == ( rRef._pInterface );
|
||||||
}
|
}
|
||||||
//__________________________________________________________________________________________________
|
//__________________________________________________________________________________________________
|
||||||
inline sal_Bool BaseReference::operator != ( const BaseReference & rRef ) const SAL_THROW(())
|
inline bool BaseReference::operator != ( const BaseReference & rRef ) const SAL_THROW(())
|
||||||
{
|
{
|
||||||
return (! operator == ( rRef._pInterface ));
|
return (! operator == ( rRef._pInterface ));
|
||||||
}
|
}
|
||||||
|
@@ -140,7 +140,7 @@ public:
|
|||||||
|
|
||||||
@return true, if elements count is greater than zero
|
@return true, if elements count is greater than zero
|
||||||
*/
|
*/
|
||||||
inline sal_Bool SAL_CALL hasElements() const SAL_THROW(())
|
inline bool SAL_CALL hasElements() const SAL_THROW(())
|
||||||
{ return (_pSequence->nElements > 0); }
|
{ return (_pSequence->nElements > 0); }
|
||||||
|
|
||||||
/** Gets a pointer to elements array for reading.
|
/** Gets a pointer to elements array for reading.
|
||||||
@@ -217,7 +217,7 @@ public:
|
|||||||
@param rSeq another sequence of same type (right side)
|
@param rSeq another sequence of same type (right side)
|
||||||
@return true if both sequences are equal, false otherwise
|
@return true if both sequences are equal, false otherwise
|
||||||
*/
|
*/
|
||||||
inline sal_Bool SAL_CALL operator == ( const Sequence< E > & rSeq ) const
|
inline bool SAL_CALL operator == ( const Sequence< E > & rSeq ) const
|
||||||
SAL_THROW(());
|
SAL_THROW(());
|
||||||
|
|
||||||
/** Unequality operator: Compares two sequences.
|
/** Unequality operator: Compares two sequences.
|
||||||
@@ -225,7 +225,7 @@ public:
|
|||||||
@param rSeq another sequence of same type (right side)
|
@param rSeq another sequence of same type (right side)
|
||||||
@return false if both sequences are equal, true otherwise
|
@return false if both sequences are equal, true otherwise
|
||||||
*/
|
*/
|
||||||
inline sal_Bool SAL_CALL operator != ( const Sequence< E > & rSeq ) const
|
inline bool SAL_CALL operator != ( const Sequence< E > & rSeq ) const
|
||||||
SAL_THROW(());
|
SAL_THROW(());
|
||||||
|
|
||||||
/** Reallocates sequence to new length.
|
/** Reallocates sequence to new length.
|
||||||
|
@@ -110,11 +110,11 @@ inline Sequence< E > & Sequence< E >::operator = ( const Sequence< E > & rSeq )
|
|||||||
}
|
}
|
||||||
|
|
||||||
template< class E >
|
template< class E >
|
||||||
inline sal_Bool Sequence< E >::operator == ( const Sequence< E > & rSeq ) const
|
inline bool Sequence< E >::operator == ( const Sequence< E > & rSeq ) const
|
||||||
SAL_THROW(())
|
SAL_THROW(())
|
||||||
{
|
{
|
||||||
if (_pSequence == rSeq._pSequence)
|
if (_pSequence == rSeq._pSequence)
|
||||||
return sal_True;
|
return true;
|
||||||
const Type & rType = ::cppu::getTypeFavourUnsigned( this );
|
const Type & rType = ::cppu::getTypeFavourUnsigned( this );
|
||||||
return ::uno_type_equalData(
|
return ::uno_type_equalData(
|
||||||
const_cast< Sequence< E > * >( this ), rType.getTypeLibType(),
|
const_cast< Sequence< E > * >( this ), rType.getTypeLibType(),
|
||||||
@@ -124,7 +124,7 @@ inline sal_Bool Sequence< E >::operator == ( const Sequence< E > & rSeq ) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
template< class E >
|
template< class E >
|
||||||
inline sal_Bool Sequence< E >::operator != ( const Sequence< E > & rSeq ) const
|
inline bool Sequence< E >::operator != ( const Sequence< E > & rSeq ) const
|
||||||
SAL_THROW(())
|
SAL_THROW(())
|
||||||
{
|
{
|
||||||
return (! operator == ( rSeq ));
|
return (! operator == ( rSeq ));
|
||||||
|
@@ -163,7 +163,7 @@ public:
|
|||||||
@return true if values of this type can be assigned from values of given type,
|
@return true if values of this type can be assigned from values of given type,
|
||||||
false otherwise
|
false otherwise
|
||||||
*/
|
*/
|
||||||
inline sal_Bool SAL_CALL isAssignableFrom( const Type & rType ) const SAL_THROW(())
|
inline bool SAL_CALL isAssignableFrom( const Type & rType ) const SAL_THROW(())
|
||||||
{ return ::typelib_typedescriptionreference_isAssignableFrom( _pType, rType._pType ); }
|
{ return ::typelib_typedescriptionreference_isAssignableFrom( _pType, rType._pType ); }
|
||||||
|
|
||||||
/** Compares two types.
|
/** Compares two types.
|
||||||
@@ -171,21 +171,21 @@ public:
|
|||||||
@param rType another type
|
@param rType another type
|
||||||
@return true if both types refer the same type, false otherwise
|
@return true if both types refer the same type, false otherwise
|
||||||
*/
|
*/
|
||||||
inline sal_Bool SAL_CALL equals( const Type & rType ) const SAL_THROW(())
|
inline bool SAL_CALL equals( const Type & rType ) const SAL_THROW(())
|
||||||
{ return ::typelib_typedescriptionreference_equals( _pType, rType._pType ); }
|
{ return ::typelib_typedescriptionreference_equals( _pType, rType._pType ); }
|
||||||
/** Equality operator: Compares two types.
|
/** Equality operator: Compares two types.
|
||||||
|
|
||||||
@param rType another type
|
@param rType another type
|
||||||
@return true if both types refer the same type, false otherwise
|
@return true if both types refer the same type, false otherwise
|
||||||
*/
|
*/
|
||||||
inline sal_Bool SAL_CALL operator == ( const Type & rType ) const SAL_THROW(())
|
inline bool SAL_CALL operator == ( const Type & rType ) const SAL_THROW(())
|
||||||
{ return ::typelib_typedescriptionreference_equals( _pType, rType._pType ); }
|
{ return ::typelib_typedescriptionreference_equals( _pType, rType._pType ); }
|
||||||
/** Unequality operator: Compares two types.
|
/** Unequality operator: Compares two types.
|
||||||
|
|
||||||
@param rType another type
|
@param rType another type
|
||||||
@return false if both types refer the same type, true otherwise
|
@return false if both types refer the same type, true otherwise
|
||||||
*/
|
*/
|
||||||
inline sal_Bool SAL_CALL operator != ( const Type & rType ) const SAL_THROW(())
|
inline bool SAL_CALL operator != ( const Type & rType ) const SAL_THROW(())
|
||||||
{ return (! ::typelib_typedescriptionreference_equals( _pType, rType._pType )); }
|
{ return (! ::typelib_typedescriptionreference_equals( _pType, rType._pType )); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user