summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@suse.com>2012-02-06 14:29:55 -0500
committerKohei Yoshida <kohei.yoshida@suse.com>2012-02-06 14:29:55 -0500
commite64c291c5fd1d3ff625dc118ad7e0460df03eb78 (patch)
tree2dd628d1ecbecd11a5b5b87c860410d3611cb482 /svl
parent28ff7a37e66c8746a0b176b4ea25e20c1cd135c5 (diff)
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.
Diffstat (limited to 'svl')
-rw-r--r--svl/inc/svl/itemset.hxx2
-rw-r--r--svl/source/items/itemset.cxx5
2 files changed, 7 insertions, 0 deletions
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 )