sw/inc/unodraw.hxx                               |    1 
 sw/source/core/unocore/unodraw.cxx               |   29 ++++++++++++-----------
 writerfilter/source/dmapper/NumberingManager.cxx |    2 -
 3 files changed, 18 insertions(+), 14 deletions(-)

New commits:
commit 2577db3d6b1e59e14441704dc408200d7ce3e256
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Tue Jun 29 11:28:53 2021 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Wed Jun 30 20:57:07 2021 +0200

    tdf#135316 make regex object static const
    
    so we only compile it once, shaves 1% off load time
    
    Change-Id: I8e6e20205659582901ffb8d4496ce44906146204
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118157
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>
    (cherry picked from commit 5ba64bba76ca1d23191300d1b5080cc091d432de)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118174

diff --git a/writerfilter/source/dmapper/NumberingManager.cxx 
b/writerfilter/source/dmapper/NumberingManager.cxx
index 62706d1a5614..764aace41808 100644
--- a/writerfilter/source/dmapper/NumberingManager.cxx
+++ b/writerfilter/source/dmapper/NumberingManager.cxx
@@ -687,7 +687,7 @@ void ListsManager::lcl_attribute( Id nName, Value& rVal )
 
                 // DOCX level-text contains levels definition in format 
"%1.%2.%3"
                 // we need to convert it to LO internal representation: 
"%1%.%2%.%3%"
-                std::regex aTokenRegex("(%\\d)");
+                static const std::regex aTokenRegex("(%\\d)");
                 sLevelText = std::regex_replace(sLevelText, aTokenRegex, 
"$1%");
                 pCurrentLvl->SetBulletChar( OUString::fromUtf8(sLevelText) );
             }
commit e2173d675b55b14081e9ae3d5b188cde65ad1fae
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Tue Jun 29 11:29:18 2021 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Wed Jun 30 20:56:56 2021 +0200

    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.gran...@collabora.co.uk>
    (cherry picked from commit 05992ce5d03aeb2db8d4fc7a68053ebd9a9aa511)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118175

diff --git a/sw/inc/unodraw.hxx b/sw/inc/unodraw.hxx
index e4e5f3a40272..f68e90fe4bbe 100644
--- a/sw/inc/unodraw.hxx
+++ b/sw/inc/unodraw.hxx
@@ -144,6 +144,7 @@ class SwXShape : public SwXShapeBaseClass, public 
SvtListener
 
     const SfxItemPropertySet*           m_pPropSet;
     const SfxItemPropertyMapEntry*      m_pPropertyMapEntries;
+    css::uno::Reference< css::beans::XPropertySetInfo > mxPropertySetInfo;
 
     std::unique_ptr<SwShapeDescriptor_Impl>  m_pImpl;
 
diff --git a/sw/source/core/unocore/unodraw.cxx 
b/sw/source/core/unocore/unodraw.cxx
index 3348abee8fe1..8c5bf6c890bd 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)
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to