diff options
author | Jan Holesovsky <kendy@collabora.com> | 2015-10-16 09:41:46 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2015-10-16 12:12:27 +0200 |
commit | 20248b82be361279f2b4814280b0371658ca27c0 (patch) | |
tree | 0b34337aea0fd282605c75f9658999b8e90c8144 /include/svl/itemset.hxx | |
parent | e5be07f5167d4103b4620201df350b1d9e795393 (diff) |
sfx items: Introduce a templatized version of SfxItemSet::GetItem().
Change-Id: I821622fc1f8415f2ddd14744f33b46fa76f00039
Diffstat (limited to 'include/svl/itemset.hxx')
-rw-r--r-- | include/svl/itemset.hxx | 8 |
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; |