[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - sw/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Thu Jun 17 08:30:26 UTC 2021
sw/source/core/doc/number.cxx | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
New commits:
commit a972ed87e3bcb7cdee67f25f6ce0bdbb689c4f59
Author: Noel Grandin <noel at peralex.com>
AuthorDate: Tue Jun 15 15:27:40 2021 +0200
Commit: Xisco Fauli <xiscofauli at libreoffice.org>
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 <noel.grandin at collabora.co.uk>
(cherry picked from commit e52bbca626e2cbe2f4d13632f65967604abb0abc)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117297
Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
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;
}
More information about the Libreoffice-commits
mailing list