summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-04-13 19:00:50 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-04-13 20:38:25 +0200
commitdbe582ffa0cbbb2b4182e785fd3c37afc7863b97 (patch)
treeb8dafb626c9c98fd9d4da3ed309e67e54253d2b8 /svl
parentdafdcb748a54a5e41bcb61f67355e06265bf98ff (diff)
we don't want this dynamic_cast in release builds
so wrap it in NDEBUG Change-Id: I3f6edddf8a3a16dcd337153cd75624e548459dd3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114064 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svl')
-rw-r--r--svl/source/items/itempool.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/svl/source/items/itempool.cxx b/svl/source/items/itempool.cxx
index 15f92acfcfd4..1d84ab00a115 100644
--- a/svl/source/items/itempool.cxx
+++ b/svl/source/items/itempool.cxx
@@ -670,6 +670,7 @@ const SfxPoolItem& SfxItemPool::PutImpl( const SfxPoolItem& rItem, sal_uInt16 nW
pNewItem = rItem.Clone(pImpl->mpMaster);
pNewItem->SetWhich(nWhich);
assert(typeid(rItem) == typeid(*pNewItem) && "SfxItemPool::Put(): unequal types, no Clone() override?");
+#ifndef NDEBUG
if (dynamic_cast<const SfxSetItem*>(&rItem) == nullptr)
{
assert((!IsItemPoolable(nWhich) || rItem == *pNewItem)
@@ -677,6 +678,7 @@ const SfxPoolItem& SfxItemPool::PutImpl( const SfxPoolItem& rItem, sal_uInt16 nW
assert((!IsItemPoolable(*pNewItem) || *pNewItem == rItem)
&& "SfxItemPool::Put(): unequal items: no operator== override?");
}
+#endif
AddRef( *pNewItem );
// 4. finally insert into the pointer array