summaryrefslogtreecommitdiff
path: root/cui/source/tabpages/align.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-07-10 10:19:28 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-07-15 14:41:13 +0200
commit5d0a231b29dfd4d587c7a4d1bbda6a511f94ec77 (patch)
treeebc1d470fd891fe0f9e68a002055c4d3a8dd4884 /cui/source/tabpages/align.cxx
parentdf9ca514d4e9ea87bbf0a96d99181ed8965cd45a (diff)
WhichRangesContainer, reduce malloc in SfxItemSet
SfxItemSet shows up in perf profiles frequently, and the hottest part is the malloc of the two arrays we need. But most of the time, one of those arrays is a compile-time constant. So this change introduces (*) WhichRangesContainer, which manages whether the SfxItemSet owns the array it points at or not. (*) a static const member in svl::Items (idea from mkaganski) to store the data. Change-Id: Icb8cdbc4d54fd76739565c575e16a744515e5355 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118703 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cui/source/tabpages/align.cxx')
-rw-r--r--cui/source/tabpages/align.cxx24
1 files changed, 11 insertions, 13 deletions
diff --git a/cui/source/tabpages/align.cxx b/cui/source/tabpages/align.cxx
index 5937a2b28995..b178630ab61e 100644
--- a/cui/source/tabpages/align.cxx
+++ b/cui/source/tabpages/align.cxx
@@ -39,19 +39,17 @@
namespace svx {
-const sal_uInt16 AlignmentTabPage::s_pRanges[] =
-{
- SID_ATTR_ALIGN_HOR_JUSTIFY,SID_ATTR_ALIGN_VER_JUSTIFY,
- SID_ATTR_ALIGN_STACKED,SID_ATTR_ALIGN_LINEBREAK,
- SID_ATTR_ALIGN_INDENT,SID_ATTR_ALIGN_INDENT,
- SID_ATTR_ALIGN_DEGREES,SID_ATTR_ALIGN_DEGREES,
- SID_ATTR_ALIGN_LOCKPOS,SID_ATTR_ALIGN_LOCKPOS,
- SID_ATTR_ALIGN_HYPHENATION,SID_ATTR_ALIGN_HYPHENATION,
- SID_ATTR_ALIGN_ASIANVERTICAL,SID_ATTR_ALIGN_ASIANVERTICAL,
- SID_ATTR_FRAMEDIRECTION,SID_ATTR_FRAMEDIRECTION,
- SID_ATTR_ALIGN_SHRINKTOFIT,SID_ATTR_ALIGN_SHRINKTOFIT,
- 0
-};
+const WhichRangesContainer AlignmentTabPage::s_pRanges(
+ svl::Items<
+ SID_ATTR_ALIGN_HOR_JUSTIFY, SID_ATTR_ALIGN_VER_JUSTIFY,
+ SID_ATTR_ALIGN_STACKED, SID_ATTR_ALIGN_LINEBREAK,
+ SID_ATTR_ALIGN_INDENT, SID_ATTR_ALIGN_INDENT,
+ SID_ATTR_ALIGN_DEGREES, SID_ATTR_ALIGN_DEGREES,
+ SID_ATTR_ALIGN_LOCKPOS, SID_ATTR_ALIGN_LOCKPOS,
+ SID_ATTR_ALIGN_HYPHENATION, SID_ATTR_ALIGN_HYPHENATION,
+ SID_ATTR_ALIGN_ASIANVERTICAL, SID_ATTR_ALIGN_ASIANVERTICAL,
+ SID_ATTR_FRAMEDIRECTION, SID_ATTR_FRAMEDIRECTION,
+ SID_ATTR_ALIGN_SHRINKTOFIT, SID_ATTR_ALIGN_SHRINKTOFIT>::value);
namespace {