diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-07-10 10:19:28 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-07-15 14:41:13 +0200 |
commit | 5d0a231b29dfd4d587c7a4d1bbda6a511f94ec77 (patch) | |
tree | ebc1d470fd891fe0f9e68a002055c4d3a8dd4884 /cui/source/factory/dlgfact.hxx | |
parent | df9ca514d4e9ea87bbf0a96d99181ed8965cd45a (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/factory/dlgfact.hxx')
-rw-r--r-- | cui/source/factory/dlgfact.hxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx index 39e540c46352..c0b1f7714418 100644 --- a/cui/source/factory/dlgfact.hxx +++ b/cui/source/factory/dlgfact.hxx @@ -162,7 +162,7 @@ public: virtual bool StartExecuteAsync(AsyncContext &rCtx) override; virtual void SetCurPageId( const OString &rName ) override; virtual const SfxItemSet* GetOutputItemSet() const override; - virtual const sal_uInt16* GetInputRanges( const SfxItemPool& pItem ) override; + virtual WhichRangesContainer GetInputRanges( const SfxItemPool& pItem ) override; virtual void SetInputSet( const SfxItemSet* pInSet ) override; virtual void SetText( const OUString& rStr ) override; @@ -383,7 +383,7 @@ public: virtual void SetValidateFramePosLink( const Link<SvxSwFrameValidation&,void>& rLink ) override; virtual void SetCurPageId( const OString& rName ) override; virtual const SfxItemSet* GetOutputItemSet() const override; - virtual const sal_uInt16* GetInputRanges( const SfxItemPool& pItem ) override; + virtual WhichRangesContainer GetInputRanges( const SfxItemPool& pItem ) override; virtual void SetInputSet( const SfxItemSet* pInSet ) override; virtual void SetText( const OUString& rStr ) override; }; @@ -401,7 +401,7 @@ public: virtual void SetValidateFramePosLink( const Link<SvxSwFrameValidation&,void>& rLink ) override; virtual void SetCurPageId( const OString& rName ) override; virtual const SfxItemSet* GetOutputItemSet() const override; - virtual const sal_uInt16* GetInputRanges( const SfxItemPool& pItem ) override; + virtual WhichRangesContainer GetInputRanges( const SfxItemPool& pItem ) override; virtual void SetInputSet( const SfxItemSet* pInSet ) override; virtual void SetText( const OUString& rStr ) override; }; @@ -576,7 +576,7 @@ public: virtual bool StartExecuteAsync(AsyncContext &rCtx) override; virtual void SetCurPageId(const OString& rName) override; virtual const SfxItemSet* GetOutputItemSet() const override; - virtual const sal_uInt16* GetInputRanges(const SfxItemPool& pItem) override; + virtual WhichRangesContainer GetInputRanges( const SfxItemPool& pItem ) override; virtual void SetInputSet(const SfxItemSet* pInSet) override; virtual void SetText(const OUString& rStr) override; }; @@ -851,7 +851,7 @@ public: virtual VclPtr<VclAbstractDialog> CreateSvxSearchAttributeDialog(weld::Window* pParent, SearchAttrItemList& rLst, - const sal_uInt16* pWhRanges) override; + const WhichRangesContainer& pWhRanges) override; virtual VclPtr<AbstractSvxSearchSimilarityDialog> CreateSvxSearchSimilarityDialog( weld::Window* pParent, bool bRelax, sal_uInt16 nOther, |