diff options
Diffstat (limited to 'svl/source/items/itempool.cxx')
-rw-r--r-- | svl/source/items/itempool.cxx | 5 |
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 |