summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-06-29 11:29:18 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-06-30 14:34:11 +0200
commit05992ce5d03aeb2db8d4fc7a68053ebd9a9aa511 (patch)
treee2af3748fa2bb1394b0cf6ab59b79e76296ca8f5 /sw/source
parent5ba64bba76ca1d23191300d1b5080cc091d432de (diff)
tdf#135316 cache propertysetinfo in SwXShape
shaves 3% off loaad time Change-Id: I6541f94553d862787566672d91e2a87902835664 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118158 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/unocore/unodraw.cxx29
1 files changed, 16 insertions, 13 deletions
diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx
index cd8e799fee00..6faa27465851 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -1016,23 +1016,26 @@ uno::Sequence< sal_Int8 > SwXShape::getImplementationId( )
uno::Reference< beans::XPropertySetInfo > SwXShape::getPropertySetInfo()
{
SolarMutexGuard aGuard;
- uno::Reference< beans::XPropertySetInfo > aRet;
- if(m_xShapeAgg.is())
+ if (!mxPropertySetInfo)
{
- const uno::Type& rPropSetType = cppu::UnoType<beans::XPropertySet>::get();
- uno::Any aPSet = m_xShapeAgg->queryAggregation( rPropSetType );
- if(auto xPrSet = o3tl::tryAccess<uno::Reference<beans::XPropertySet>>(
- aPSet))
+ uno::Reference< beans::XPropertySetInfo > aRet;
+ if(m_xShapeAgg.is())
{
- uno::Reference< beans::XPropertySetInfo > xInfo = (*xPrSet)->getPropertySetInfo();
- // Expand PropertySetInfo!
- const uno::Sequence<beans::Property> aPropSeq = xInfo->getProperties();
- aRet = new SfxExtItemPropertySetInfo( m_pPropertyMapEntries, aPropSeq );
+ const uno::Type& rPropSetType = cppu::UnoType<beans::XPropertySet>::get();
+ uno::Any aPSet = m_xShapeAgg->queryAggregation( rPropSetType );
+ if(auto xPrSet = o3tl::tryAccess<uno::Reference<beans::XPropertySet>>(
+ aPSet))
+ {
+ uno::Reference< beans::XPropertySetInfo > xInfo = (*xPrSet)->getPropertySetInfo();
+ // Expand PropertySetInfo!
+ const uno::Sequence<beans::Property> aPropSeq = xInfo->getProperties();
+ mxPropertySetInfo = new SfxExtItemPropertySetInfo( m_pPropertyMapEntries, aPropSeq );
+ }
}
+ if(!mxPropertySetInfo)
+ mxPropertySetInfo = m_pPropSet->getPropertySetInfo();
}
- if(!aRet.is())
- aRet = m_pPropSet->getPropertySetInfo();
- return aRet;
+ return mxPropertySetInfo;
}
void SwXShape::setPropertyValue(const OUString& rPropertyName, const uno::Any& aValue)