summaryrefslogtreecommitdiff
path: root/svl/source/items/itempool.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-11-24 13:08:26 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-11-25 10:53:05 +0100
commitfc6aa9e49973c845915754caf765ff57e5b0cd59 (patch)
treea2f07a1496893405265e0b4ba0f81a54b6d54cdb /svl/source/items/itempool.cxx
parent090fafaaaa1d8ccf5f7b17b7b6f2a85b3fafa0c5 (diff)
fix assert
finger trouble in commit c757117afb398277a46e79ba22066c5bbf2c9f72 tdf#81765 slow loading of .ods with >1000 of conditional formats Spotted by sberg. Turns out my original idea idea with the assert was too restrictive, so make the check a little smarter. Change-Id: Ie735d00c87a05a70e8a71f03e75043dcd8dfc88f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143217 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svl/source/items/itempool.cxx')
-rw-r--r--svl/source/items/itempool.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/svl/source/items/itempool.cxx b/svl/source/items/itempool.cxx
index 601e90aee862..3cef59683ad7 100644
--- a/svl/source/items/itempool.cxx
+++ b/svl/source/items/itempool.cxx
@@ -722,7 +722,10 @@ const SfxPoolItem& SfxItemPool::PutImpl( const SfxPoolItem& rItem, sal_uInt16 nW
SfxPoolItem* pNewItem;
if (bPassingOwnership)
{
- assert(!dynamic_cast<const SfxItemSet*>(&rItem) && "can't pass ownership of SfxItem, they need to be cloned to the master pool");
+#ifndef NDEBUG
+ if (auto pSetItem = dynamic_cast<const SfxSetItem*>(&rItem))
+ assert(pSetItem->GetItemSet().GetPool() == pImpl->mpMaster && "can't pass ownership of SfxSetItem, unless they have been cloned to the master pool");
+#endif
pNewItem = const_cast<SfxPoolItem*>(&rItem);
}
else