From 5f21eaa0e6b689233336cacc949b9a55d545088f Mon Sep 17 00:00:00 2001 From: pragat-pandya Date: Tue, 1 Feb 2022 05:59:42 +0530 Subject: tdf#145759 Using M_PI from cmath instead of magic constants. Replace the instances of Pi's value as magic number by M_PI Use M_PI_2 and 2_M_PI instead of calculating these values in code. Use basegfx functions to convert angle units. Change-Id: I6cca7cc93704a70ccf3a0571a56a789bc9df51ef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129479 Reviewed-by: Arkadiy Illarionov Reviewed-by: Hossein Tested-by: Jenkins --- starmath/source/node.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'starmath') diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx index 5306908cefbe..a13f5deada56 100644 --- a/starmath/source/node.cxx +++ b/starmath/source/node.cxx @@ -22,9 +22,9 @@ #include #include "tmpdevice.hxx" #include - #include #include +#include namespace { @@ -988,8 +988,7 @@ void SmBinDiagonalNode::GetOperPosSize(Point &rPos, Size &rSize, const Point &rDiagPoint, double fAngleDeg) const { - static const double fPi = 3.1415926535897932384626433; - double fAngleRad = fAngleDeg / 180.0 * fPi; + double fAngleRad = basegfx::deg2rad(fAngleDeg); tools::Long nRectLeft = GetItalicLeft(), nRectRight = GetItalicRight(), nRectTop = GetTop(), -- cgit