writerfilter/source/dmapper/PropertyMap.cxx |   18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

New commits:
commit 99e626dee48e08d59304c8abe8abe84e7a99af3a
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Tue Jul 17 14:52:10 2018 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Wed Jul 18 08:38:20 2018 +0200

    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.gran...@collabora.co.uk>

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,
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to