diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-11-19 20:04:22 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-11-19 19:33:53 +0100 |
commit | 7ff2c9cfc5fa8c261b1f7f959172f60255fcf617 (patch) | |
tree | 97f31f71314f88e81c99a66d205b951f3ddf2d47 /oox | |
parent | f8790b1d586b3865cfdc56e8f4cdab55a8617769 (diff) |
Use more basegfx::deg2rad<N> and basegfx::rad2deg<N>
Change-Id: I9dc57628b98f67994d546f6887e96389be1efe62
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125568
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/drawingml/shape.cxx | 4 | ||||
-rw-r--r-- | oox/source/export/chartexport.cxx | 2 | ||||
-rw-r--r-- | oox/source/export/drawingml.cxx | 2 | ||||
-rw-r--r-- | oox/source/export/shapes.cxx | 4 |
4 files changed, 6 insertions, 6 deletions
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index 1f1d430e241d..9aed4d3588d0 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -661,7 +661,7 @@ void lcl_RotateAtCenter(basegfx::B2DHomMatrix& aTransformation,sal_Int32 nMSORot { if (nMSORotationAngle == 0) return; - double fRad = basegfx::deg2rad(nMSORotationAngle / 60000.0); + double fRad = basegfx::deg2rad<60000>(nMSORotationAngle); basegfx::B2DPoint aCenter(0.5, 0.5); aCenter *= aTransformation; aTransformation.translate(-aCenter); @@ -771,7 +771,7 @@ Reference< XShape > const & Shape::createAndInsert( if (bUseRotationTransform && mnDiagramRotation != 0) { aTransformation.translate(-0.5, -0.5); - aTransformation.rotate(basegfx::deg2rad(mnDiagramRotation / 60000.0)); + aTransformation.rotate(basegfx::deg2rad<60000>(mnDiagramRotation)); aTransformation.translate(0.5, 0.5); } diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index 4b88f6959460..491211bd1999 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -1519,7 +1519,7 @@ void ChartExport::exportTitle( const Reference< XShape >& xShape, const OUString awt::Size aSize = xShape->getSize(); awt::Point aPos2 = xShape->getPosition(); // rotated shapes need special handling... - double fSin = fabs(sin(basegfx::deg2rad(nRotation*0.01))); + double fSin = fabs(sin(basegfx::deg2rad<100>(nRotation))); // remove part of height from X direction, if title is rotated down if( nRotation*0.01 > 180.0 ) aPos2.X -= static_cast<sal_Int32>(fSin * aSize.Height + 0.5); diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index dfb30c2f484b..dd112c9b6643 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -4389,7 +4389,7 @@ static sal_Int32 lcl_CalculateDist(const double dX, const double dY) static sal_Int32 lcl_CalculateDir(const double dX, const double dY) { - return (static_cast< sal_Int32 >(basegfx::rad2deg(atan2(dY,dX)) * 60000) + 21600000) % 21600000; + return (static_cast< sal_Int32 >(basegfx::rad2deg<60000>(atan2(dY,dX))) + 21600000) % 21600000; } void DrawingML::WriteShapeEffects( const Reference< XPropertySet >& rXPropSet ) diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index 776f8df83472..35b7a4bd4c9d 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -689,9 +689,9 @@ static sal_Int32 lcl_CircleAngle2CustomShapeEllipseAngleOOX(const sal_Int32 nInt { if (nWidth != 0 || nHeight != 0) { - double fAngle = basegfx::deg2rad(nInternAngle / 100.0); // intern 1/100 deg to degree to rad + double fAngle = basegfx::deg2rad<100>(nInternAngle); // intern 1/100 deg to rad fAngle = atan2(nHeight * sin(fAngle), nWidth * cos(fAngle)); // circle to ellipse - fAngle = basegfx::rad2deg(fAngle) * 60000.0; // rad to degree to OOXML angle unit + fAngle = basegfx::rad2deg<60000>(fAngle); // rad to OOXML angle unit sal_Int32 nAngle = basegfx::fround(fAngle); // normalize nAngle = nAngle % 21600000; return nAngle < 0 ? (nAngle + 21600000) : nAngle; |