summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2015-10-19 08:43:28 +0200
committerJan Holesovsky <kendy@collabora.com>2015-10-19 10:14:03 +0200
commitf6f32e8eabb2e09fbe2b70dfb540bb1ea1ee75a9 (patch)
treec209bbe8553133fc32bb986473795f2441517f48 /svl
parent6be5ed60e1823d909511c6af48e6bdc2817cce7c (diff)
sfx items: Get rid of the TypeId check, nobody uses that any more.
And introduce the appropriate assert() in the templatized version instead. Change-Id: I3e5b01e5e5ee49049fa6f35e3d05ef65a1890dc1
Diffstat (limited to 'svl')
-rw-r--r--svl/source/items/itemset.cxx35
1 files changed, 4 insertions, 31 deletions
diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx
index d9363c14b725..1e72cf67e21e 100644
--- a/svl/source/items/itemset.cxx
+++ b/svl/source/items/itemset.cxx
@@ -812,47 +812,20 @@ bool SfxItemSet::Set
return bRet;
}
-/**
- * This method eases accessing single Items in the SfxItemSet.
- * Type checking is done via assertion, which makes client code
- * much more readable.
- *
- * The PRODUCT version returns 0, if the Item found is not of the
- * specified class.
- *
- * @returns 0 if the ItemSet does not contain an Item with the Id 'nWhich'
- */
-const SfxPoolItem* SfxItemSet::GetItem
-(
- sal_uInt16 nId, // SlotId or the Item's WhichId
- bool bSrchInParent, // sal_True: also search in Parent ItemSets
- TypeId aItemType // != 0 => RTTI check using assertion
-) const
+const SfxPoolItem* SfxItemSet::GetItem(sal_uInt16 nId, bool bSearchInParent) const
{
// Convert to WhichId
sal_uInt16 nWhich = GetPool()->GetWhich(nId);
// Is the Item set or 'bDeep == true' available?
const SfxPoolItem *pItem = 0;
- SfxItemState eState = GetItemState( nWhich, bSrchInParent, &pItem );
- if ( bSrchInParent && SfxItemState::DEFAULT == eState &&
- nWhich <= SFX_WHICH_MAX )
+ SfxItemState eState = GetItemState(nWhich, bSearchInParent, &pItem);
+ if (bSearchInParent && SfxItemState::DEFAULT == eState && nWhich <= SFX_WHICH_MAX)
{
pItem = &m_pPool->GetDefaultItem(nWhich);
}
- if ( pItem )
- {
- // Does the type match?
- if ( !aItemType || pItem->IsA(aItemType) )
- return pItem;
-
- // Else report error
- assert(!"invalid argument type");
- }
-
- // No Item of wrong type found
- return 0;
+ return pItem;
}
const SfxPoolItem& SfxItemSet::Get( sal_uInt16 nWhich, bool bSrchInParent) const