svl/source/items/itempool.cxx |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit fc6aa9e49973c845915754caf765ff57e5b0cd59
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Thu Nov 24 13:08:26 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Fri Nov 25 10:53:05 2022 +0100

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

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

Reply via email to