summaryrefslogtreecommitdiff
path: root/include/svl
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2015-10-16 09:41:46 +0200
committerJan Holesovsky <kendy@collabora.com>2015-10-16 12:12:27 +0200
commit20248b82be361279f2b4814280b0371658ca27c0 (patch)
tree0b34337aea0fd282605c75f9658999b8e90c8144 /include/svl
parente5be07f5167d4103b4620201df350b1d9e795393 (diff)
sfx items: Introduce a templatized version of SfxItemSet::GetItem().
Change-Id: I821622fc1f8415f2ddd14744f33b46fa76f00039
Diffstat (limited to 'include/svl')
-rw-r--r--include/svl/itemset.hxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/svl/itemset.hxx b/include/svl/itemset.hxx
index 02ded794613d..4685441ecbf1 100644
--- a/include/svl/itemset.hxx
+++ b/include/svl/itemset.hxx
@@ -84,9 +84,15 @@ public:
sal_uInt16 TotalCount() const;
const SfxPoolItem& Get( sal_uInt16 nWhich, bool bSrchInParent = true ) const;
- const SfxPoolItem* GetItem( sal_uInt16 nWhich, bool bSrchInParent = true,
+ const SfxPoolItem* GetItem( sal_uInt16 nWhich, bool bSearchInParent = true,
TypeId aItemType = 0 ) const;
+ /// Templatized version of the GetItem().
+ template<class T> const T* GetItem(sal_uInt16 nWhich, bool bSearchInParent = true) const
+ {
+ return dynamic_cast<const T*>(GetItem(nWhich, bSearchInParent));
+ }
+
// Get Which-value of the item at position nPos
sal_uInt16 GetWhichByPos(sal_uInt16 nPos) const;