sw/source/core/doc/number.cxx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
New commits: commit a972ed87e3bcb7cdee67f25f6ce0bdbb689c4f59 Author: Noel Grandin <[email protected]> AuthorDate: Tue Jun 15 15:27:40 2021 +0200 Commit: Xisco Fauli <[email protected]> CommitDate: Thu Jun 17 10:29:27 2021 +0200 tdf#135316 docx open performance avoid unnecessary SwNumFormat creation Change-Id: I62a16fdeb1225606a54f384e5196e5137e8d2139 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117271 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> (cherry picked from commit e52bbca626e2cbe2f4d13632f65967604abb0abc) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117297 Reviewed-by: Xisco Fauli <[email protected]> diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx index eb84b1b63a68..00eeed63ec70 100644 --- a/sw/source/core/doc/number.cxx +++ b/sw/source/core/doc/number.cxx @@ -916,10 +916,15 @@ SvxNumRule SwNumRule::MakeSvxNumRule() const meRuleType == NUM_RULE ? SvxNumRuleType::NUMBERING : SvxNumRuleType::OUTLINE_NUMBERING ); for( sal_uInt16 n = 0; n < MAXLEVEL; ++n ) { - SwNumFormat aNumFormat = Get(n); - if(aNumFormat.GetCharFormat()) - aNumFormat.SetCharFormatName(aNumFormat.GetCharFormat()->GetName()); - aRule.SetLevel(n, aNumFormat, maFormats[n] != nullptr); + const SwNumFormat & rNumFormat = Get(n); + if(rNumFormat.GetCharFormat()) + { + SwNumFormat aNewFormat = rNumFormat; + aNewFormat.SetCharFormatName(rNumFormat.GetCharFormat()->GetName()); + aRule.SetLevel(n, aNewFormat, maFormats[n] != nullptr); + } + else + aRule.SetLevel(n, rNumFormat, maFormats[n] != nullptr); } return aRule; } _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
