diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-03-08 12:39:34 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-03-09 07:25:29 +0000 |
commit | 9b95093950436caebd45a06008929427869844fa (patch) | |
tree | b5d08ffb144c208b5b6135258e0ca0a48b28acf7 /editeng | |
parent | 967d0089a16ad236a0fb9f5bba7fafd2327745a9 (diff) |
convert SvxCellHorJustify to scoped enum
Change-Id: I0dd88b5bf9e1aededfa2d94b6b2d3d26694fff33
Reviewed-on: https://gerrit.libreoffice.org/34968
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/items/justifyitem.cxx | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/editeng/source/items/justifyitem.cxx b/editeng/source/items/justifyitem.cxx index 5d63a37abd78..7f37aa8f367a 100644 --- a/editeng/source/items/justifyitem.cxx +++ b/editeng/source/items/justifyitem.cxx @@ -31,14 +31,14 @@ #include <com/sun/star/style/VerticalAlignment.hpp> -SfxPoolItem* SvxHorJustifyItem::CreateDefault() { return new SvxHorJustifyItem(SVX_HOR_JUSTIFY_STANDARD, 0) ;} +SfxPoolItem* SvxHorJustifyItem::CreateDefault() { return new SvxHorJustifyItem(SvxCellHorJustify::Standard, 0) ;} SfxPoolItem* SvxVerJustifyItem::CreateDefault() { return new SvxVerJustifyItem(SVX_VER_JUSTIFY_STANDARD, 0) ;} using namespace ::com::sun::star; SvxHorJustifyItem::SvxHorJustifyItem( const sal_uInt16 nId ) : - SfxEnumItem( nId, SVX_HOR_JUSTIFY_STANDARD ) + SfxEnumItem( nId, SvxCellHorJustify::Standard ) { } @@ -56,7 +56,7 @@ bool SvxHorJustifyItem::GetPresentation MapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper *) const { - rText = GetValueText( GetValue() ); + rText = GetValueText( (sal_uInt16)GetValue() ); return true; } @@ -71,12 +71,12 @@ bool SvxHorJustifyItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const table::CellHoriJustify eUno = table::CellHoriJustify_STANDARD; switch ( (SvxCellHorJustify)GetValue() ) { - case SVX_HOR_JUSTIFY_STANDARD: eUno = table::CellHoriJustify_STANDARD; break; - case SVX_HOR_JUSTIFY_LEFT: eUno = table::CellHoriJustify_LEFT; break; - case SVX_HOR_JUSTIFY_CENTER: eUno = table::CellHoriJustify_CENTER; break; - case SVX_HOR_JUSTIFY_RIGHT: eUno = table::CellHoriJustify_RIGHT; break; - case SVX_HOR_JUSTIFY_BLOCK: eUno = table::CellHoriJustify_BLOCK; break; - case SVX_HOR_JUSTIFY_REPEAT: eUno = table::CellHoriJustify_REPEAT; break; + case SvxCellHorJustify::Standard: eUno = table::CellHoriJustify_STANDARD; break; + case SvxCellHorJustify::Left: eUno = table::CellHoriJustify_LEFT; break; + case SvxCellHorJustify::Center: eUno = table::CellHoriJustify_CENTER; break; + case SvxCellHorJustify::Right: eUno = table::CellHoriJustify_RIGHT; break; + case SvxCellHorJustify::Block: eUno = table::CellHoriJustify_BLOCK; break; + case SvxCellHorJustify::Repeat: eUno = table::CellHoriJustify_REPEAT; break; } rVal <<= eUno; } @@ -90,12 +90,12 @@ bool SvxHorJustifyItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const switch ( (SvxCellHorJustify)GetValue() ) { // ParagraphAdjust_LEFT is used for STANDARD and REPEAT - case SVX_HOR_JUSTIFY_STANDARD: - case SVX_HOR_JUSTIFY_REPEAT: - case SVX_HOR_JUSTIFY_LEFT: nAdjust = style::ParagraphAdjust_LEFT; break; - case SVX_HOR_JUSTIFY_CENTER: nAdjust = style::ParagraphAdjust_CENTER; break; - case SVX_HOR_JUSTIFY_RIGHT: nAdjust = style::ParagraphAdjust_RIGHT; break; - case SVX_HOR_JUSTIFY_BLOCK: nAdjust = style::ParagraphAdjust_BLOCK; break; + case SvxCellHorJustify::Standard: + case SvxCellHorJustify::Repeat: + case SvxCellHorJustify::Left: nAdjust = style::ParagraphAdjust_LEFT; break; + case SvxCellHorJustify::Center: nAdjust = style::ParagraphAdjust_CENTER; break; + case SvxCellHorJustify::Right: nAdjust = style::ParagraphAdjust_RIGHT; break; + case SvxCellHorJustify::Block: nAdjust = style::ParagraphAdjust_BLOCK; break; } rVal <<= nAdjust; // as sal_Int16 } @@ -119,15 +119,15 @@ bool SvxHorJustifyItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) return false; eUno = (table::CellHoriJustify)nValue; } - SvxCellHorJustify eSvx = SVX_HOR_JUSTIFY_STANDARD; + SvxCellHorJustify eSvx = SvxCellHorJustify::Standard; switch (eUno) { - case table::CellHoriJustify_STANDARD: eSvx = SVX_HOR_JUSTIFY_STANDARD; break; - case table::CellHoriJustify_LEFT: eSvx = SVX_HOR_JUSTIFY_LEFT; break; - case table::CellHoriJustify_CENTER: eSvx = SVX_HOR_JUSTIFY_CENTER; break; - case table::CellHoriJustify_RIGHT: eSvx = SVX_HOR_JUSTIFY_RIGHT; break; - case table::CellHoriJustify_BLOCK: eSvx = SVX_HOR_JUSTIFY_BLOCK; break; - case table::CellHoriJustify_REPEAT: eSvx = SVX_HOR_JUSTIFY_REPEAT; break; + case table::CellHoriJustify_STANDARD: eSvx = SvxCellHorJustify::Standard; break; + case table::CellHoriJustify_LEFT: eSvx = SvxCellHorJustify::Left; break; + case table::CellHoriJustify_CENTER: eSvx = SvxCellHorJustify::Center; break; + case table::CellHoriJustify_RIGHT: eSvx = SvxCellHorJustify::Right; break; + case table::CellHoriJustify_BLOCK: eSvx = SvxCellHorJustify::Block; break; + case table::CellHoriJustify_REPEAT: eSvx = SvxCellHorJustify::Repeat; break; default: ; //prevent warning } SetValue( eSvx ); @@ -140,15 +140,15 @@ bool SvxHorJustifyItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) if(!(rVal >>= nVal)) return false; - SvxCellHorJustify eSvx = SVX_HOR_JUSTIFY_STANDARD; + SvxCellHorJustify eSvx = SvxCellHorJustify::Standard; switch (nVal) { // STRETCH is treated as BLOCK - case style::ParagraphAdjust_LEFT: eSvx = SVX_HOR_JUSTIFY_LEFT; break; - case style::ParagraphAdjust_RIGHT: eSvx = SVX_HOR_JUSTIFY_RIGHT; break; + case style::ParagraphAdjust_LEFT: eSvx = SvxCellHorJustify::Left; break; + case style::ParagraphAdjust_RIGHT: eSvx = SvxCellHorJustify::Right; break; case style::ParagraphAdjust_STRETCH: - case style::ParagraphAdjust_BLOCK: eSvx = SVX_HOR_JUSTIFY_BLOCK; break; - case style::ParagraphAdjust_CENTER: eSvx = SVX_HOR_JUSTIFY_CENTER; break; + case style::ParagraphAdjust_BLOCK: eSvx = SvxCellHorJustify::Block; break; + case style::ParagraphAdjust_CENTER: eSvx = SvxCellHorJustify::Center; break; } SetValue( eSvx ); } @@ -159,7 +159,7 @@ bool SvxHorJustifyItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) OUString SvxHorJustifyItem::GetValueText( sal_uInt16 nVal ) { - DBG_ASSERT( nVal <= SVX_HOR_JUSTIFY_REPEAT, "enum overflow!" ); + DBG_ASSERT( nVal <= (sal_uInt16)SvxCellHorJustify::Repeat, "enum overflow!" ); return EE_RESSTR(RID_SVXITEMS_HORJUST_STANDARD + nVal); } @@ -180,7 +180,7 @@ SfxPoolItem* SvxHorJustifyItem::Create( SvStream& rStream, sal_uInt16 ) const sal_uInt16 SvxHorJustifyItem::GetValueCount() const { - return SVX_HOR_JUSTIFY_REPEAT + 1; // Last Enum value + 1 + return (sal_uInt16)SvxCellHorJustify::Repeat + 1; // Last Enum value + 1 } |