summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorJochen Nitschke <j.nitschke+logerrit@ok.de>2016-08-31 19:58:14 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-09-01 06:46:46 +0000
commit705574be7ab3425ce7e43b38771b4f7e1b246f27 (patch)
tree3b16e9cd7f078882d77ae881dee141ac77a55e63 /svl
parentc48f940cf888816b3282b1c82136f57c010f1236 (diff)
use SfxItemPool::IsWhich instead of custom implementation
Change-Id: I56cbdc1ede491486643f73a98117c5cd4ce77c1d Reviewed-on: https://gerrit.libreoffice.org/28564 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'svl')
-rw-r--r--svl/source/items/itemprop.cxx4
-rw-r--r--svl/source/items/itemset.cxx16
2 files changed, 10 insertions, 10 deletions
diff --git a/svl/source/items/itemprop.cxx b/svl/source/items/itemprop.cxx
index 5e2a7279e1e4..c3ec9b69cec3 100644
--- a/svl/source/items/itemprop.cxx
+++ b/svl/source/items/itemprop.cxx
@@ -180,7 +180,7 @@ void SfxItemPropertySet::getPropertyValue( const SfxItemPropertySimpleEntry& rEn
// get the SfxPoolItem
const SfxPoolItem* pItem = nullptr;
SfxItemState eState = rSet.GetItemState( rEntry.nWID, true, &pItem );
- if(SfxItemState::SET != eState && SFX_WHICH_MAX > rEntry.nWID )
+ if (SfxItemState::SET != eState && SfxItemPool::IsWhich(rEntry.nWID) )
pItem = &rSet.GetPool()->GetDefaultItem(rEntry.nWID);
// return item values as uno::Any
if(eState >= SfxItemState::DEFAULT && pItem)
@@ -235,7 +235,7 @@ void SfxItemPropertySet::setPropertyValue( const SfxItemPropertySimpleEntry& rEn
const SfxPoolItem* pItem = nullptr;
std::unique_ptr<SfxPoolItem> pNewItem;
SfxItemState eState = rSet.GetItemState( rEntry.nWID, true, &pItem );
- if(SfxItemState::SET != eState && SFX_WHICH_MAX > rEntry.nWID )
+ if (SfxItemState::SET != eState && SfxItemPool::IsWhich(rEntry.nWID))
pItem = &rSet.GetPool()->GetDefaultItem(rEntry.nWID);
//maybe there's another way to find an Item
if(eState < SfxItemState::DEFAULT)
diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx
index d55f9c504753..ceb3f2764fa1 100644
--- a/svl/source/items/itemset.cxx
+++ b/svl/source/items/itemset.cxx
@@ -258,7 +258,7 @@ sal_uInt16 SfxItemSet::ClearItem( sal_uInt16 nWhich )
if ( !IsInvalidItem(pItemToClear) )
{
- if ( nWhich <= SFX_WHICH_MAX )
+ if (SfxItemPool::IsWhich(nWhich))
{
const SfxPoolItem& rNew = m_pParent
? m_pParent->Get( nWhich )
@@ -296,7 +296,7 @@ sal_uInt16 SfxItemSet::ClearItem( sal_uInt16 nWhich )
if ( !IsInvalidItem(pItemToClear) )
{
- if ( nWhich <= SFX_WHICH_MAX )
+ if (SfxItemPool::IsWhich(nWhich))
{
const SfxPoolItem& rNew = m_pParent
? m_pParent->Get( nWhich )
@@ -453,7 +453,7 @@ const SfxPoolItem* SfxItemSet::Put( const SfxPoolItem& rItem, sal_uInt16 nWhich
const SfxPoolItem& rNew = m_pPool->Put( rItem, nWhich );
const SfxPoolItem* pOld = *ppFnd;
*ppFnd = &rNew;
- if(nWhich <= SFX_WHICH_MAX)
+ if (SfxItemPool::IsWhich(nWhich))
Changed( *pOld, rNew );
m_pPool->Remove( *pOld );
}
@@ -466,7 +466,7 @@ const SfxPoolItem* SfxItemSet::Put( const SfxPoolItem& rItem, sal_uInt16 nWhich
else {
const SfxPoolItem& rNew = m_pPool->Put( rItem, nWhich );
*ppFnd = &rNew;
- if (nWhich <= SFX_WHICH_MAX )
+ if (SfxItemPool::IsWhich(nWhich))
{
const SfxPoolItem& rOld = m_pParent
? m_pParent->Get( nWhich )
@@ -766,7 +766,7 @@ const SfxPoolItem* SfxItemSet::GetItem(sal_uInt16 nId, bool bSearchInParent) con
// Is the Item set or 'bDeep == true' available?
const SfxPoolItem *pItem = nullptr;
SfxItemState eState = GetItemState(nWhich, bSearchInParent, &pItem);
- if (bSearchInParent && SfxItemState::DEFAULT == eState && nWhich <= SFX_WHICH_MAX)
+ if (bSearchInParent && SfxItemState::DEFAULT == eState && SfxItemPool::IsWhich(nWhich))
{
pItem = &m_pPool->GetDefaultItem(nWhich);
}
@@ -888,7 +888,7 @@ void SfxItemSet::Intersect( const SfxItemSet& rSet )
if( !IsInvalidItem( *ppFnd1 ) )
{
sal_uInt16 nWhich = (*ppFnd1)->Which();
- if(nWhich <= SFX_WHICH_MAX)
+ if (SfxItemPool::IsWhich(nWhich))
{
const SfxPoolItem& rNew = m_pParent
? m_pParent->Get( nWhich )
@@ -954,7 +954,7 @@ void SfxItemSet::Differentiate( const SfxItemSet& rSet )
if( !IsInvalidItem( *ppFnd1 ) )
{
sal_uInt16 nWhich = (*ppFnd1)->Which();
- if(nWhich <= SFX_WHICH_MAX)
+ if (SfxItemPool::IsWhich(nWhich))
{
const SfxPoolItem& rNew = m_pParent
? m_pParent->Get( nWhich )
@@ -1717,7 +1717,7 @@ const SfxPoolItem* SfxAllItemSet::Put( const SfxPoolItem& rItem, sal_uInt16 nWhi
bIncrementCount = true;
pOld = (m_pParent)
? &m_pParent->Get( nWhich )
- : ((nWhich <= SFX_WHICH_MAX)
+ : (SfxItemPool::IsWhich(nWhich)
? &m_pPool->GetDefaultItem(nWhich)
: nullptr);
}