[Libreoffice-commits] .: 2 commits - binfilter/bf_basic binfilter/bf_sc binfilter/bf_xmloff binfilter/inc
Stephan Bergmann
sbergmann at kemper.freedesktop.org
Mon Sep 12 13:48:25 PDT 2011
binfilter/bf_basic/source/classes/sbunoobj.cxx | 29 -----
binfilter/bf_sc/source/core/tool/sc_addincol.cxx | 3
binfilter/bf_xmloff/source/style/xmloff_SinglePropertySetInfoCache.cxx | 54 ++-------
binfilter/bf_xmloff/source/style/xmloff_xmlexppr.cxx | 57 +++-------
binfilter/inc/bf_xmloff/PropertySetInfoHash.hxx | 45 ++++---
binfilter/inc/bf_xmloff/SinglePropertySetInfoCache.hxx | 3
6 files changed, 57 insertions(+), 134 deletions(-)
New commits:
commit 3c0d149746da1756634ce833f49b86a5a208365b
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Mon Sep 12 15:47:51 2011 +0200
sb140: #i117698# no implementations of XIdlClassProvider remain, so code that checks for it can be removed
diff --git a/binfilter/bf_basic/source/classes/sbunoobj.cxx b/binfilter/bf_basic/source/classes/sbunoobj.cxx
index 745222f..858569d 100644
--- a/binfilter/bf_basic/source/classes/sbunoobj.cxx
+++ b/binfilter/bf_basic/source/classes/sbunoobj.cxx
@@ -60,7 +60,6 @@
#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
#include <com/sun/star/reflection/XIdlArray.hpp>
#include <com/sun/star/reflection/XIdlReflection.hpp>
-#include <com/sun/star/reflection/XIdlClassProvider.hpp>
#include <com/sun/star/reflection/XTypeDescription.hpp>
#include <com/sun/star/bridge/oleautomation/NamedArgument.hpp>
#include <com/sun/star/bridge/oleautomation/Date.hpp>
@@ -1238,8 +1237,6 @@ String Impl_GetSupportedInterfaces( SbUnoObject* pUnoObj )
// Interface aus dem Any besorgen
const Reference< XInterface > x = *(Reference< XInterface >*)aToInspectObj.getValue();
- // XIdlClassProvider-Interface ansprechen
- Reference< XIdlClassProvider > xClassProvider( x, UNO_QUERY );
Reference< XTypeProvider > xTypeProvider( x, UNO_QUERY );
aRet.AssignAscii( "Supported interfaces by object " );
@@ -1273,11 +1270,6 @@ String Impl_GetSupportedInterfaces( SbUnoObject* pUnoObj )
}
}
}
- else if( xClassProvider.is() )
- {
-
- OSL_FAIL( "XClassProvider not supported in UNO3" );
- }
}
return aRet;
}
@@ -1950,27 +1942,6 @@ SbUnoObject::SbUnoObject( const String& aName_, const Any& aUnoObj_ )
{
// #70197 Interface geht immer durch Typ im Any
bFatalError = FALSE;
-
- // Nach XIdlClassProvider-Interface fragen
- Reference< XIdlClassProvider > xClassProvider( x, UNO_QUERY );
- if( xClassProvider.is() )
- {
- // #67173 Echten Klassen-Namen eintragen
- if( aName_.Len() == 0 )
- {
- Sequence< Reference< XIdlClass > > szClasses = xClassProvider->getIdlClasses();
- UINT32 nLen = szClasses.getLength();
- if( nLen )
- {
- const Reference< XIdlClass > xImplClass = szClasses.getConstArray()[ 0 ];
- if( xImplClass.is() )
- {
- aClassName_ = String( xImplClass->getName() );
- bSetClassName = TRUE;
- }
- }
- }
- }
}
if( bSetClassName )
SetClassName( aClassName_ );
diff --git a/binfilter/bf_sc/source/core/tool/sc_addincol.cxx b/binfilter/bf_sc/source/core/tool/sc_addincol.cxx
index 60568e9..970e5c2 100644
--- a/binfilter/bf_sc/source/core/tool/sc_addincol.cxx
+++ b/binfilter/bf_sc/source/core/tool/sc_addincol.cxx
@@ -37,7 +37,6 @@
#include <com/sun/star/lang/XServiceName.hpp>
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <com/sun/star/reflection/XIdlClass.hpp>
-#include <com/sun/star/reflection/XIdlClassProvider.hpp>
#include <com/sun/star/beans/XIntrospectionAccess.hpp>
#include <com/sun/star/beans/XIntrospection.hpp>
#include <com/sun/star/beans/MethodConcept.hpp>
@@ -463,8 +462,6 @@ public:
/*N*/ IsTypeName( sName,
/*N*/ getCppuType((uno::Reference<uno::XInterface>*)0) ) ||
/*N*/ IsTypeName( sName,
-/*N*/ getCppuType((uno::Reference<reflection::XIdlClassProvider>*)0) ) ||
-/*N*/ IsTypeName( sName,
/*N*/ getCppuType((uno::Reference<lang::XServiceName>*)0) ) ||
/*N*/ IsTypeName( sName,
/*N*/ getCppuType((uno::Reference<lang::XServiceInfo>*)0) ) ||
commit 95cc316cb6e0c6bee57b78eba15c9e7b26ffe595
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Mon Sep 12 11:27:38 2011 +0200
sb140: #i117310# remove unnecessary dependency on XTypeProvider::getImplementationId
plus
sb140: #i117310# binfilter uses EXCEPTIONS_OFF, so no UNO_QUERY_THROW
diff --git a/binfilter/bf_xmloff/source/style/xmloff_SinglePropertySetInfoCache.cxx b/binfilter/bf_xmloff/source/style/xmloff_SinglePropertySetInfoCache.cxx
index af57fac..9206f6a 100644
--- a/binfilter/bf_xmloff/source/style/xmloff_SinglePropertySetInfoCache.cxx
+++ b/binfilter/bf_xmloff/source/style/xmloff_SinglePropertySetInfoCache.cxx
@@ -26,14 +26,12 @@
*
************************************************************************/
-#include <com/sun/star/lang/XTypeProvider.hpp>
#include <cppuhelper/weakref.hxx>
#include "SinglePropertySetInfoCache.hxx"
namespace binfilter {
using namespace ::com::sun::star::uno;
-using ::com::sun::star::lang::XTypeProvider;
using ::com::sun::star::beans::XPropertySet;
using ::com::sun::star::beans::XPropertySetInfo;
@@ -41,48 +39,24 @@ sal_Bool SinglePropertySetInfoCache::hasProperty(
const Reference< XPropertySet >& rPropSet,
Reference< XPropertySetInfo >& rPropSetInfo )
{
- if( !rPropSetInfo.is() )
- rPropSetInfo = rPropSet->getPropertySetInfo();
- sal_Bool bRet = sal_False, bValid = sal_False;
- Reference < XTypeProvider > xTypeProv( rPropSet, UNO_QUERY );
- Sequence< sal_Int8 > aImplId;
- if( xTypeProv.is() )
+ iterator aIter = find( rPropSetInfo );
+ if( aIter != end() )
{
- aImplId = xTypeProv->getImplementationId();
- if( aImplId.getLength() == 16 )
- {
- // The key must not be created outside this block, because it
- // keeps a reference to the property set info.
- PropertySetInfoKey aKey( rPropSetInfo, aImplId );
- iterator aIter = find( aKey );
- if( aIter != end() )
- {
- bRet = (*aIter).second;
- bValid = sal_True;
- }
- }
+ return aIter->second;
}
- if( !bValid )
+ bool bRet = rPropSetInfo->hasPropertyByName( sName );
+ // Check whether the property set info is destroyed if it is
+ // assigned to a weak reference only. If it is destroyed, then
+ // every instance of getPropertySetInfo returns a new object.
+ // Such property set infos must not be cached.
+ WeakReference < XPropertySetInfo > xWeakInfo( rPropSetInfo );
+ rPropSetInfo = 0;
+ rPropSetInfo = xWeakInfo;
+ if( rPropSetInfo.is() )
{
- bRet = rPropSetInfo->hasPropertyByName( sName );
- if( xTypeProv.is() && aImplId.getLength() == 16 )
- {
- // Check whether the property set info is destroyed if it is
- // assigned to a weak reference only. If it is destroyed, then
- // every instance of getPropertySetInfo returns a new object.
- // Such property set infos must not be cached.
- WeakReference < XPropertySetInfo > xWeakInfo( rPropSetInfo );
- rPropSetInfo = 0;
- rPropSetInfo = xWeakInfo;
- if( rPropSetInfo.is() )
- {
- PropertySetInfoKey aKey( rPropSetInfo, aImplId );
- value_type aValue( aKey, bRet );
- insert( aValue );
- }
- }
+ value_type aValue( rPropSetInfo, bRet );
+ insert( aValue );
}
-
return bRet;
}
}//end of namespace binfilter
diff --git a/binfilter/bf_xmloff/source/style/xmloff_xmlexppr.cxx b/binfilter/bf_xmloff/source/style/xmloff_xmlexppr.cxx
index 9d7de1b..7554326 100644
--- a/binfilter/bf_xmloff/source/style/xmloff_xmlexppr.cxx
+++ b/binfilter/bf_xmloff/source/style/xmloff_xmlexppr.cxx
@@ -211,7 +211,7 @@ public:
typedef ::boost::unordered_map
<
- PropertySetInfoKey,
+ Reference< XPropertySetInfo >,
FilterPropertiesInfo_Impl *,
PropertySetInfoHash,
PropertySetInfoHash
@@ -539,24 +539,12 @@ vector< XMLPropertyState > SvXMLExportPropertyMapper::_Filter(
FilterPropertiesInfo_Impl *pFilterInfo = 0;
- Reference < XTypeProvider > xTypeProv( xPropSet, UNO_QUERY );
- Sequence< sal_Int8 > aImplId;
- if( xTypeProv.is() )
+ if( pCache )
{
- aImplId = xTypeProv->getImplementationId();
- if( aImplId.getLength() == 16 )
- {
- if( pCache )
- {
- // The key must not be created outside this block, because it
- // keeps a reference to the property set info.
- PropertySetInfoKey aKey( xInfo, aImplId );
- FilterPropertiesInfos_Impl::iterator aIter =
- pCache->find( aKey );
- if( aIter != pCache->end() )
- pFilterInfo = (*aIter).second;
- }
- }
+ FilterPropertiesInfos_Impl::iterator aIter =
+ pCache->find( xInfo );
+ if( aIter != pCache->end() )
+ pFilterInfo = (*aIter).second;
}
sal_Bool bDelInfo = sal_False;
@@ -575,31 +563,22 @@ vector< XMLPropertyState > SvXMLExportPropertyMapper::_Filter(
pFilterInfo->AddProperty(rAPIName, i);
}
- if( xTypeProv.is() && aImplId.getLength() == 16 )
+ // Check whether the property set info is destroyed if it is
+ // assigned to a weak reference only. If it is destroyed, then
+ // every instance of getPropertySetInfo returns a new object.
+ // Such property set infos must not be cached.
+ WeakReference < XPropertySetInfo > xWeakInfo( xInfo );
+ xInfo = 0;
+ xInfo = xWeakInfo;
+ if( xInfo.is() )
{
- // Check whether the property set info is destroyed if it is
- // assigned to a weak reference only. If it is destroyed, then
- // every instance of getPropertySetInfo returns a new object.
- // Such property set infos must not be cached.
- WeakReference < XPropertySetInfo > xWeakInfo( xInfo );
- xInfo = 0;
- xInfo = xWeakInfo;
- if( xInfo.is() )
- {
- if( !pCache )
- ((SvXMLExportPropertyMapper *)this)->pCache =
- new FilterPropertiesInfos_Impl;
- PropertySetInfoKey aKey( xInfo, aImplId );
- (*pCache)[aKey] = pFilterInfo;
- }
- else
- bDelInfo = sal_True;
+ if( !pCache )
+ ((SvXMLExportPropertyMapper *)this)->pCache =
+ new FilterPropertiesInfos_Impl;
+ (*pCache)[xInfo] = pFilterInfo;
}
else
- {
- OSL_FAIL("here is no TypeProvider or the ImplId is wrong");
bDelInfo = sal_True;
- }
}
if( pFilterInfo->GetPropertyCount() )
diff --git a/binfilter/inc/bf_xmloff/PropertySetInfoHash.hxx b/binfilter/inc/bf_xmloff/PropertySetInfoHash.hxx
index ff02bde..b9cc2d7 100644
--- a/binfilter/inc/bf_xmloff/PropertySetInfoHash.hxx
+++ b/binfilter/inc/bf_xmloff/PropertySetInfoHash.hxx
@@ -28,40 +28,41 @@
#ifndef _XMLOFF_PROPERTYSETINFOHASH_HXX
#define _XMLOFF_PROPERTYSETINFOHASH_HXX
-#include <string.h>
+#include "sal/config.h"
+
+#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"
-#include <bf_xmloff/PropertySetInfoKey.hxx>
namespace binfilter {
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) // UNO_QUERY_THROW not available due to EXCEPTIONS_OFF
+ .get()));
}
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;
}
}//end of namespace binfilter
#endif
diff --git a/binfilter/inc/bf_xmloff/SinglePropertySetInfoCache.hxx b/binfilter/inc/bf_xmloff/SinglePropertySetInfoCache.hxx
index 08db9af..54bf60c 100644
--- a/binfilter/inc/bf_xmloff/SinglePropertySetInfoCache.hxx
+++ b/binfilter/inc/bf_xmloff/SinglePropertySetInfoCache.hxx
@@ -38,7 +38,8 @@ namespace binfilter {
typedef ::boost::unordered_map
<
- PropertySetInfoKey,
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySetInfo >,
sal_Bool,
PropertySetInfoHash,
PropertySetInfoHash
More information about the Libreoffice-commits
mailing list