aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2021-06-15 15:27:40 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-06-16 15:15:32 +0200
commite52bbca626e2cbe2f4d13632f65967604abb0abc (patch)
treeaa69e52c647dc31e44873491f3c16395983ade2a
parent736a2db98bbf7222bfec3dcff89999ccb71b576e (diff)
tdf#135316 docx open performance HEADmaster
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@collabora.co.uk>
-rw-r--r--sw/source/core/doc/number.cxx13
1 files changed, 9 insertions, 4 deletions
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;
}