summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-06-29 10:06:04 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-06-29 13:03:40 +0200
commitc71e26b4cf6181791acff4017f661edb3523c70e (patch)
tree1c3d783d6fd6ba10f0a91c792cf6fd13f22e746d /svl
parent001d9a20ae3607e618a8fb0889ab2f2bcb612f4f (diff)
elide unnecessary copy in SfxItemSet constructor
Change-Id: I6881f5dcea753a6d2cfbf203b50043219191fae4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136601 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svl')
-rw-r--r--svl/source/items/itemset.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx
index 50af12fee107..93721dd756f2 100644
--- a/svl/source/items/itemset.cxx
+++ b/svl/source/items/itemset.cxx
@@ -97,8 +97,14 @@ SfxItemSet::SfxItemSet(SfxItemPool& pool, const WhichRangesContainer& wids)
}
SfxItemSet::SfxItemSet(SfxItemPool& pool, WhichRangesContainer&& wids)
- : SfxItemSet(pool, wids, svl::detail::CountRanges(wids))
+ : m_pPool(&pool), m_pParent(nullptr),
+ m_ppItems(new SfxPoolItem const *[svl::detail::CountRanges(wids)]{}),
+ m_pWhichRanges(std::move(wids)),
+ m_nCount(0),
+ m_bItemsFixed(false)
{
+ assert(svl::detail::CountRanges(m_pWhichRanges) != 0);
+ assert(svl::detail::validRanges2(m_pWhichRanges));
}
SfxItemSet::SfxItemSet( const SfxItemSet& rASet )