From 37429f2690a96491ad0e4fa2a04f2fa88a66da87 Mon Sep 17 00:00:00 2001
From: Mike Kaganski <mike.kaganski@collabora.com>
Date: Thu, 18 Nov 2021 17:43:46 +0300
Subject: Use M_PI* instead of F_PI*

Change-Id: Ie2b7a1c74fc516781a17a20157b8217bc41e383d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125504
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
---
 .../controller/main/DragMethod_RotateDiagram.cxx   |   4 +-
 chart2/source/tools/ThreeDHelper.cxx               | 132 ++++++++++-----------
 chart2/source/view/axes/Tickmarks.cxx              |   4 +-
 chart2/source/view/charttypes/BubbleChart.cxx      |   4 +-
 chart2/source/view/main/LabelPositionHelper.cxx    |  40 +++----
 chart2/source/view/main/ShapeFactory.cxx           |   8 +-
 chart2/source/view/main/VTitle.cxx                 |   2 +-
 7 files changed, 97 insertions(+), 97 deletions(-)

(limited to 'chart2')

diff --git a/chart2/source/controller/main/DragMethod_RotateDiagram.cxx b/chart2/source/controller/main/DragMethod_RotateDiagram.cxx
index 7a9dbe91a476..b8a0b7d13fb5 100644
--- a/chart2/source/controller/main/DragMethod_RotateDiagram.cxx
+++ b/chart2/source/controller/main/DragMethod_RotateDiagram.cxx
@@ -114,9 +114,9 @@ void DragMethod_RotateDiagram::MoveSdrDrag(const Point& rPnt)
     Hide();
 
     //calculate new angle
-    double fX = F_PI2 * static_cast<double>(rPnt.Y() - m_aStartPos.Y())
+    double fX = M_PI_2 * static_cast<double>(rPnt.Y() - m_aStartPos.Y())
         / (m_aReferenceRect.GetHeight() > 0 ? static_cast<double>(m_aReferenceRect.GetHeight()) : 1.0);
-    double fY = F_PI * static_cast<double>(rPnt.X() - m_aStartPos.X())
+    double fY = M_PI * static_cast<double>(rPnt.X() - m_aStartPos.X())
         / (m_aReferenceRect.GetWidth() > 0 ? static_cast<double>(m_aReferenceRect.GetWidth()) : 1.0);
 
     if( m_eRotationDirection != ROTATIONDIRECTION_Y )
diff --git a/chart2/source/tools/ThreeDHelper.cxx b/chart2/source/tools/ThreeDHelper.cxx
index 8c48d359c7b4..0903459606bb 100644
--- a/chart2/source/tools/ThreeDHelper.cxx
+++ b/chart2/source/tools/ThreeDHelper.cxx
@@ -365,10 +365,10 @@ namespace
 double lcl_shiftAngleToIntervalMinusPiToPi( double fAngleRad )
 {
     //valid range:  ]-Pi,Pi]
-    while( fAngleRad<=-F_PI )
-        fAngleRad+=(2*F_PI);
-    while( fAngleRad>F_PI )
-        fAngleRad-=(2*F_PI);
+    while( fAngleRad<=-M_PI )
+        fAngleRad+=(2*M_PI);
+    while( fAngleRad>M_PI )
+        fAngleRad-=(2*M_PI);
     return fAngleRad;
 }
 
@@ -417,25 +417,25 @@ void ThreeDHelper::convertElevationRotationDegToXYZAngleRad(
         //element 23
         double f23 = cos(R)*sin(E);
         if(f23>0)
-            x = F_PI2;
+            x = M_PI_2;
         else
-            x = -F_PI2;
+            x = -M_PI_2;
         y = R;
     }
     else if( ( nRotationDeg == 90 || nRotationDeg == 270 )
         && ( nElevationDeg == 90 || nElevationDeg == 270 ) )
     {
         //cR==0 && cE==0
-        z = F_PI2;
+        z = M_PI_2;
         if( sin(R)>0 )
-            x = F_PI2;
+            x = M_PI_2;
         else
-            x = -F_PI2;
+            x = -M_PI_2;
 
         if( (sin(R)*sin(E))>0 )
             y = 0.0;
         else
-            y = F_PI;
+            y = M_PI;
     }
     else if( (nRotationDeg == 0 || nRotationDeg == 180 )
         && ( nElevationDeg == 0 || nElevationDeg == 180 ) )
