diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-12-01 14:18:28 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-12-02 06:36:48 +0000 |
commit | 1517caa433b001968643ebcdca01c53bf76034d2 (patch) | |
tree | 75adad41c99afe90eee48f866f99784e24acd2e3 /oox/inc/drawingml | |
parent | 06eb947c1651cb623cd60d81b08281de4cc6a86b (diff) |
convert some anonymous enums to scoped
Change-Id: Ia989376c983ff475359e4964abeb1f5a2300ff5b
Reviewed-on: https://gerrit.libreoffice.org/31486
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'oox/inc/drawingml')
-rw-r--r-- | oox/inc/drawingml/textspacing.hxx | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/oox/inc/drawingml/textspacing.hxx b/oox/inc/drawingml/textspacing.hxx index efe0dab06674..d1ed9a988169 100644 --- a/oox/inc/drawingml/textspacing.hxx +++ b/oox/inc/drawingml/textspacing.hxx @@ -33,34 +33,34 @@ namespace oox { namespace drawingml { class TextSpacing { public: - enum { - POINTS = 0, - PERCENT + enum class Unit { + Points = 0, + Percent }; TextSpacing() - : nUnit( POINTS ), nValue( 0 ), bHasValue( false ) + : nUnit( Unit::Points ), nValue( 0 ), bHasValue( false ) { } - TextSpacing( sal_Int32 nPoints ) : nUnit( POINTS ), nValue( nPoints ), bHasValue( true ){}; + TextSpacing( sal_Int32 nPoints ) : nUnit( Unit::Points ), nValue( nPoints ), bHasValue( true ){}; css::style::LineSpacing toLineSpacing() const { css::style::LineSpacing aSpacing; - aSpacing.Mode = ( nUnit == PERCENT + aSpacing.Mode = ( nUnit == Unit::Percent ? css::style::LineSpacingMode::PROP : css::style::LineSpacingMode::MINIMUM ); - aSpacing.Height = static_cast< sal_Int16 >( nUnit == PERCENT ? nValue / 1000 : nValue ); + aSpacing.Height = static_cast< sal_Int16 >( nUnit == Unit::Percent ? nValue / 1000 : nValue ); return aSpacing; } sal_Int32 toMargin( float fFontSize ) const { - if ( nUnit == PERCENT ) + if ( nUnit == Unit::Percent ) return GetTextSpacingPoint(static_cast<sal_Int32>((fFontSize*nValue)/1000)); else return nValue; } - sal_Int32 nUnit; + Unit nUnit; sal_Int32 nValue; - bool bHasValue; + bool bHasValue; }; } } |