sd/source/core/stlsheet.cxx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
New commits: commit 0ab83b467e39d03953178f83f03b2fe4c4c9b6e5 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Mon Oct 14 12:17:44 2024 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Mon Oct 14 16:07:48 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 <caolan.mcnam...@collabora.com> diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx index 1293e4740b9f..bf1598098a12 100644 --- a/sd/source/core/stlsheet.cxx +++ b/sd/source/core/stlsheet.cxx @@ -943,13 +943,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 ) {