From 0fb58a1ff168ae122e9c8993a3136658e3b0e3f0 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 20 Oct 2020 07:27:44 +0200 Subject: 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 Reviewed-by: Noel Grandin --- canvas/source/cairo/cairo_canvashelper_text.cxx | 2 +- canvas/source/vcl/canvashelper.cxx | 2 +- canvas/source/vcl/canvashelper_texturefill.cxx | 2 +- canvas/source/vcl/impltools.cxx | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'canvas') diff --git a/canvas/source/cairo/cairo_canvashelper_text.cxx b/canvas/source/cairo/cairo_canvashelper_text.cxx index 258ba6a3166f..912e3b678ca8 100644 --- a/canvas/source/cairo/cairo_canvashelper_text.cxx +++ b/canvas/source/cairo/cairo_canvashelper_text.cxx @@ -100,7 +100,7 @@ namespace cairocanvas io_rVCLFont.SetFontHeight( ::basegfx::fround(nFontHeight * aScale.getY()) ); } - io_rVCLFont.SetOrientation( static_cast< short >( ::basegfx::fround(-fmod(nRotate, 2*M_PI)*(1800.0/M_PI)) ) ); + io_rVCLFont.SetOrientation( Degree10(static_cast< sal_Int16 >( ::basegfx::fround(-fmod(nRotate, 2*M_PI)*(1800.0/M_PI)) )) ); // TODO(F2): Missing functionality in VCL: shearing o_rPoint.setX( ::basegfx::fround(aTranslate.getX()) ); diff --git a/canvas/source/vcl/canvashelper.cxx b/canvas/source/vcl/canvashelper.cxx index 0e759d4fbe61..e56a273a1fe1 100644 --- a/canvas/source/vcl/canvashelper.cxx +++ b/canvas/source/vcl/canvashelper.cxx @@ -773,7 +773,7 @@ namespace vclcanvas // (3600,0]. Note that the original angle may have // values outside the [0,2Pi) interval. const double nAngleInTenthOfDegrees (3600.0 - nRotate * 3600.0 / (2*M_PI)); - aGrfAttr.SetRotation( static_cast< sal_uInt16 >(::basegfx::fround(nAngleInTenthOfDegrees)) ); + aGrfAttr.SetRotation( Degree10(::basegfx::fround(nAngleInTenthOfDegrees)) ); pGrfObj = std::make_shared( aBmpEx ); } diff --git a/canvas/source/vcl/canvashelper_texturefill.cxx b/canvas/source/vcl/canvashelper_texturefill.cxx index 9cb8dd8abd99..81d97138b22c 100644 --- a/canvas/source/vcl/canvashelper_texturefill.cxx +++ b/canvas/source/vcl/canvashelper_texturefill.cxx @@ -754,7 +754,7 @@ namespace vclcanvas // (3600,0]. Note that the original angle may have // values outside the [0,2Pi) interval. const double nAngleInTenthOfDegrees (3600.0 - nRotate * 3600.0 / (2*M_PI)); - aGrfAttr.SetRotation( static_cast< sal_uInt16 >(::basegfx::fround(nAngleInTenthOfDegrees)) ); + aGrfAttr.SetRotation( Degree10(::basegfx::fround(nAngleInTenthOfDegrees)) ); pGrfObj = std::make_shared( aBmpEx ); } diff --git a/canvas/source/vcl/impltools.cxx b/canvas/source/vcl/impltools.cxx index a76fefcb40c7..800ad3128342 100644 --- a/canvas/source/vcl/impltools.cxx +++ b/canvas/source/vcl/impltools.cxx @@ -126,7 +126,7 @@ namespace vclcanvas::tools io_rVCLFont.SetFontHeight( ::basegfx::fround(nFontHeight * aScale.getY()) ); } - io_rVCLFont.SetOrientation( static_cast< short >( ::basegfx::fround(-fmod(nRotate, 2*M_PI)*(1800.0/M_PI)) ) ); + io_rVCLFont.SetOrientation( Degree10( ::basegfx::fround(-fmod(nRotate, 2*M_PI)*(1800.0/M_PI)) ) ); // TODO(F2): Missing functionality in VCL: shearing o_rPoint.setX( ::basegfx::fround(aTranslate.getX()) ); -- cgit