Kaydet (Commit) 75933b22 authored tarafından Varun Dhall's avatar Varun Dhall Kaydeden (comit) Michael Stahl

Rename SfxItemPool GetSurrogate to CheckItemInPool

Change-Id: Ife08e05a9fcbadea86c005a2e9defb7cef9b5acc
Reviewed-on: https://gerrit.libreoffice.org/41231Reviewed-by: 's avatarMichael Stahl <mstahl@redhat.com>
Tested-by: 's avatarJenkins <ci@libreoffice.org>
üst bc11bee3
......@@ -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;
......
......@@ -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 )
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment