diff options
author | Noel <noel.grandin@collabora.co.uk> | 2020-12-22 15:42:08 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-01-02 15:26:38 +0100 |
commit | 11e52fe2979b0947814a49b9c17ec373795cbf8e (patch) | |
tree | 48268579f052b7fdfcc2c334fffe8c91d29cb234 /svx/source/items | |
parent | 610ceb05025c9c7a9a34dddcb0dac506b8eab441 (diff) |
introduce Degree100 strong_int type
Change-Id: I78f837a1340be0ca5c49097f543a481b7b43a632
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108367
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source/items')
-rw-r--r-- | svx/source/items/algitem.cxx | 12 | ||||
-rw-r--r-- | svx/source/items/autoformathelper.cxx | 4 |
2 files changed, 8 insertions, 8 deletions
diff --git a/svx/source/items/algitem.cxx b/svx/source/items/algitem.cxx index 58a71f11594c..d432963f4b3d 100644 --- a/svx/source/items/algitem.cxx +++ b/svx/source/items/algitem.cxx @@ -42,14 +42,14 @@ SvxOrientationItem::SvxOrientationItem( const SvxCellOrientation eOrientation, { } -SvxOrientationItem::SvxOrientationItem( sal_Int32 nRotation, bool bStacked, const sal_uInt16 nId ) : +SvxOrientationItem::SvxOrientationItem( Degree100 nRotation, bool bStacked, const sal_uInt16 nId ) : SfxEnumItem( nId, SvxCellOrientation::Standard ) { if( bStacked ) { SetValue( SvxCellOrientation::Stacked ); } - else switch( nRotation ) + else switch( nRotation.get() ) { case 9000: SetValue( SvxCellOrientation::BottomUp ); break; case 27000: SetValue( SvxCellOrientation::TopBottom ); break; @@ -128,13 +128,13 @@ bool SvxOrientationItem::IsStacked() const return GetValue() == SvxCellOrientation::Stacked; } -sal_Int32 SvxOrientationItem::GetRotation( sal_Int32 nStdAngle ) const +Degree100 SvxOrientationItem::GetRotation( Degree100 nStdAngle ) const { - sal_Int32 nAngle = nStdAngle; + Degree100 nAngle = nStdAngle; switch( GetValue() ) { - case SvxCellOrientation::BottomUp: nAngle = 9000;break; - case SvxCellOrientation::TopBottom: nAngle = 27000;break; + case SvxCellOrientation::BottomUp: nAngle = 9000_deg100; break; + case SvxCellOrientation::TopBottom: nAngle = 27000_deg100; break; default: ; //prevent warning } return nAngle; diff --git a/svx/source/items/autoformathelper.cxx b/svx/source/items/autoformathelper.cxx index a15af6d6a3e4..1148fa7d12aa 100644 --- a/svx/source/items/autoformathelper.cxx +++ b/svx/source/items/autoformathelper.cxx @@ -361,7 +361,7 @@ bool AutoFormatBase::LoadBlockB( SvStream& rStream, const AutoFormatVersions& rV } m_aStacked->SetValue( aOrientation.IsStacked() ); - m_aRotateAngle->SetValue( aOrientation.GetRotation( m_aRotateAngle->GetValue() ) ); + m_aRotateAngle->SetValue( aOrientation.GetRotation( Degree100(m_aRotateAngle->GetValue()) ).get() ); return ERRCODE_NONE == rStream.GetError(); } @@ -407,7 +407,7 @@ bool AutoFormatBase::SaveBlockB( SvStream& rStream, sal_uInt16 fileVersion ) con { legacy::SvxHorJustify::Store(*m_aHorJustify, rStream, legacy::SvxHorJustify::GetVersion(fileVersion)); legacy::SvxVerJustify::Store(*m_aVerJustify, rStream, legacy::SvxVerJustify::GetVersion(fileVersion)); - SvxOrientationItem aOrientation( m_aRotateAngle->GetValue(), m_aStacked->GetValue(), 0 ); + SvxOrientationItem aOrientation( Degree100(m_aRotateAngle->GetValue()), m_aStacked->GetValue(), 0 ); legacy::SvxOrientation::Store(aOrientation, rStream, legacy::SvxOrientation::GetVersion(fileVersion)); legacy::SvxMargin::Store(*m_aMargin, rStream, legacy::SvxMargin::GetVersion(fileVersion)); legacy::SfxBool::Store(*m_aLinebreak, rStream, legacy::SfxBool::GetVersion(fileVersion)); |