summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2021-07-16 01:03:06 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2021-07-16 03:46:26 +0200
commit01c0cf63be7155531e1240d79e3936f8c4600864 (patch)
tree774a3476e298a2aac68cea7359f87efc33e635da /svl
parentda13b76e07231131cb951868a314ee6f51c0f254 (diff)
Move validity check to svl::Items, to avoid invalid WhichRangesContainer
This uncovered lots of pre-existing invalid ranges, e.g. introduced in commit 6dbfbebad37fd84208e4c336f0864d26019db153, or in much older commit 46952138c938730afcc3607e1a524bb590b0e30e. Also this makes the static in svl::Items to be array of WhichPair, to avoid questionable reinterpret_cast in WhichRangesContainer ctor. Change-Id: I86030b2a2ac0a6d98870f8f7f5cc83e071c6597c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119003 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'svl')
-rw-r--r--svl/source/items/itemset.cxx1
1 files changed, 1 insertions, 0 deletions
diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx
index b2fb14f5c73f..59c640bb6c5d 100644
--- a/svl/source/items/itemset.cxx
+++ b/svl/source/items/itemset.cxx
@@ -153,6 +153,7 @@ SfxItemSet::SfxItemSet( SfxItemPool& rPool, const sal_uInt16* pWhichPairTable )
const auto& [nCnt, nCap] = svl::detail::CountRangesOld(pWhichPairTable);
m_pItems.reset(new const SfxPoolItem* [nCap] {});
m_pWhichRanges = WhichRangesContainer(reinterpret_cast<const WhichPair*>(pWhichPairTable), (nCnt-1)/2);
+ assert(svl::detail::validRanges2(m_pWhichRanges));
}
SfxItemSet::SfxItemSet( const SfxItemSet& rASet )