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

Varun Dhall varun.dhall at studentpartner.com
Wed Aug 16 20:39:43 UTC 2017


 include/svl/itempool.hxx     |    2 +-
 svl/source/items/itemset.cxx |    2 +-
 svl/source/items/poolio.cxx  |   10 +++++-----
 3 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 75933b220d48bceff25b07cfc4b55c70a2e24917
Author: Varun Dhall <varun.dhall at studentpartner.com>
Date:   Thu Aug 17 01:23:47 2017 +0530

    Rename SfxItemPool GetSurrogate to CheckItemInPool
    
    Change-Id: Ife08e05a9fcbadea86c005a2e9defb7cef9b5acc
    Reviewed-on: https://gerrit.libreoffice.org/41231
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    Tested-by: Jenkins <ci at libreoffice.org>

diff --git a/include/svl/itempool.hxx b/include/svl/itempool.hxx
index 14051f6796d3..f2940ad49732 100644
--- a/include/svl/itempool.hxx
+++ b/include/svl/itempool.hxx
@@ -151,7 +151,7 @@ public:
     void                            Remove( const SfxPoolItem& );
     const SfxPoolItem&              GetDefaultItem( sal_uInt16 nWhich ) const;
 
-    sal_uInt32                      GetSurrogate(const SfxPoolItem *) const;
+    bool                            CheckItemInPool(const SfxPoolItem *) const;
     const SfxPoolItem *             GetItem2(sal_uInt16 nWhich, sal_uInt32 nSurrogate) const;
     const SfxPoolItem *             GetItem2Default(sal_uInt16 nWhich) const;
     sal_uInt32                      GetItemCount2(sal_uInt16 nWhich) const;
diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx
index 3b7efdc3348f..fc1ac104a652 100644
--- a/svl/source/items/itemset.cxx
+++ b/svl/source/items/itemset.cxx
@@ -1429,7 +1429,7 @@ void SfxItemSet::PutDirect(const SfxPoolItem &rItem)
     const sal_uInt16* pPtr = m_pWhichRanges;
     const sal_uInt16 nWhich = rItem.Which();
 #ifdef DBG_UTIL
-    IsPoolDefaultItem(&rItem) || m_pPool->GetSurrogate(&rItem);
+    IsPoolDefaultItem(&rItem) || m_pPool->CheckItemInPool(&rItem);
         // Only cause assertion in the callees
 #endif
     while( *pPtr )
diff --git a/svl/source/items/poolio.cxx b/svl/source/items/poolio.cxx
index ff490ed1a535..6c4e64381f80 100644
--- a/svl/source/items/poolio.cxx
+++ b/svl/source/items/poolio.cxx
@@ -88,7 +88,7 @@ sal_uInt16 SfxItemPool::GetSize_Impl() const
 }
 
 
-sal_uInt32 SfxItemPool::GetSurrogate(const SfxPoolItem *pItem) const
+bool SfxItemPool::CheckItemInPool(const SfxPoolItem *pItem) const
 {
     DBG_ASSERT( pItem, "no 0-Pointer Surrogate" );
     DBG_ASSERT( !IsInvalidItem(pItem), "no Invalid-Item Surrogate" );
@@ -97,13 +97,13 @@ sal_uInt32 SfxItemPool::GetSurrogate(const SfxPoolItem *pItem) const
     if ( !IsInRange(pItem->Which()) )
     {
         if ( pImpl->mpSecondary )
-            return pImpl->mpSecondary->GetSurrogate( pItem );
+            return pImpl->mpSecondary->CheckItemInPool( pItem );
         SAL_WARN( "svl.items", "unknown Which-Id - don't ask me for surrogates, with ID/pos " << pItem->Which());
     }
 
     // Pointer on static or pool-default attribute?
     if( IsStaticDefaultItem(pItem) || IsPoolDefaultItem(pItem) )
-        return SFX_ITEMS_DEFAULT;
+        return true;
 
     SfxPoolItemArray_Impl* pItemArr = pImpl->maPoolItems[GetIndex_Impl(pItem->Which())];
     DBG_ASSERT(pItemArr, "ItemArr is not available");
@@ -112,10 +112,10 @@ sal_uInt32 SfxItemPool::GetSurrogate(const SfxPoolItem *pItem) const
     {
         const SfxPoolItem *p = (*pItemArr)[i];
         if ( p == pItem )
-            return i;
+            return true;
     }
     SAL_WARN( "svl.items", "Item not in the pool, with ID/pos " << pItem->Which());
-    return SFX_ITEMS_NULL;
+    return false;
 }
 
 OUString readByteString(SvStream& rStream)


More information about the Libreoffice-commits mailing list