summaryrefslogtreecommitdiff
path: root/svx/source/items/pageitem.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source/items/pageitem.cxx')
-rw-r--r--svx/source/items/pageitem.cxx37
1 files changed, 18 insertions, 19 deletions
diff --git a/svx/source/items/pageitem.cxx b/svx/source/items/pageitem.cxx
index 379b65c59a8d..7371ef1de7cb 100644
--- a/svx/source/items/pageitem.cxx
+++ b/svx/source/items/pageitem.cxx
@@ -39,7 +39,7 @@ SvxPageItem::SvxPageItem( const sal_uInt16 nId ) : SfxPoolItem( nId ),
eNumType ( css::style::NumberingType::ARABIC ),
bLandscape ( false ),
- eUse ( SVX_PAGE_ALL )
+ eUse ( SvxPageUsage::All )
{
}
@@ -70,14 +70,14 @@ bool SvxPageItem::operator==( const SfxPoolItem& rAttr ) const
eUse == rItem.eUse );
}
-inline OUString GetUsageText( const sal_uInt16 eU )
+inline OUString GetUsageText( const SvxPageUsage eU )
{
- switch( eU & 0x000f )
+ switch( eU )
{
- case SVX_PAGE_LEFT : return SVX_RESSTR(RID_SVXITEMS_PAGE_USAGE_LEFT);
- case SVX_PAGE_RIGHT : return SVX_RESSTR(RID_SVXITEMS_PAGE_USAGE_RIGHT);
- case SVX_PAGE_ALL : return SVX_RESSTR(RID_SVXITEMS_PAGE_USAGE_ALL);
- case SVX_PAGE_MIRROR: return SVX_RESSTR(RID_SVXITEMS_PAGE_USAGE_MIRROR);
+ case SvxPageUsage::Left : return SVX_RESSTR(RID_SVXITEMS_PAGE_USAGE_LEFT);
+ case SvxPageUsage::Right : return SVX_RESSTR(RID_SVXITEMS_PAGE_USAGE_RIGHT);
+ case SvxPageUsage::All : return SVX_RESSTR(RID_SVXITEMS_PAGE_USAGE_ALL);
+ case SvxPageUsage::Mirror: return SVX_RESSTR(RID_SVXITEMS_PAGE_USAGE_MIRROR);
default: return OUString();
}
}
@@ -160,12 +160,12 @@ bool SvxPageItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
case MID_PAGE_LAYOUT :
{
style::PageStyleLayout eRet;
- switch(eUse & 0x0f)
+ switch(eUse)
{
- case SVX_PAGE_LEFT : eRet = style::PageStyleLayout_LEFT; break;
- case SVX_PAGE_RIGHT : eRet = style::PageStyleLayout_RIGHT; break;
- case SVX_PAGE_ALL : eRet = style::PageStyleLayout_ALL; break;
- case SVX_PAGE_MIRROR: eRet = style::PageStyleLayout_MIRRORED; break;
+ case SvxPageUsage::Left : eRet = style::PageStyleLayout_LEFT; break;
+ case SvxPageUsage::Right : eRet = style::PageStyleLayout_RIGHT; break;
+ case SvxPageUsage::All : eRet = style::PageStyleLayout_ALL; break;
+ case SvxPageUsage::Mirror: eRet = style::PageStyleLayout_MIRRORED; break;
default:
OSL_FAIL("what layout is this?");
return false;
@@ -204,13 +204,12 @@ bool SvxPageItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
return false;
eLayout = (style::PageStyleLayout)nValue;
}
- eUse &= 0xfff0;
switch( eLayout )
{
- case style::PageStyleLayout_LEFT : eUse |= SVX_PAGE_LEFT ; break;
- case style::PageStyleLayout_RIGHT : eUse |= SVX_PAGE_RIGHT; break;
- case style::PageStyleLayout_ALL : eUse |= SVX_PAGE_ALL ; break;
- case style::PageStyleLayout_MIRRORED: eUse |= SVX_PAGE_MIRROR;break;
+ case style::PageStyleLayout_LEFT : eUse = SvxPageUsage::Left ; break;
+ case style::PageStyleLayout_RIGHT : eUse = SvxPageUsage::Right; break;
+ case style::PageStyleLayout_ALL : eUse = SvxPageUsage::All ; break;
+ case style::PageStyleLayout_MIRRORED: eUse = SvxPageUsage::Mirror;break;
default: ;//prevent warning
}
}
@@ -237,7 +236,7 @@ SfxPoolItem* SvxPageItem::Create( SvStream& rStream, sal_uInt16 ) const
pPage->SetDescName( sStr );
pPage->SetNumType( (SvxNumType)eType );
pPage->SetLandscape( bLand );
- pPage->SetPageUsage( nUse );
+ pPage->SetPageUsage( (SvxPageUsage)nUse );
return pPage;
}
@@ -247,7 +246,7 @@ SvStream& SvxPageItem::Store( SvStream &rStrm, sal_uInt16 /*nItemVersion*/ ) con
// UNICODE: rStrm << aDescName;
rStrm.WriteUniOrByteString(aDescName, rStrm.GetStreamCharSet());
- rStrm.WriteUChar( eNumType ).WriteBool( bLandscape ).WriteUInt16( eUse );
+ rStrm.WriteUChar( eNumType ).WriteBool( bLandscape ).WriteUInt16( (sal_uInt16)eUse );
return rStrm;
}