diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2011-09-12 11:11:41 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2011-09-12 22:47:47 +0200 |
commit | 27b9f9f348b720e08f37db829533372dc4b73248 (patch) | |
tree | 8e70c504b059226a9006c9f6007d33451cae7aad /xmloff/inc | |
parent | 63fd3f18ac597f58622a3730d0860534c77c52b5 (diff) |
sb140: #i117310# remove unnecessary dependency on XTypeProvider::getImplementationId
plus
sb140: #i117310# missing include
sb140: #i117310# support EXCEPTIONS_OFF (no UNO_QUERY_THROW)
Diffstat (limited to 'xmloff/inc')
-rwxr-xr-x[-rw-r--r--] | xmloff/inc/xmloff/PropertySetInfoHash.hxx | 47 | ||||
-rw-r--r-- | xmloff/inc/xmloff/SinglePropertySetInfoCache.hxx | 3 | ||||
-rw-r--r-- | xmloff/inc/xmloff/txtparae.hxx | 3 |
3 files changed, 29 insertions, 24 deletions
diff --git a/xmloff/inc/xmloff/PropertySetInfoHash.hxx b/xmloff/inc/xmloff/PropertySetInfoHash.hxx index 802f2445c770..300efae90310 100644..100755 --- a/xmloff/inc/xmloff/PropertySetInfoHash.hxx +++ b/xmloff/inc/xmloff/PropertySetInfoHash.hxx @@ -28,40 +28,41 @@ #ifndef _XMLOFF_PROPERTYSETINFOHASH_HXX #define _XMLOFF_PROPERTYSETINFOHASH_HXX -#include <xmloff/PropertySetInfoKey.hxx> +#include "sal/config.h" -#include <string.h> -#include <memory> +#include <cstddef> + +#include "com/sun/star/beans/XPropertySetInfo.hpp" +#include "com/sun/star/uno/Reference.hxx" +#include "com/sun/star/uno/XInterface.hpp" +#include "osl/diagnose.h" +#include "sal/types.h" struct PropertySetInfoHash { - inline size_t operator()( const PropertySetInfoKey& r ) const; - inline bool operator()( const PropertySetInfoKey& r1, - const PropertySetInfoKey& r2 ) const; + inline std::size_t operator()( const com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo >& r ) const; + inline bool operator()( const com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo >& r1, + const com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo >& r2 ) const; }; -inline size_t PropertySetInfoHash::operator()( - const PropertySetInfoKey& r ) const +inline std::size_t PropertySetInfoHash::operator()( + const com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo >& r ) const { - const sal_Int32* pBytesAsInt32Array = - (const sal_Int32*)r.aImplementationId.getConstArray(); - sal_Int32 nId32 = pBytesAsInt32Array[0] ^ - pBytesAsInt32Array[1] ^ - pBytesAsInt32Array[2] ^ - pBytesAsInt32Array[3]; - return (size_t)nId32 ^ (size_t)r.xPropInfo.get(); + OSL_ASSERT(r.is()); + return static_cast< std::size_t >( + reinterpret_cast< sal_uIntPtr >( + com::sun::star::uno::Reference< com::sun::star::uno::XInterface >( + r, com::sun::star::uno::UNO_QUERY) + .get())); + // should be UNO_QUERY_THROW, but some clients are compiled with + // EXCEPTIONS_OFF } inline bool PropertySetInfoHash::operator()( - const PropertySetInfoKey& r1, - const PropertySetInfoKey& r2 ) const + const com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo >& r1, + const com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo >& r2 ) const { - if( r1.xPropInfo != r2.xPropInfo ) - return sal_False; - - const sal_Int8* pId1 = r1.aImplementationId.getConstArray(); - const sal_Int8* pId2 = r2.aImplementationId.getConstArray(); - return memcmp( pId1, pId2, 16 * sizeof( sal_Int8 ) ) == 0; + return r1 == r2; } #endif diff --git a/xmloff/inc/xmloff/SinglePropertySetInfoCache.hxx b/xmloff/inc/xmloff/SinglePropertySetInfoCache.hxx index 4458417a125b..a0d4e9ac162d 100644 --- a/xmloff/inc/xmloff/SinglePropertySetInfoCache.hxx +++ b/xmloff/inc/xmloff/SinglePropertySetInfoCache.hxx @@ -36,7 +36,8 @@ typedef boost::unordered_map < - PropertySetInfoKey, + ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySetInfo >, sal_Bool, PropertySetInfoHash, PropertySetInfoHash diff --git a/xmloff/inc/xmloff/txtparae.hxx b/xmloff/inc/xmloff/txtparae.hxx index 53e11180fd06..17b0b3d65dae 100644 --- a/xmloff/inc/xmloff/txtparae.hxx +++ b/xmloff/inc/xmloff/txtparae.hxx @@ -29,6 +29,9 @@ #define _XMLOFF_TEXTPARAE_HXX_ #include "sal/config.h" + +#include <memory> + #include "xmloff/dllapi.h" #include <rtl/ustring.hxx> #include <com/sun/star/uno/Reference.h> |