summaryrefslogtreecommitdiffstats
path: root/lotuswordpro
diff options
context:
space:
mode:
authorHossein <hossein@libreoffice.org>2021-11-11 00:00:38 +0100
committerMike Kaganski <mike.kaganski@collabora.com>2021-11-14 08:14:15 +0100
commit35c85effecb5a615a361c1b7d92d08447bc83423 (patch)
tree360d042d2499acdc2e2b7fb3017f3d2db0829b92 /lotuswordpro
parentSwNavigator: Fix expanded Headings/Outlines not staying expanded (diff)
downloadcore-35c85effecb5a615a361c1b7d92d08447bc83423.tar.gz
core-35c85effecb5a615a361c1b7d92d08447bc83423.zip
Use M_PI instead of defined value; use rad2deg()
* Replace defined values of PI with M_PI defined in <cmath> * Use M_PI_2 instead of PI / 2.0 * Instances could be found with: git grep 3.14 *.cxx *.hxx|grep define * One instance is ignored: sc/source/core/opencl/opinlinefun_statistical.cxx * Replace *(180 / PI) with basegfx::rad2deg() * Replace 2*PI/360 with basegfx::deg2rad() * Use atan2 instead of atan where it was more appropriate + atan2() handles all 4 quadrants + Extra conditions for different quadrants are removed Change-Id: I083ee2e1427cd36ba0b8c38e4fe5f782d6486075 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124229 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'lotuswordpro')
-rw-r--r--lotuswordpro/inc/xfilter/xfdrawobj.hxx3
-rw-r--r--lotuswordpro/inc/xfilter/xfglobal.hxx2
-rw-r--r--lotuswordpro/source/filter/lwpdrawobj.cxx3
3 files changed, 5 insertions, 3 deletions
diff --git a/lotuswordpro/inc/xfilter/xfdrawobj.hxx b/lotuswordpro/inc/xfilter/xfdrawobj.hxx
index c18058adedad..66464fa1f86d 100644
--- a/lotuswordpro/inc/xfilter/xfdrawobj.hxx
+++ b/lotuswordpro/inc/xfilter/xfdrawobj.hxx
@@ -62,6 +62,7 @@
#include <xfilter/xfglobal.hxx>
#include <xfilter/xfframe.hxx>
+#include <basegfx/numeric/ftools.hxx>
#define XFDRAWOBJECT_FLAG_ROTATE 0X00000001
#define XFDRAWOBJECT_FLAG_TRANSLATE 0X00000002
@@ -89,7 +90,7 @@ public:
void SetRotate(double degree)
{
m_nDrawFlag |= XFDRAWOBJECT_FLAG_ROTATE;
- m_fRotate = degree*2*PI/360;
+ m_fRotate = basegfx::deg2rad(degree);
m_aRotatePoint = XFPoint(0,0);
}
diff --git a/lotuswordpro/inc/xfilter/xfglobal.hxx b/lotuswordpro/inc/xfilter/xfglobal.hxx
index 247ae9dd5836..60f1a798c588 100644
--- a/lotuswordpro/inc/xfilter/xfglobal.hxx
+++ b/lotuswordpro/inc/xfilter/xfglobal.hxx
@@ -62,8 +62,8 @@
#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFGLOBAL_HXX
#include <rtl/ustring.hxx>
+#include <cmath>
-#define PI 3.1415926
#define FLOAT_MIN 0.001
#define MAX2(a, b) (((a) > (b)) ? (a) : (b))
#define MAX3(a, b, c) MAX2(a, MAX2(b, c))
diff --git a/lotuswordpro/source/filter/lwpdrawobj.cxx b/lotuswordpro/source/filter/lwpdrawobj.cxx
index 547017a68555..5245bfd93ddc 100644
--- a/lotuswordpro/source/filter/lwpdrawobj.cxx
+++ b/lotuswordpro/source/filter/lwpdrawobj.cxx
@@ -63,6 +63,7 @@
#include "lwpdrawobj.hxx"
#include <lwptools.hxx>
#include <tools/stream.hxx>
+#include <basegfx/numeric/ftools.hxx>
#include <xfilter/xfframe.hxx>
@@ -796,7 +797,7 @@ XFFrame* LwpDrawRectangle::CreateStandardDrawObj(const OUString& rStyleName)
if (aSdwRect.IsRectRotated())
{
- pRect->SetRotate( fRotAngle / PI * 180);// aXFCenter);
+ pRect->SetRotate( basegfx::rad2deg(fRotAngle) );// aXFCenter);
}
pRect->SetStyleName(rStyleName);