diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2020-10-20 07:27:44 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-10-21 08:13:05 +0200 |
commit | 0fb58a1ff168ae122e9c8993a3136658e3b0e3f0 (patch) | |
tree | 908983b02f466e0a49599edc70aaa1baaa240371 /vcl/source/gdi/hatch.cxx | |
parent | b84afd2188d6993c91081885dc24664bd3f1cc73 (diff) |
new tools::Degree10 strong typedef
partly to flush some use of "long" out the codebase,
but also to make it obvious which units are being used
for angle values.
Change-Id: I1dc22494ca42c4677a63f685d5903f2b89886dc2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104548
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source/gdi/hatch.cxx')
-rw-r--r-- | vcl/source/gdi/hatch.cxx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/vcl/source/gdi/hatch.cxx b/vcl/source/gdi/hatch.cxx index 5d139b0a079e..353b8cbd01dd 100644 --- a/vcl/source/gdi/hatch.cxx +++ b/vcl/source/gdi/hatch.cxx @@ -43,7 +43,7 @@ Hatch::Hatch() = default; Hatch::Hatch( const Hatch& ) = default; Hatch::Hatch( HatchStyle eStyle, const Color& rColor, - tools::Long nDistance, sal_uInt16 nAngle10 ) : mpImplHatch() + tools::Long nDistance, Degree10 nAngle10 ) : mpImplHatch() { mpImplHatch->maColor = rColor; mpImplHatch->meStyle = eStyle; @@ -71,7 +71,7 @@ void Hatch::SetDistance( tools::Long nDistance ) mpImplHatch->mnDistance = nDistance; } -void Hatch::SetAngle( sal_uInt16 nAngle10 ) +void Hatch::SetAngle( Degree10 nAngle10 ) { mpImplHatch->mnAngle = nAngle10; } @@ -88,8 +88,9 @@ SvStream& ReadHatch( SvStream& rIStm, Hatch& rHatch ) tools::GenericTypeSerializer aSerializer(rIStm); aSerializer.readColor(rHatch.mpImplHatch->maColor); rIStm.ReadInt32(nTmp32); - rIStm.ReadUInt16(rHatch.mpImplHatch->mnAngle); rHatch.mpImplHatch->mnDistance = nTmp32; + rIStm.ReadUInt16(nTmp16); + rHatch.mpImplHatch->mnAngle = Degree10(nTmp16); return rIStm; } @@ -102,7 +103,7 @@ SvStream& WriteHatch( SvStream& rOStm, const Hatch& rHatch ) tools::GenericTypeSerializer aSerializer(rOStm); aSerializer.writeColor(rHatch.mpImplHatch->maColor); - rOStm.WriteInt32( rHatch.mpImplHatch->mnDistance ).WriteUInt16( rHatch.mpImplHatch->mnAngle ); + rOStm.WriteInt32( rHatch.mpImplHatch->mnDistance ).WriteUInt16( rHatch.mpImplHatch->mnAngle.get() ); return rOStm; } |