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

Stephan Bergmann sbergman at redhat.com
Mon Aug 11 06:52:25 PDT 2014


 svl/source/items/itempool.cxx |    8 --------
 svl/source/items/itemset.cxx  |   15 ---------------
 svl/source/items/poolio.cxx   |   13 -------------
 3 files changed, 36 deletions(-)

New commits:
commit abd8e76453038f51ad9d5b1bfeaef592e1271ee5
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Aug 11 15:50:56 2014 +0200

    -Werror,-Wtautological-undefined-compare
    
    ("reference cannot be bound to dereferenced null pointer in well-defined C++
    code; comparison may be assumed to always evaluate to true")
    
    Change-Id: I41660cb5e9a14a5c0694259f0244c789ce3d4753

diff --git a/svl/source/items/itempool.cxx b/svl/source/items/itempool.cxx
index 92cfb62..32a20b3 100644
--- a/svl/source/items/itempool.cxx
+++ b/svl/source/items/itempool.cxx
@@ -636,10 +636,6 @@ void SfxItemPool::ResetPoolDefaultItem( sal_uInt16 nWhichId )
 
 const SfxPoolItem& SfxItemPool::Put( const SfxPoolItem& rItem, sal_uInt16 nWhich )
 {
-    DBG_ASSERT( !rItem.ISA(SfxSetItem) ||
-                0 != &((const SfxSetItem&)rItem).GetItemSet(),
-                "SetItem without ItemSet" );
-
     if ( 0 == nWhich )
         nWhich = rItem.Which();
 
@@ -792,10 +788,6 @@ void SfxPoolItemArray_Impl::ReHash()
 
 void SfxItemPool::Remove( const SfxPoolItem& rItem )
 {
-    DBG_ASSERT( !rItem.ISA(SfxSetItem) ||
-                0 != &((const SfxSetItem&)rItem).GetItemSet(),
-                "SetItem without ItemSet" );
-
     SFX_ASSERT( !IsPoolDefaultItem(&rItem), rItem.Which(),
                 "where's the Pool Default coming from here?" );
 
diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx
index 8b3dc0a..964c8af 100644
--- a/svl/source/items/itemset.cxx
+++ b/svl/source/items/itemset.cxx
@@ -482,12 +482,6 @@ SfxItemState SfxItemSet::GetItemState( sal_uInt16 nWhich,
 
                     if (ppItem)
                     {
-                        #ifdef DBG_UTIL
-                        const SfxPoolItem *pItem = *ppFnd;
-                        DBG_ASSERT( !pItem->ISA(SfxSetItem) ||
-                                0 != &((const SfxSetItem*)pItem)->GetItemSet(),
-                                "SetItem without ItemSet" );
-                        #endif
                         *ppItem = *ppFnd;
                     }
                     return SFX_ITEM_SET;
@@ -512,9 +506,6 @@ bool SfxItemSet::HasItem(sal_uInt16 nWhich, const SfxPoolItem** ppItem) const
 
 const SfxPoolItem* SfxItemSet::Put( const SfxPoolItem& rItem, sal_uInt16 nWhich )
 {
-    DBG_ASSERT( !rItem.ISA(SfxSetItem) ||
-            0 != &((const SfxSetItem&)rItem).GetItemSet(),
-            "SetItem without ItemSet" );
     if ( !nWhich )
         return 0; //FIXME: Only because of Outliner bug
 
@@ -936,9 +927,6 @@ const SfxPoolItem& SfxItemSet::Get( sal_uInt16 nWhich, bool bSrchInParent) const
                         }
 #ifdef DBG_UTIL
                         const SfxPoolItem *pItem = *ppFnd;
-                        DBG_ASSERT( !pItem->ISA(SfxSetItem) ||
-                                0 != &((const SfxSetItem*)pItem)->GetItemSet(),
-                                "SetItem without ItemSet" );
                         if ( pItem->ISA(SfxVoidItem) || !pItem->Which() )
                             DBG_WARNING( "SFX_WARNING: Getting disabled Item" );
 #endif
@@ -958,9 +946,6 @@ const SfxPoolItem& SfxItemSet::Get( sal_uInt16 nWhich, bool bSrchInParent) const
     // Get the Default from the Pool and return
     SFX_ASSERT(_pPool, nWhich, "no Pool, but status is ambiguous");
     const SfxPoolItem *pItem = &_pPool->GetDefaultItem( nWhich );
-    DBG_ASSERT( !pItem->ISA(SfxSetItem) ||
-            0 != &((const SfxSetItem*)pItem)->GetItemSet(),
-            "SetItem without ItemSet" );
     return *pItem;
 }
 
diff --git a/svl/source/items/poolio.cxx b/svl/source/items/poolio.cxx
index c1cd7b1..661fd37 100644
--- a/svl/source/items/poolio.cxx
+++ b/svl/source/items/poolio.cxx
@@ -326,13 +326,6 @@ void SfxItemPool::LoadCompleted()
                 {
                     if (*ppHtArr)
                     {
-                        #ifdef DBG_UTIL
-                        const SfxPoolItem &rItem = **ppHtArr;
-                        DBG_ASSERT( !rItem.ISA(SfxSetItem) ||
-                                    0 != &((const SfxSetItem&)rItem).GetItemSet(),
-                                    "SetItem without ItemSet" );
-                        #endif
-
                         if ( !ReleaseRef( **ppHtArr, 1 ) )
                             DELETEZ( *ppHtArr );
                     }
@@ -488,13 +481,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream)
                 for( size_t n = (*itrItemArr)->size(); n; --n, ++ppHtArr )
                     if (*ppHtArr)
                     {
-                        #ifdef DBG_UTIL
-                        const SfxPoolItem &rItem = **ppHtArr;
-                        DBG_ASSERT( !rItem.ISA(SfxSetItem) ||
-                                    0 != &((const SfxSetItem&)rItem).GetItemSet(),
-                                    "SetItem without ItemSet" );
                         DBG_WARNING( "loading non-empty ItemPool" );
-                        #endif
 
                         AddRef( **ppHtArr, 1 );
                     }


More information about the Libreoffice-commits mailing list