@@ -452,14 +452,14 @@ void ThreeDHelper::convertElevationRotationDegToXYZAngleRad(
         z = 0.0;
 
         if( (sin(R)/cos(E))>0 )
-            y = F_PI2;
+            y = M_PI_2;
         else
-            y = -F_PI2;
+            y = -M_PI_2;
 
         if( (cos(E))>0 )
             x = 0;
         else
-            x = F_PI;
+            x = M_PI;
     }
     else if ( nElevationDeg == 0 || nElevationDeg == 180 )
     {
@@ -474,19 +474,19 @@ void ThreeDHelper::convertElevationRotationDegToXYZAngleRad(
     else if ( nElevationDeg == 90 || nElevationDeg == 270 )
     {
         //sR!=0 cR!=0 cE==0
-        //element 12 + 22 --> y=0 or F_PI and x=+-F_PI/2
+        //element 12 + 22 --> y=0 or M_PI and x=+-M_PI/2
         //-->element 13/23:
         z = atan(sin(R)/(cos(R)*sin(E)));
         //use element 13 for sign for x
         if( (sin(R)*sin(z))>0.0 )
-            x = F_PI2;
+            x = M_PI_2;
         else
-            x = -F_PI2;
+            x = -M_PI_2;
         //use element 21 for y
         if( (sin(R)*sin(E)*sin(z))>0.0)
             y = 0.0;
         else
-            y = F_PI;
+            y = M_PI;
     }
     else if ( nRotationDeg == 0 || nRotationDeg == 180 )
     {
@@ -501,10 +501,10 @@ void ThreeDHelper::convertElevationRotationDegToXYZAngleRad(
     else if (nRotationDeg == 90 || nRotationDeg == 270)
     {
         //sE!=0 cE!=0 cR==0
-        //z = +- F_PI/2;
-        //x = +- F_PI/2;
-        z = F_PI2;
-        x = F_PI2;
+        //z = +- M_PI/2;
+        //x = +- M_PI/2;
+        z = M_PI_2;
+        x = M_PI_2;
         double sR = sin(R);
         if( sR<0.0 )
             x *= -1.0; //different signs for x and z
@@ -555,7 +555,7 @@ void ThreeDHelper::convertElevationRotationDegToXYZAngleRad(
             if( (f22a*f22b)<0.0 )
             {
                 y *= -1;
-                x=(F_PI-x);
+                x=(M_PI-x);
             }
         }
         else
@@ -567,7 +567,7 @@ void ThreeDHelper::convertElevationRotationDegToXYZAngleRad(
             if( (f22a*f22b)<0.0 )
             {
                 y *= -1;
-                x=(F_PI-x);
+                x=(M_PI-x);
             }
         }
     }
@@ -607,14 +607,14 @@ void ThreeDHelper::convertXYZAngleRadToElevationRotationDeg(
                 if( f11 > 0 )
                     R = 0.0;
                 else
-                    R = F_PI;
+                    R = M_PI;
 
                 //element 23
                 double f23 = cos(z)*sin(x) / cos(R);
                 if( f23 > 0 )
-                    E = F_PI2;
+                    E = M_PI_2;
                 else
-                    E = -F_PI2;
+                    E = -M_PI_2;
             }
             else if( lcl_isCosZero(z) )
             {
@@ -624,16 +624,16 @@ void ThreeDHelper::convertXYZAngleRadToElevationRotationDeg(
                 double f13 = sin(x)*sin(z);
                 //element 13+11
                 if( f13 > 0 )
-                    R = F_PI2;
+                    R = M_PI_2;
                 else
-                    R = -F_PI2;
+                    R = -M_PI_2;
 
                 //element 21
                 double f21 = cos(y)*sin(z) / sin(R);
                 if( f21 > 0 )
-                    E = F_PI2;
+                    E = M_PI_2;
                 else
-                    E = -F_PI2;
+                    E = -M_PI_2;
             }
             else
             {
@@ -643,14 +643,14 @@ void ThreeDHelper::convertXYZAngleRadToElevationRotationDeg(
                 R = atan( f13/f11 );
 
                 if(f11<0)
-                    R+=F_PI;
+                    R+=M_PI;
 
                 //element 23
                 double f23 = cos(z)*sin(x);
                 if( f23/cos(R) > 0 )
-                    E = F_PI2;
+                    E = M_PI_2;
                 else
-                    E = -F_PI2;
+                    E = -M_PI_2;
             }
         }
         else if( lcl_isSinZero(x) )
@@ -660,13 +660,13 @@ void ThreeDHelper::convertXYZAngleRadToElevationRotationDeg(
             if( f11 > 0 )
                 R = 0.0;
             else
-                R = F_PI;
+                R = M_PI;
 
             double f22 = cos(x)*cos(z);
             if( f22 > 0 )
                 E = 0.0;
             else
-                E = F_PI;
+                E = M_PI;
         }
         else if( lcl_isSinZero(z) )
         {
@@ -675,14 +675,14 @@ void ThreeDHelper::convertXYZAngleRadToElevationRotationDeg(
             if( f11 > 0 )
                 R = 0.0;
             else
-                R = F_PI;
+                R = M_PI;
 
             //element 22 && 23
             double f22 = cos(x)*cos(z);
             double f23 = cos(z)*sin(x);
             E = atan( f23/(f22*cos(R)) );
             if( (f22*cos(E))<0 )
-                E+=F_PI;
+                E+=M_PI;
         }
         else if( lcl_isCosZero(z) )
         {
@@ -690,16 +690,16 @@ void ThreeDHelper::convertXYZAngleRadToElevationRotationDeg(
             double f13 = sin(x)*sin(z);
             //element 13+11
             if( f13 > 0 )
-                R = F_PI2;
+                R = M_PI_2;
             else
-                R = -F_PI2;
+                R = -M_PI_2;
 
             //element 21+22
             double f21 = cos(y)*sin(z);
             if( f21/sin(R) > 0 )
-                E = F_PI2;
+                E = M_PI_2;
             else
-                E = -F_PI2;
+                E = -M_PI_2;
         }
         else
         {
@@ -707,7 +707,7 @@ void ThreeDHelper::convertXYZAngleRadToElevationRotationDeg(
             double f13 = sin(x)*sin(z);
             R = atan( f13/f11 );
             if( (f11*cos(R))<0.0 )
-                R+=F_PI;
+                R+=M_PI;
 
             double f22 = cos(x)*cos(z);
             if( !lcl_isCosZero(R) )
@@ -715,7 +715,7 @@ void ThreeDHelper::convertXYZAngleRadToElevationRotationDeg(
             else
                 E = atan( cos(y)*sin(z) /( f22*sin(R) ) );
             if( (f22*cos(E))<0 )
-                E+=F_PI;
+                E+=M_PI;
         }
     }
     else if( lcl_isCosZero(y) )
@@ -724,15 +724,15 @@ void ThreeDHelper::convertXYZAngleRadToElevationRotationDeg(
 
         double f13 = sin(x)*sin(z)+cos(x)*cos(z)*sin(y);
         if( f13 >= 0 )
-            R = F_PI2;
+            R = M_PI_2;
         else
-            R = -F_PI2;
+            R = -M_PI_2;
 
         double f22 = cos(x)*cos(z)+sin(x)*sin(y)*sin(z);
         if( f22 >= 0 )
             E = 0.0;
         else
-            E = F_PI;
+            E = M_PI;
     }
     else if( lcl_isSinZero(x) )
     {
@@ -744,13 +744,13 @@ void ThreeDHelper::convertXYZAngleRadToElevationRotationDeg(
             R = atan( f13/f11 );
             //R = asin(f13);
             if( f11<0 )
-                R+=F_PI;
+                R+=M_PI;
 
             double f22 = cos(x)*cos(z);
             if( f22>0 )
                 E = 0.0;
             else
-                E = F_PI;
+                E = M_PI;
         }
         else if( lcl_isCosZero(z) )
         {
@@ -772,14 +772,14 @@ void ThreeDHelper::convertXYZAngleRadToElevationRotationDeg(
             R = atan( f13/f11 );
 
             if( f11<0 )
-                R+=F_PI;
+                R+=M_PI;
 
             double f21 = cos(y)*sin(z);
             double f22 = cos(x)*cos(z);
             E = atan(f21/(f22*sin(R)) );
 
             if( (f22*cos(E))<0.0 )
-                E+=F_PI;
+                E+=M_PI;
         }
     }
     else if( lcl_isCosZero(x) )
@@ -789,23 +789,23 @@ void ThreeDHelper::convertXYZAngleRadToElevationRotationDeg(
         if( lcl_isSinZero(z) )
         {
             //cosY!=0 sinY!=0 cosX=0 sinZ=0
-            R=0;//13 -> R=0 or F_PI
+            R=0;//13 -> R=0 or M_PI
             if( f11<0.0 )
-                R=F_PI;
-            E=F_PI2;//22 -> E=+-F_PI/2
+                R=M_PI;
+            E=M_PI_2;//22 -> E=+-M_PI/2
             //use element 11 and 23 for sign
             double f23 = cos(z)*sin(x);
             if( (f11*f23*sin(E))<0.0 )
-                E=-F_PI2;
+                E=-M_PI_2;
         }
         else if( lcl_isCosZero(z) )
         {
             //cosY!=0 sinY!=0 cosX=0 cosZ=0
             //element 11 & 13:
             if( (sin(x)*sin(z))>0.0 )
-                R=F_PI2;
+                R=M_PI_2;
             else
-                R=-F_PI2;
+                R=-M_PI_2;
             //element 22:
             E=acos( sin(x)*sin(y)*sin(z));
             //use element 21 for sign:
@@ -819,7 +819,7 @@ void ThreeDHelper::convertXYZAngleRadToElevationRotationDeg(
             R = atan( sin(x)*sin(z)/(cos(y)*cos(z)) );
             //use 13 for 'sign'
             if( (sin(x)*sin(z))<0.0 )
-                R += F_PI;
+                R += M_PI;
             //element 22
             E = acos(sin(x)*sin(y)*sin(z) );
             //use 21 for sign
@@ -848,12 +848,12 @@ void ThreeDHelper::convertXYZAngleRadToElevationRotationDeg(
         R=atan(-cos(y)/(cos(x)*sin(y)));
         //use element 13 for 'sign'
         if( (sin(x)*sin(z)*sin(R))<0.0 )
-            R+=F_PI;
+            R+=M_PI;
         //element 21/22
         E=atan( cos(y)*sin(z)/(sin(R)*sin(x)*sin(y)*sin(z)) );
         //use element 23 for 'sign'
         if( (-cos(x)*sin(y)*sin(z)*cos(R)*sin(E))<0.0 )
-            E+=F_PI;
+            E+=M_PI;
     }
     else
     {
@@ -862,13 +862,13 @@ void ThreeDHelper::convertXYZAngleRadToElevationRotationDeg(
         double f13 = sin(x)*sin(z)+cos(x)*cos(z)*sin(y);
         R = atan( f13/ f11 );
         if(f11<0.0)
-            R+=F_PI;
+            R+=M_PI;
         double f22 = cos(x)*cos(z)+sin(x)*sin(y)*sin(z);
         double f23 = cos(x)*sin(y)*sin(z)-cos(z)*sin(x);
         //23/22:
         E = atan( -1.0*f23/(f22*cos(R)) );
         if(f22<0.0)
-            E+=F_PI;
+            E+=M_PI;
     }
 
     rnElevationDeg = basegfx::fround(basegfx::rad2deg(E));
@@ -922,11 +922,11 @@ void ThreeDHelper::getRotationAngleFromDiagram(
     rfYAngleRad = lcl_shiftAngleToIntervalMinusPiToPi(aRotation.getY());
     rfZAngleRad = lcl_shiftAngleToIntervalMinusPiToPi(aRotation.getZ());
 
-    if(rfZAngleRad<-F_PI2 || rfZAngleRad>F_PI2)
+    if(rfZAngleRad<-M_PI_2 || rfZAngleRad>M_PI_2)
     {
-        rfZAngleRad-=F_PI;
-        rfXAngleRad-=F_PI;
-        rfYAngleRad=(F_PI-rfYAngleRad);
+        rfZAngleRad-=M_PI;
+        rfXAngleRad-=M_PI;
+        rfYAngleRad=(M_PI-rfYAngleRad);
 
         rfXAngleRad = lcl_shiftAngleToIntervalMinusPiToPi(rfXAngleRad);
         rfYAngleRad = lcl_shiftAngleToIntervalMinusPiToPi(rfYAngleRad);
@@ -1247,7 +1247,7 @@ void ThreeDHelper::setDefaultRotation( const uno::Reference< beans::XPropertySet
 
     ::basegfx::B3DHomMatrix aSceneRotation;
     if( bPieOrDonut )
-        aSceneRotation.rotate( -F_PI/3.0, 0, 0 );
+        aSceneRotation.rotate( -M_PI/3.0, 0, 0 );
     xSceneProperties->setPropertyValue( "D3DTransformMatrix",
         uno::Any( BaseGFXHelper::B3DHomMatrixToHomogenMatrix( aSceneRotation )));
 }
diff --git a/chart2/source/view/axes/Tickmarks.cxx b/chart2/source/view/axes/Tickmarks.cxx
index ba4ad8073eb0..d10583c1b77d 100644
--- a/chart2/source/view/axes/Tickmarks.cxx
+++ b/chart2/source/view/axes/Tickmarks.cxx
@@ -175,7 +175,7 @@ bool TickFactory2D::isHorizontalAxis() const
 
     // for skew axes compare angle with horizontal vector
     double fInclination = std::abs(B2DVector(m_aAxisEndScreenPosition2D-m_aAxisStartScreenPosition2D).angle(B2DVector(1.0, 0.0)));
-    return fInclination < F_PI4 || fInclination > (F_PI-F_PI4);
+    return fInclination < M_PI_4 || fInclination > (M_PI-M_PI_4);
 }
 bool TickFactory2D::isVerticalAxis() const
 {
@@ -187,7 +187,7 @@ bool TickFactory2D::isVerticalAxis() const
 
     // for skew axes compare angle with vertical vector
     double fInclination = std::abs(B2DVector(m_aAxisEndScreenPosition2D-m_aAxisStartScreenPosition2D).angle(B2DVector(0.0, -1.0)));
-    return fInclination < F_PI4 || fInclination > (F_PI-F_PI4);
+    return fInclination < M_PI_4 || fInclination > (M_PI-M_PI_4);
 }
 //static
 sal_Int32 TickFactory2D::getTickScreenDistance( TickIter& rIter )
diff --git a/chart2/source/view/charttypes/BubbleChart.cxx b/chart2/source/view/charttypes/BubbleChart.cxx
index d5141be5cb58..aa1431516c54 100644
--- a/chart2/source/view/charttypes/BubbleChart.cxx
+++ b/chart2/source/view/charttypes/BubbleChart.cxx
@@ -107,8 +107,8 @@ drawing::Direction3D BubbleChart::transformToScreenBubbleSize( double fLogicSize
 
     double fMaxSize = m_fMaxLogicBubbleSize;
 
-    double fMaxRadius = sqrt( fMaxSize / F_PI );
-    double fRadius = sqrt( fLogicSize / F_PI );
+    double fMaxRadius = sqrt( fMaxSize / M_PI );
+    double fRadius = sqrt( fLogicSize / M_PI );
 
     aRet.DirectionX = m_fBubbleSizeFactorToScreen * fRadius / fMaxRadius;
     aRet.DirectionY = aRet.DirectionX;
diff --git a/chart2/source/view/main/LabelPositionHelper.cxx b/chart2/source/view/main/LabelPositionHelper.cxx
index 798c6562e1f6..8f36943ade7a 100644
--- a/chart2/source/view/main/LabelPositionHelper.cxx
+++ b/chart2/source/view/main/LabelPositionHelper.cxx
@@ -130,7 +130,7 @@ void lcl_correctRotation_Left( double& rfXCorrection, double& rfYCorrection
     }
     else if( fAnglePositiveDegree<= 180.0 )
     {
-        double beta = fAnglePi-F_PI2;
+        double beta = fAnglePi-M_PI_2;
         rfXCorrection = -aSize.Width *std::sin( beta )
             -aSize.Height *std::cos( beta )/2.0;
         if( bRotateAroundCenter )
@@ -140,7 +140,7 @@ void lcl_correctRotation_Left( double& rfXCorrection, double& rfYCorrection
     }
     else if( fAnglePositiveDegree<= 270.0 )
     {
-        double beta = fAnglePi - F_PI;
+        double beta = fAnglePi - M_PI;
         rfXCorrection = -aSize.Width *std::cos( beta )
             -aSize.Height*std::sin( beta )/2.0;
         if( bRotateAroundCenter )
@@ -150,7 +150,7 @@ void lcl_correctRotation_Left( double& rfXCorrection, double& rfYCorrection
     }
     else
     {
-        double beta = 2*F_PI - fAnglePi;
+        double beta = 2*M_PI - fAnglePi;
         rfXCorrection = -aSize.Height*std::sin( beta )/2.0;
         if( bRotateAroundCenter )
             rfYCorrection = aSize.Width*std::sin( beta )/2.0;
@@ -173,7 +173,7 @@ void lcl_correctRotation_Right( double& rfXCorrection, double& rfYCorrection
     }
     else if( fAnglePositiveDegree<= 180.0 )
     {
-        double beta = F_PI - fAnglePi;
+        double beta = M_PI - fAnglePi;
         rfXCorrection = aSize.Width *std::cos( beta )
             + aSize.Height*std::sin( beta )/2.0;
         if( bRotateAroundCenter )
@@ -183,7 +183,7 @@ void lcl_correctRotation_Right( double& rfXCorrection, double& rfYCorrection
     }
     else if( fAnglePositiveDegree<= 270.0 )
     {
-        double beta = 3*F_PI2 - fAnglePi;
+        double beta = 3*M_PI_2 - fAnglePi;
         rfXCorrection = aSize.Width *std::sin( beta )
                     +aSize.Height*std::cos( beta )/2.0;
         if( bRotateAroundCenter )
@@ -193,9 +193,9 @@ void lcl_correctRotation_Right( double& rfXCorrection, double& rfYCorrection
     }
     else
     {
-        rfXCorrection  = aSize.Height*std::sin( 2*F_PI - fAnglePi )/2.0;
+        rfXCorrection  = aSize.Height*std::sin( 2*M_PI - fAnglePi )/2.0;
         if( bRotateAroundCenter )
-            rfYCorrection = -aSize.Width*std::sin( 2*F_PI - fAnglePi )/2.0;
+            rfYCorrection = -aSize.Width*std::sin( 2*M_PI - fAnglePi )/2.0;
     }
 }
 
@@ -216,7 +216,7 @@ void lcl_correctRotation_Top( double& rfXCorrection, double& rfYCorrection
     }
     else if( fAnglePositiveDegree<= 180.0 )
     {
-        double beta = fAnglePi - F_PI2;
+        double beta = fAnglePi - M_PI_2;
         rfXCorrection = aSize.Height*std::cos( beta )/2.0;
         if( !bRotateAroundCenter )
             rfXCorrection -= aSize.Width*std::sin( beta )/2.0;
@@ -225,7 +225,7 @@ void lcl_correctRotation_Top( double& rfXCorrection, double& rfYCorrection
     }
     else if( fAnglePositiveDegree<= 270.0 )
     {
-        double beta = fAnglePi - F_PI;
+        double beta = fAnglePi - M_PI;
         rfXCorrection = -aSize.Height *std::sin( beta )/2.0;
         if( !bRotateAroundCenter )
             rfXCorrection += aSize.Width *std::cos( beta )/2.0;
@@ -258,7 +258,7 @@ void lcl_correctRotation_Bottom( double& rfXCorrection, double& rfYCorrection
     }
     else if( fAnglePositiveDegree<= 180.0 )
     {
-        double beta = fAnglePi-F_PI2;
+        double beta = fAnglePi-M_PI_2;
         rfXCorrection = -aSize.Height*std::cos( beta )/2.0;
         if( !bRotateAroundCenter )
             rfXCorrection += aSize.Width *std::sin( beta )/2.0;
@@ -267,7 +267,7 @@ void lcl_correctRotation_Bottom( double& rfXCorrection, double& rfYCorrection
     }
     else if( fAnglePositiveDegree<= 270.0 )
     {
-        double beta = 3*F_PI2 - fAnglePi;
+        double beta = 3*M_PI_2 - fAnglePi;
         rfXCorrection = aSize.Height*std::cos( beta )/2.0;
         if( !bRotateAroundCenter )
             rfXCorrection -= aSize.Width *std::sin( beta )/2.0;
@@ -276,7 +276,7 @@ void lcl_correctRotation_Bottom( double& rfXCorrection, double& rfYCorrection
     }
     else
     {
-        double beta = 2*F_PI - fAnglePi;
+        double beta = 2*M_PI - fAnglePi;
         rfXCorrection = aSize.Height*std::sin( beta )/2.0;
         if( !bRotateAroundCenter )
             rfXCorrection += aSize.Width*std::cos( beta )/2.0;
@@ -298,14 +298,14 @@ void lcl_correctRotation_Left_Top( double& rfXCorrection, double& rfYCorrection
     }
     else if( fAnglePositiveDegree<= 180.0 )
     {
-        double beta = fAnglePi-F_PI2;
+        double beta = fAnglePi-M_PI_2;
         rfXCorrection = -aSize.Width*std::sin( beta );
         rfYCorrection = -aSize.Height*std::sin( beta )
                         -aSize.Width*std::cos( beta );
     }
     else if( fAnglePositiveDegree<= 270.0 )
     {
-        double beta = 3*F_PI2 - fAnglePi;
+        double beta = 3*M_PI_2 - fAnglePi;
         rfXCorrection = -aSize.Height*std::cos( beta )
                         -aSize.Width*std::sin( beta );
         rfYCorrection = -aSize.Height*std::sin( beta );
@@ -330,14 +330,14 @@ void lcl_correctRotation_Left_Bottom( double& rfXCorrection, double& rfYCorrecti
     }
     else if( fAnglePositiveDegree<= 180.0 )
     {
-        double beta = fAnglePi-F_PI2;
+        double beta = fAnglePi-M_PI_2;
         rfXCorrection = -aSize.Width*std::sin( beta )
                         -aSize.Height*std::cos( beta );
         rfYCorrection = aSize.Height*std::sin( beta );
     }
     else if( fAnglePositiveDegree<= 270.0 )
     {
-        double beta = 3*F_PI2 - fAnglePi;
+        double beta = 3*M_PI_2 - fAnglePi;
         rfXCorrection = -aSize.Width*std::sin( beta );
         rfYCorrection = aSize.Width*std::cos( beta )
                         +aSize.Height*std::sin( beta );
@@ -362,14 +362,14 @@ void lcl_correctRotation_Right_Top( double& rfXCorrection, double& rfYCorrection
     }
     else if( fAnglePositiveDegree<= 180.0 )
     {
-        double beta = fAnglePi-F_PI2;
+        double beta = fAnglePi-M_PI_2;
         rfXCorrection = aSize.Width*std::sin( beta )
                         +aSize.Height*std::cos( beta );
         rfYCorrection = -aSize.Height*std::sin( beta );
     }
     else if( fAnglePositiveDegree<= 270.0 )
     {
-        double beta = 3*F_PI2 - fAnglePi;
+        double beta = 3*M_PI_2 - fAnglePi;
         rfXCorrection = aSize.Width*std::sin( beta );
         rfYCorrection = -aSize.Width*std::cos( beta )
                         -aSize.Height*std::sin( beta );
@@ -394,14 +394,14 @@ void lcl_correctRotation_Right_Bottom( double& rfXCorrection, double& rfYCorrect
     }
     else if( fAnglePositiveDegree<= 180.0 )
     {
-        double beta = fAnglePi-F_PI2;
+        double beta = fAnglePi-M_PI_2;
         rfXCorrection = aSize.Width*std::sin( beta );
         rfYCorrection = aSize.Height*std::sin( beta )
                         +aSize.Width*std::cos( beta );
     }
     else if( fAnglePositiveDegree<= 270.0 )
     {
-        double beta = 3*F_PI2 - fAnglePi;
+        double beta = 3*M_PI_2 - fAnglePi;
         rfXCorrection = aSize.Height*std::cos( beta )
                         +aSize.Width*std::sin( beta );
         rfYCorrection = aSize.Height*std::sin( beta );
diff --git a/chart2/source/view/main/ShapeFactory.cxx b/chart2/source/view/main/ShapeFactory.cxx
index 94ada8d02727..fe9bfe783615 100644
--- a/chart2/source/view/main/ShapeFactory.cxx
+++ b/chart2/source/view/main/ShapeFactory.cxx
@@ -426,7 +426,7 @@ uno::Reference<drawing::XShape>
             //Matrix for position
             basegfx::B3DHomMatrix aHomMatrix;
             if (nRotateZAngleHundredthDegree != 0)
-                aHomMatrix.rotate(0.0, 0.0, -nRotateZAngleHundredthDegree / 18000.00 * F_PI);
+                aHomMatrix.rotate(0.0, 0.0, -nRotateZAngleHundredthDegree / 18000.00 * M_PI);
             aHomMatrix.translate(rPosition.PositionX, rPosition.PositionY,
                                  rPosition.PositionZ - (fDepth / 2.0));
 
@@ -669,7 +669,7 @@ uno::Reference<drawing::XShape>
             //Matrix for position
             basegfx::B3DHomMatrix aHomMatrix;
             if (nRotateZAngleHundredthDegree != 0)
-                aHomMatrix.rotate(0.0,0.0,-nRotateZAngleHundredthDegree/18000.00*F_PI);
+                aHomMatrix.rotate(0.0,0.0,-nRotateZAngleHundredthDegree/18000.00*M_PI);
             //stretch the symmetric objects to given depth
             aHomMatrix.scale(1.0,1.0,rSize.DirectionZ/rSize.DirectionX);
             aHomMatrix.translate(rPosition.PositionX, rPosition.PositionY, rPosition.PositionZ);
@@ -895,7 +895,7 @@ uno::Reference< drawing::XShape >
             ::basegfx::B2DHomMatrix aTransformationFromUnitCircle( IgnoreZ( HomogenMatrixToB3DHomMatrix(rUnitCircleToScene) ) );
             aTransformationFromUnitCircle.translate(rOffset.DirectionX,rOffset.DirectionY);
 
-            const double fAngleSubdivisionRadian = F_PI/10.0;
+            const double fAngleSubdivisionRadian = M_PI/10.0;
 
             drawing::PolyPolygonBezierCoords aCoords
                 = getRingBezierCoords(fUnitCircleInnerRadius, fUnitCircleOuterRadius,
@@ -948,7 +948,7 @@ uno::Reference< drawing::XShape >
             ::basegfx::B2DHomMatrix aTransformationFromUnitCircle( IgnoreZ( HomogenMatrixToB3DHomMatrix(rUnitCircleToScene) ) );
             aTransformationFromUnitCircle.translate(rOffset.DirectionX,rOffset.DirectionY);
 
-            const double fAngleSubdivisionRadian = F_PI/32.0;
+            const double fAngleSubdivisionRadian = M_PI/32.0;
 
             drawing::PolyPolygonBezierCoords aCoords
                 = getRingBezierCoords(fUnitCircleInnerRadius, fUnitCircleOuterRadius,
diff --git a/chart2/source/view/main/VTitle.cxx b/chart2/source/view/main/VTitle.cxx
index 79d5d7a28256..44c2556ad989 100644
--- a/chart2/source/view/main/VTitle.cxx
+++ b/chart2/source/view/main/VTitle.cxx
@@ -86,7 +86,7 @@ void VTitle::changePosition( const awt::Point& rPos )
         //set position matrix
         //the matrix needs to be set at the end behind autogrow and such position influencing properties
         ::basegfx::B2DHomMatrix aM;
-        aM.rotate( -m_fRotationAngleDegree*F_PI/180.0 );//#i78696#->#i80521#
+        aM.rotate( -m_fRotationAngleDegree*M_PI/180.0 );//#i78696#->#i80521#
         aM.translate( m_nXPos, m_nYPos);
         xShapeProp->setPropertyValue( "Transformation", uno::Any( B2DHomMatrixToHomogenMatrix3(aM) ) );
     }
-- 
cgit