summaryrefslogtreecommitdiff
path: root/xmloff/source/style/xmlexppr.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'xmloff/source/style/xmlexppr.cxx')
-rw-r--r--xmloff/source/style/xmlexppr.cxx58
1 files changed, 18 insertions, 40 deletions
diff --git a/xmloff/source/style/xmlexppr.cxx b/xmloff/source/style/xmlexppr.cxx
index 48f383a9a376..2b83ec2c6b48 100644
--- a/xmloff/source/style/xmlexppr.cxx
+++ b/xmloff/source/style/xmlexppr.cxx
@@ -32,7 +32,6 @@
#include <com/sun/star/xml/AttributeData.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/XPropertyState.hpp>
-#include <com/sun/star/lang/XTypeProvider.hpp>
#include <com/sun/star/beans/XMultiPropertySet.hpp>
#include <com/sun/star/beans/XTolerantMultiPropertySet.hpp>
#include <com/sun/star/beans/TolerantPropertySetResultType.hpp>
@@ -236,7 +235,7 @@ public:
typedef boost::unordered_map
<
- PropertySetInfoKey,
+ Reference< XPropertySetInfo >,
FilterPropertiesInfo_Impl *,
PropertySetInfoHash,
PropertySetInfoHash
@@ -636,24 +635,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;
@@ -680,31 +667,22 @@ vector< XMLPropertyState > SvXMLExportPropertyMapper::_Filter(
}
}
- 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() )