[Libreoffice-commits] core.git: svl/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Tue Apr 13 18:39:08 UTC 2021


 svl/source/items/itempool.cxx |    2 ++
 1 file changed, 2 insertions(+)

New commits:
commit dbe582ffa0cbbb2b4182e785fd3c37afc7863b97
Author:     Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Tue Apr 13 19:00:50 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Apr 13 20:38:25 2021 +0200

    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 at collabora.co.uk>

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


More information about the Libreoffice-commits mailing list