summaryrefslogtreecommitdiff
path: root/cui/source/tabpages/backgrnd.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-09-10 17:53:41 +0200
committerStephan Bergmann <sbergman@redhat.com>2014-09-12 06:08:32 +0000
commitea733ab5b632109d28bb8f1dc37116340b26229b (patch)
tree78a5c4d6cad5d6f2c58a89745ba0af130ef0e188 /cui/source/tabpages/backgrnd.cxx
parentcc3294e127a6aedb8f6da5741ac9063da1cc2135 (diff)
Turn SfxItemState into a C++11 scoped enumeration
...to gain further confidence in the claim "that none of the existing code tries to uses combinations of these enum values" (d92602c5b13d0a60439d86c5a033d124178726ca "more fixes for SfxItemState") Change-Id: I987922d945e8738e38adfde83b869adf3ff35b13 Reviewed-on: https://gerrit.libreoffice.org/11384 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'cui/source/tabpages/backgrnd.cxx')
-rw-r--r--cui/source/tabpages/backgrnd.cxx34
1 files changed, 17 insertions, 17 deletions
diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx
index 2885744305da..3f48db5ccea3 100644
--- a/cui/source/tabpages/backgrnd.cxx
+++ b/cui/source/tabpages/backgrnd.cxx
@@ -403,7 +403,7 @@ SvxBackgroundTabPage::SvxBackgroundTabPage(Window* pParent, const SfxItemSet& rC
const SfxPoolItem* pItem;
SfxObjectShell* pShell;
- if ( SFX_ITEM_SET == rCoreSet.GetItemState( SID_HTML_MODE, false, &pItem )
+ if ( SfxItemState::SET == rCoreSet.GetItemState( SID_HTML_MODE, false, &pItem )
|| ( 0 != ( pShell = SfxObjectShell::Current()) &&
0 != ( pItem = pShell->GetItem( SID_HTML_MODE ) ) ) )
{
@@ -476,7 +476,7 @@ void SvxBackgroundTabPage::Reset( const SfxItemSet* rSet )
// but it must be existing in the rSet!
// const SfxPoolItem* pX = GetOldItem( rSet, SID_VIEW_FLD_PIC );
// if( pX && pX->ISA(SfxWallpaperItem))
- if(SFX_ITEM_DEFAULT <= rSet->GetItemState(GetWhich(SID_VIEW_FLD_PIC), false))
+ if(SfxItemState::DEFAULT <= rSet->GetItemState(GetWhich(SID_VIEW_FLD_PIC), false))
{
ResetFromWallpaperItem( *rSet );
return;
@@ -496,7 +496,7 @@ void SvxBackgroundTabPage::Reset( const SfxItemSet* rSet )
const SfxPoolItem* pItem;
sal_uInt16 nDestValue = USHRT_MAX;
- if ( SFX_ITEM_SET == rSet->GetItemState( SID_BACKGRND_DESTINATION,
+ if ( SfxItemState::SET == rSet->GetItemState( SID_BACKGRND_DESTINATION,
false, &pItem ) )
{
nDestValue = ((const SfxUInt16Item*)pItem)->GetValue();
@@ -515,7 +515,7 @@ void SvxBackgroundTabPage::Reset( const SfxItemSet* rSet )
break;
}
}
- else if( SFX_ITEM_SET == rSet->GetItemState(
+ else if( SfxItemState::SET == rSet->GetItemState(
SID_PARA_BACKGRND_DESTINATION, false, &pItem ) )
{
nDestValue = ((const SfxUInt16Item*)pItem)->GetValue();
@@ -543,7 +543,7 @@ void SvxBackgroundTabPage::Reset( const SfxItemSet* rSet )
nDestValue = 0;
sal_uInt16 nWhich = GetWhich( nSlot );
- if ( rSet->GetItemState( nWhich, false ) >= SFX_ITEM_DEFAULT )
+ if ( rSet->GetItemState( nWhich, false ) >= SfxItemState::DEFAULT )
pBgdAttr = (const SvxBrushItem*)&( rSet->Get( nWhich ) );
m_pBtnTile->Check();
@@ -584,21 +584,21 @@ void SvxBackgroundTabPage::Reset( const SfxItemSet* rSet )
pTableBck_Impl->nActPos = nValue;
nWhich = GetWhich( SID_ATTR_BRUSH );
- if ( rSet->GetItemState( nWhich, false ) >= SFX_ITEM_DEFAULT )
+ if ( rSet->GetItemState( nWhich, false ) >= SfxItemState::DEFAULT )
{
pBgdAttr = (const SvxBrushItem*)&( rSet->Get( nWhich ) );
pTableBck_Impl->pCellBrush = new SvxBrushItem(*pBgdAttr);
}
pTableBck_Impl->nCellWhich = nWhich;
- if ( rSet->GetItemState( SID_ATTR_BRUSH_ROW, false ) >= SFX_ITEM_DEFAULT )
+ if ( rSet->GetItemState( SID_ATTR_BRUSH_ROW, false ) >= SfxItemState::DEFAULT )
{
pBgdAttr = (const SvxBrushItem*)&( rSet->Get( SID_ATTR_BRUSH_ROW ) );
pTableBck_Impl->pRowBrush = new SvxBrushItem(*pBgdAttr);
}
pTableBck_Impl->nRowWhich = SID_ATTR_BRUSH_ROW;
- if ( rSet->GetItemState( SID_ATTR_BRUSH_TABLE, false ) >= SFX_ITEM_DEFAULT )
+ if ( rSet->GetItemState( SID_ATTR_BRUSH_TABLE, false ) >= SfxItemState::DEFAULT )
{
pBgdAttr = (const SvxBrushItem*)&( rSet->Get( SID_ATTR_BRUSH_TABLE ) );
pTableBck_Impl->pTableBrush = new SvxBrushItem(*pBgdAttr);
@@ -623,7 +623,7 @@ void SvxBackgroundTabPage::Reset( const SfxItemSet* rSet )
pParaBck_Impl->nActPos = nValue;
nWhich = GetWhich( SID_ATTR_BRUSH );
- if ( rSet->GetItemState( nWhich, false ) >= SFX_ITEM_DEFAULT )
+ if ( rSet->GetItemState( nWhich, false ) >= SfxItemState::DEFAULT )
{
pBgdAttr = (const SvxBrushItem*)&( rSet->Get( nWhich ) );
pParaBck_Impl->pParaBrush = new SvxBrushItem(*pBgdAttr);
@@ -632,7 +632,7 @@ void SvxBackgroundTabPage::Reset( const SfxItemSet* rSet )
nWhich = GetWhich( SID_ATTR_BRUSH_CHAR );
rSet->GetItemState( nWhich, true );
rSet->GetItemState( nWhich, false );
- if ( rSet->GetItemState( nWhich, true ) > SFX_ITEM_DEFAULT )
+ if ( rSet->GetItemState( nWhich, true ) > SfxItemState::DEFAULT )
{
pBgdAttr = (const SvxBrushItem*)&( rSet->Get( nWhich ) );
pParaBck_Impl->pCharBrush = new SvxBrushItem(*pBgdAttr);
@@ -660,7 +660,7 @@ void SvxBackgroundTabPage::ResetFromWallpaperItem( const SfxItemSet& rSet )
sal_uInt16 nWhich = GetWhich( nSlot );
boost::scoped_ptr<SvxBrushItem> pTemp;
- if ( rSet.GetItemState( nWhich, false ) >= SFX_ITEM_DEFAULT )
+ if ( rSet.GetItemState( nWhich, false ) >= SfxItemState::DEFAULT )
{
const CntWallpaperItem* pItem = (const CntWallpaperItem*)&rSet.Get( nWhich );
pTemp.reset(new SvxBrushItem( *pItem, nWhich ));
@@ -729,7 +729,7 @@ bool SvxBackgroundTabPage::FillItemSet( SfxItemSet* rCoreSet )
// const SfxPoolItem* pX = GetOldItem( rCoreSet, SID_VIEW_FLD_PIC );
// if( pX && pX->ISA(SfxWallpaperItem))
- if(SFX_ITEM_DEFAULT <= rCoreSet->GetItemState(GetWhich(SID_VIEW_FLD_PIC), false))
+ if(SfxItemState::DEFAULT <= rCoreSet->GetItemState(GetWhich(SID_VIEW_FLD_PIC), false))
return FillItemSetWithWallpaperItem( *rCoreSet, SID_VIEW_FLD_PIC );
bool bModified = false;
@@ -790,12 +790,12 @@ bool SvxBackgroundTabPage::FillItemSet( SfxItemSet* rCoreSet )
{
// Brush-treatment:
if ( rOldItem.GetColor() != aBgdColor ||
- (SFX_ITEM_DEFAULT >= eOldItemState && !m_pBackgroundColorSet->IsNoSelection()))
+ (SfxItemState::DEFAULT >= eOldItemState && !m_pBackgroundColorSet->IsNoSelection()))
{
bModified = true;
rCoreSet->Put( SvxBrushItem( aBgdColor, nWhich ) );
}
- else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, false ) )
+ else if ( SfxItemState::DEFAULT == rOldSet.GetItemState( nWhich, false ) )
rCoreSet->ClearItem( nWhich );
}
else
@@ -837,7 +837,7 @@ bool SvxBackgroundTabPage::FillItemSet( SfxItemSet* rCoreSet )
rCoreSet->Put(aTmpBrush);
}
- else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, false ) )
+ else if ( SfxItemState::DEFAULT == rOldSet.GetItemState( nWhich, false ) )
rCoreSet->ClearItem( nWhich );
}
}
@@ -998,7 +998,7 @@ bool SvxBackgroundTabPage::FillItemSetWithWallpaperItem( SfxItemSet& rCoreSet, s
aItem.SetColor( aBgdColor );
rCoreSet.Put( aItem );
}
- else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, false ) )
+ else if ( SfxItemState::DEFAULT == rOldSet.GetItemState( nWhich, false ) )
rCoreSet.ClearItem( nWhich );
}
else
@@ -1020,7 +1020,7 @@ bool SvxBackgroundTabPage::FillItemSetWithWallpaperItem( SfxItemSet& rCoreSet, s
aItem.SetBitmapURL( aBgdGraphicPath );
rCoreSet.Put( aItem );
}
- else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, false ) )
+ else if ( SfxItemState::DEFAULT == rOldSet.GetItemState( nWhich, false ) )
rCoreSet.ClearItem( nWhich );
}
}