diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-17 14:52:10 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-18 08:38:20 +0200 |
commit | 99e626dee48e08d59304c8abe8abe84e7a99af3a (patch) | |
tree | 6b77c41926547a7c57bdb61ab380db6b2acbab0f | |
parent | 346b900594a84581056ba56061ea513f4e6f101d (diff) |
tdf#79878 perf loading docx file, use XMultiPropertySet
because the property setting code in sw/ is surprisingly expensive
Change-Id: Id9caa735f77539484993a8f16082cff588a9763a
Reviewed-on: https://gerrit.libreoffice.org/57569
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | writerfilter/source/dmapper/PropertyMap.cxx | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx index 5cf50c69d0d6..a24ae3d41270 100644 --- a/writerfilter/source/dmapper/PropertyMap.cxx +++ b/writerfilter/source/dmapper/PropertyMap.cxx @@ -663,8 +663,10 @@ void SectionPropertyMap::SetBorderDistance( const uno::Reference< beans::XProper nLineWidth); // Change the margins with the border distance - xStyle->setPropertyValue( sMarginName, uno::makeAny( nMargin ) ); - xStyle->setPropertyValue( sBorderDistanceName, uno::makeAny( nDistance ) ); + uno::Reference< beans::XMultiPropertySet > xMultiSet( xStyle, uno::UNO_QUERY_THROW ); + uno::Sequence<OUString> aProperties { sMarginName, sBorderDistanceName }; + uno::Sequence<uno::Any> aValues { uno::makeAny( nMargin ), uno::makeAny( nDistance ) }; + xMultiSet->setPropertyValues( aProperties, aValues ); } void SectionPropertyMap::DontBalanceTextColumns() @@ -823,8 +825,10 @@ void SectionPropertyMap::CopyHeaderFooter( const uno::Reference< beans::XPropert if ( bHasPrevHeader ) { - xStyle->setPropertyValue( sHeaderIsOn, uno::makeAny( true ) ); - xStyle->setPropertyValue( sHeaderIsShared, uno::makeAny( bHeaderIsShared ) ); + uno::Reference< beans::XMultiPropertySet > xMultiSet( xStyle, uno::UNO_QUERY_THROW ); + uno::Sequence<OUString> aProperties { sHeaderIsOn, sHeaderIsShared }; + uno::Sequence<uno::Any> aValues { uno::makeAny( true ), uno::makeAny( bHeaderIsShared ) }; + xMultiSet->setPropertyValues( aProperties, aValues ); if ( !bOmitRightHeader ) { CopyHeaderFooterTextProperty( xPrevStyle, xStyle, @@ -849,8 +853,10 @@ void SectionPropertyMap::CopyHeaderFooter( const uno::Reference< beans::XPropert if ( bHasPrevFooter ) { - xStyle->setPropertyValue( sFooterIsOn, uno::makeAny( true ) ); - xStyle->setPropertyValue( sFooterIsShared, uno::makeAny( bFooterIsShared ) ); + uno::Reference< beans::XMultiPropertySet > xMultiSet( xStyle, uno::UNO_QUERY_THROW ); + uno::Sequence<OUString> aProperties { sFooterIsOn, sFooterIsShared }; + uno::Sequence<uno::Any> aValues { uno::makeAny( true ), uno::makeAny( bFooterIsShared ) }; + xMultiSet->setPropertyValues( aProperties, aValues ); if ( !bOmitRightFooter ) { CopyHeaderFooterTextProperty( xPrevStyle, xStyle, |