summaryrefslogtreecommitdiff
path: root/include/sfx2/tabdlg.hxx
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 /include/sfx2/tabdlg.hxx
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 'include/sfx2/tabdlg.hxx')
-rw-r--r--include/sfx2/tabdlg.hxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/sfx2/tabdlg.hxx b/include/sfx2/tabdlg.hxx
index 7d338e40c342..22130c2a22fb 100644
--- a/include/sfx2/tabdlg.hxx
+++ b/include/sfx2/tabdlg.hxx
@@ -36,7 +36,7 @@
class SfxTabPage;
typedef std::unique_ptr<SfxTabPage> (*CreateTabPage)(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet *rAttrSet);
-typedef const sal_uInt16* (*GetTabPageRanges)(); // provides international Which-value
+typedef WhichRangesContainer (*GetTabPageRanges)(); // provides international Which-value
struct TabPageImpl;
struct TabDlg_Impl;
@@ -76,7 +76,7 @@ private:
std::unique_ptr<SfxItemSet> m_pSet;
std::unique_ptr<SfxItemSet> m_pOutSet;
std::unique_ptr<TabDlg_Impl> m_pImpl;
- std::unique_ptr<sal_uInt16[]> m_pRanges;
+ WhichRangesContainer m_pRanges;
OString m_sAppPageId;
bool m_bStandardPushed;
std::unique_ptr<SfxAllItemSet> m_xItemSet;
@@ -134,7 +134,7 @@ public:
SfxTabPage* GetCurTabPage() const { return GetTabPage(GetCurPageId()); }
// may provide local slots converted by Map
- const sal_uInt16* GetInputRanges( const SfxItemPool& );
+ const WhichRangesContainer& GetInputRanges( const SfxItemPool& );
void SetInputSet( const SfxItemSet* pInSet );
const SfxItemSet* GetOutputItemSet() const { return m_pOutSet.get(); }