From e64c291c5fd1d3ff625dc118ad7e0460df03eb78 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Mon, 6 Feb 2012 14:29:55 -0500 Subject: I think it's time we had a real method for this... This helps eliminate dozens of IS_AVAILABLE macros scattered across Calc code. I'm sure we have other similar macros like this elsewhere. --- svl/inc/svl/itemset.hxx | 2 ++ svl/source/items/itemset.cxx | 5 +++++ 2 files changed, 7 insertions(+) (limited to 'svl') diff --git a/svl/inc/svl/itemset.hxx b/svl/inc/svl/itemset.hxx index b3dea2cfa08b..e9393654d5c1 100644 --- a/svl/inc/svl/itemset.hxx +++ b/svl/inc/svl/itemset.hxx @@ -134,6 +134,8 @@ public: sal_Bool bSrchInParent = sal_True, const SfxPoolItem **ppItem = 0 ) const; + bool HasItem(sal_uInt16 nWhich, const SfxPoolItem*& rpItem) const; + virtual void DisableItem(sal_uInt16 nWhich); virtual void InvalidateItem( sal_uInt16 nWhich ); virtual sal_uInt16 ClearItem( sal_uInt16 nWhich = 0); diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx index 62ac9f25d5f6..f094d9351509 100644 --- a/svl/source/items/itemset.cxx +++ b/svl/source/items/itemset.cxx @@ -546,6 +546,11 @@ SfxItemState SfxItemSet::GetItemState( sal_uInt16 nWhich, return eRet; } +bool SfxItemSet::HasItem(sal_uInt16 nWhich, const SfxPoolItem*& rpItem) const +{ + return SFX_ITEM_SET == GetItemState(nWhich, true, &rpItem); +} + // ----------------------------------------------------------------------- const SfxPoolItem* SfxItemSet::Put( const SfxPoolItem& rItem, sal_uInt16 nWhich ) -- cgit v1.2.3