diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2016-06-05 08:55:56 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-06-10 11:01:04 +0200 |
commit | 6925222271d9404ec9f2340b4101ce9b1420539c (patch) | |
tree | 8cb4fdf956c1e5524f7c0f39d9294b651096cc6b /editeng | |
parent | 5b156b37d487b96ec19d65e01cd8cedd26a2150d (diff) |
Convert SvxPraVertAlignItem::Align to scoped enum
Change-Id: I2f73a200b04322dd65e0758f4238347bfea832fb
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/items/paraitem.cxx | 22 | ||||
-rw-r--r-- | editeng/source/rtf/rtfitem.cxx | 12 |
2 files changed, 17 insertions, 17 deletions
diff --git a/editeng/source/items/paraitem.cxx b/editeng/source/items/paraitem.cxx index 1eba1968fc71..dce9a3ecc066 100644 --- a/editeng/source/items/paraitem.cxx +++ b/editeng/source/items/paraitem.cxx @@ -64,7 +64,7 @@ SfxPoolItem* SvxPageModelItem::CreateDefault() { return new SvxPageModelItem(0) SfxPoolItem* SvxScriptSpaceItem::CreateDefault() { return new SvxScriptSpaceItem(false, 0);} SfxPoolItem* SvxHangingPunctuationItem::CreateDefault() { return new SvxHangingPunctuationItem(false, 0);} SfxPoolItem* SvxForbiddenRuleItem::CreateDefault() { return new SvxForbiddenRuleItem(false, 0);} -SfxPoolItem* SvxParaVertAlignItem::CreateDefault() { return new SvxParaVertAlignItem(0, 0);} +SfxPoolItem* SvxParaVertAlignItem::CreateDefault() { return new SvxParaVertAlignItem(Align::Automatic, 0);} SfxPoolItem* SvxParaGridItem::CreateDefault() { return new SvxParaGridItem(true, 0);} @@ -1383,9 +1383,9 @@ bool SvxForbiddenRuleItem::GetPresentation( |* class SvxParaVertAlignItem *************************************************************************/ -SvxParaVertAlignItem::SvxParaVertAlignItem( sal_uInt16 nValue, +SvxParaVertAlignItem::SvxParaVertAlignItem( Align nValue, const sal_uInt16 nW ) - : SfxUInt16Item( nW, nValue ) + : SfxUInt16Item( nW, (sal_uInt16)nValue ) { } @@ -1398,12 +1398,12 @@ SfxPoolItem* SvxParaVertAlignItem::Create( SvStream& rStrm, sal_uInt16 ) const { sal_uInt16 nVal; rStrm.ReadUInt16( nVal ); - return new SvxParaVertAlignItem( nVal, Which() ); + return new SvxParaVertAlignItem( (Align)nVal, Which() ); } SvStream& SvxParaVertAlignItem::Store( SvStream & rStrm, sal_uInt16 ) const { - rStrm.WriteUInt16( GetValue() ); + rStrm.WriteUInt16( (sal_uInt16)GetValue() ); return rStrm; } @@ -1420,10 +1420,10 @@ bool SvxParaVertAlignItem::GetPresentation( sal_uInt16 nTmp; switch( GetValue() ) { - case AUTOMATIC: nTmp = RID_SVXITEMS_PARAVERTALIGN_AUTO; break; - case TOP: nTmp = RID_SVXITEMS_PARAVERTALIGN_TOP; break; - case CENTER: nTmp = RID_SVXITEMS_PARAVERTALIGN_CENTER; break; - case BOTTOM: nTmp = RID_SVXITEMS_PARAVERTALIGN_BOTTOM; break; + case Align::Automatic: nTmp = RID_SVXITEMS_PARAVERTALIGN_AUTO; break; + case Align::Top: nTmp = RID_SVXITEMS_PARAVERTALIGN_TOP; break; + case Align::Center: nTmp = RID_SVXITEMS_PARAVERTALIGN_CENTER; break; + case Align::Bottom: nTmp = RID_SVXITEMS_PARAVERTALIGN_BOTTOM; break; default: nTmp = RID_SVXITEMS_PARAVERTALIGN_BASELINE; break; } rText = EE_RESSTR( nTmp ); @@ -1441,9 +1441,9 @@ bool SvxParaVertAlignItem::PutValue( const css::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) { sal_Int16 nVal = sal_Int16(); - if((rVal >>= nVal) && nVal >=0 && nVal <= BOTTOM ) + if((rVal >>= nVal) && nVal >=0 && nVal <= (sal_uInt16)Align::Bottom ) { - SetValue( (sal_uInt16)nVal ); + SetValue( (Align)nVal ); return true; } else diff --git a/editeng/source/rtf/rtfitem.cxx b/editeng/source/rtf/rtfitem.cxx index f6e0691facbe..202578aa98e5 100644 --- a/editeng/source/rtf/rtfitem.cxx +++ b/editeng/source/rtf/rtfitem.cxx @@ -210,7 +210,7 @@ void SvxRTFParser::ReadAttr( int nToken, SfxItemSet* pSet ) FontEmphasisMark eEmphasis; bPardTokenRead = false; RTF_CharTypeDef eCharType = NOTDEF_CHARTYPE; - sal_uInt16 nFontAlign; + SvxParaVertAlignItem::Align nFontAlign; bool bChkStkPos = !bNewGroup && !aAttrStack.empty(); @@ -517,15 +517,15 @@ void SvxRTFParser::ReadAttr( int nToken, SfxItemSet* pSet ) break; case RTF_FAFIXED: - case RTF_FAAUTO: nFontAlign = SvxParaVertAlignItem::AUTOMATIC; + case RTF_FAAUTO: nFontAlign = SvxParaVertAlignItem::Align::Automatic; goto SET_FONTALIGNMENT; - case RTF_FAHANG: nFontAlign = SvxParaVertAlignItem::TOP; + case RTF_FAHANG: nFontAlign = SvxParaVertAlignItem::Align::Top; goto SET_FONTALIGNMENT; - case RTF_FAVAR: nFontAlign = SvxParaVertAlignItem::BOTTOM; + case RTF_FAVAR: nFontAlign = SvxParaVertAlignItem::Align::Bottom; goto SET_FONTALIGNMENT; - case RTF_FACENTER: nFontAlign = SvxParaVertAlignItem::CENTER; + case RTF_FACENTER: nFontAlign = SvxParaVertAlignItem::Align::Center; goto SET_FONTALIGNMENT; - case RTF_FAROMAN: nFontAlign = SvxParaVertAlignItem::BASELINE; + case RTF_FAROMAN: nFontAlign = SvxParaVertAlignItem::Align::Baseline; goto SET_FONTALIGNMENT; SET_FONTALIGNMENT: if( aPardMap.nFontAlign ) |