sd/source/core/stlsheet.cxx |   15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

New commits:
commit e8b5126a560b0d5ee02005034e56886e569742ae
Author:     Caolán McNamara <[email protected]>
AuthorDate: Mon Oct 14 12:23:37 2024 +0100
Commit:     Xisco Fauli <[email protected]>
CommitDate: Mon Oct 21 13:25:08 2024 +0200

    we don't need to copy the Name here, a reference is sufficient
    
    48s -> 47.8s
    
    Change-Id: Ib95b701d424b0b92aa3848b75f81c41eff0af2ea
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175031
    Reviewed-by: Xisco Fauli <[email protected]>
    Tested-by: Jenkins

diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx
index a8f992ef8641..d465ad20f06e 100644
--- a/sd/source/core/stlsheet.cxx
+++ b/sd/source/core/stlsheet.cxx
@@ -953,7 +953,7 @@ void SAL_CALL SdStyleSheet::setParentStyle( const OUString& 
rParentName  )
 
     if( !rParentName.isEmpty() )
     {
-        OUString const name(GetName());
+        OUString const& name(GetName());
         sal_Int32 const sep(name.indexOf(SD_LT_SEPARATOR));
         OUString const master((sep == -1) ? OUString() : name.copy(0, sep));
         std::shared_ptr<SfxStyleSheetIterator> aSSSI = 
std::make_shared<SfxStyleSheetIterator>(mxPool.get(), nFamily);
@@ -967,7 +967,7 @@ void SAL_CALL SdStyleSheet::setParentStyle( const OUString& 
rParentName  )
             if (pSdStyleSheet->msApiName != rParentName)
                 continue;
 
-            OUString const curName(pStyle->GetName());
+            OUString const& curName(pStyle->GetName());
             sal_Int32 const curSep(curName.indexOf(SD_LT_SEPARATOR));
             OUString const curMaster((curSep == -1)
                     ? OUString() : curName.copy(0, curSep));
commit 98ffc9e2e1535156a5a8c449a85853dde70977e0
Author:     Caolán McNamara <[email protected]>
AuthorDate: Mon Oct 14 12:17:44 2024 +0100
Commit:     Xisco Fauli <[email protected]>
CommitDate: Mon Oct 21 13:24:59 2024 +0200

    shave some time off SdStyleSheet::setParentStyle
    
    much of the time the construction of curMaster isn't needed
    
    a similar mega-master-page scenario as reported in tdf#158773
    
    50s -> 48s
    
    Change-Id: Iedb1d0cf189eec7a9abca1836295d7afacdc301c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174896
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <[email protected]>
    (cherry picked from commit 0ab83b467e39d03953178f83f03b2fe4c4c9b6e5)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175030
    Reviewed-by: Xisco Fauli <[email protected]>

diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx
index 885ea80c5dce..a8f992ef8641 100644
--- a/sd/source/core/stlsheet.cxx
+++ b/sd/source/core/stlsheet.cxx
@@ -961,13 +961,18 @@ void SAL_CALL SdStyleSheet::setParentStyle( const 
OUString& rParentName  )
         {
             // we hope that we have only sd style sheets
             SdStyleSheet* pSdStyleSheet = static_cast<SdStyleSheet*>(pStyle);
+
+            // check that the master msApiName matches, as msApiName exists 
once per
+            // master page
+            if (pSdStyleSheet->msApiName != rParentName)
+                continue;
+
             OUString const curName(pStyle->GetName());
             sal_Int32 const curSep(curName.indexOf(SD_LT_SEPARATOR));
             OUString const curMaster((curSep == -1)
                     ? OUString() : curName.copy(0, curSep));
-            // check that the master matches, as msApiName exists once per
-            // master page
-            if (pSdStyleSheet->msApiName == rParentName && master == curMaster)
+            // check that the master matches
+            if (master == curMaster)
             {
                 if( pStyle != this )
                 {

Reply via email to