[Libreoffice-commits] core.git: filter/source include/svx sc/qa svx/source sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Feb 26 09:12:56 UTC 2019


 filter/source/msfilter/msdffimp.cxx               |   12 ++++++------
 filter/source/msfilter/svdfppt.cxx                |    4 ++--
 include/svx/svdtrans.hxx                          |    6 ++----
 sc/qa/unit/ucalc.cxx                              |    4 ++--
 svx/source/customshapes/EnhancedCustomShape3d.cxx |    2 +-
 svx/source/svdraw/svddrgmt.cxx                    |   14 +++++++-------
 svx/source/svdraw/svdedtv1.cxx                    |   14 +++++++-------
 svx/source/svdraw/svdfmtf.cxx                     |    2 +-
 svx/source/svdraw/svdglev.cxx                     |    4 ++--
 svx/source/svdraw/svdobj.cxx                      |   14 +++++++-------
 svx/source/svdraw/svdocirc.cxx                    |    6 +++---
 svx/source/svdraw/svdomeas.cxx                    |    4 ++--
 svx/source/svdraw/svdopath.cxx                    |   15 ++++++++-------
 svx/source/svdraw/svdotext.cxx                    |    2 +-
 svx/source/svdraw/svdpdf.cxx                      |    2 +-
 svx/source/svdraw/svdpoev.cxx                     |    4 ++--
 svx/source/svdraw/svdtrans.cxx                    |    9 +++++----
 svx/source/unodraw/unoshape.cxx                   |    6 +++---
 sw/source/filter/ww8/ww8par.cxx                   |    4 ++--
 19 files changed, 64 insertions(+), 64 deletions(-)

New commits:
commit 3caf379f1c6398548c65bb7a83e3911d9a8bc444
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Tue Feb 26 10:18:39 2019 +0300
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Tue Feb 26 10:12:29 2019 +0100

    svdtrans: nPi -> M_PI; nPi180 -> F_PI18000 to remove duplicates
    
    Change-Id: Ia2c103a5b530d007f750e4a034b253b3ec5406ec
    Reviewed-on: https://gerrit.libreoffice.org/68368
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index df759c529693..acaf29caba0e 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -4133,7 +4133,7 @@ SdrObject* SvxMSDffManager::ImportGroup( const DffRecordHeader& rHd, SvStream& r
 
             if ( nGroupRotateAngle )
             {
-                double a = nGroupRotateAngle * nPi180;
+                double a = nGroupRotateAngle * F_PI18000;
                 pRet->NbcRotate( aClientRect.Center(), nGroupRotateAngle, sin( a ), cos( a ) );
             }
             if ( nSpFlags & ShapeFlag::FlipV )
@@ -4710,7 +4710,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
                     {
                         if( nObjectRotation )
                         {
-                            double a = nObjectRotation * nPi180;
+                            double a = nObjectRotation * F_PI18000;
                             pRet->NbcRotate( aObjData.aBoundRect.Center(), nObjectRotation, sin( a ), cos( a ) );
                         }
                         // mirrored horizontally?
@@ -4749,7 +4749,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
                         // pay attention to the rotations
                         if ( nObjectRotation )
                         {
-                            double a = nObjectRotation * nPi180;
+                            double a = nObjectRotation * F_PI18000;
                             Point aCenter( aObjData.aBoundRect.Center() );
                             double ss = sin(a);
                             double cc = cos(a);
@@ -4821,7 +4821,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
             {
                 if( nObjectRotation )
                 {
-                    double a = nObjectRotation * nPi180;
+                    double a = nObjectRotation * F_PI18000;
                     pRet->NbcRotate( aObjData.aBoundRect.Center(), nObjectRotation, sin( a ), cos( a ) );
                 }
                 // mirrored horizontally?
@@ -5423,14 +5423,14 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
                 Point aPivot(rTextRect.TopLeft());
                 aPivot.AdjustX(nMinWH );
                 aPivot.AdjustY(nMinWH );
-                double a = nTextRotationAngle * nPi180;
+                double a = nTextRotationAngle * F_PI18000;
                 pTextObj->NbcRotate(aPivot, nTextRotationAngle, sin(a), cos(a));
             }
 
             // rotate text with shape?
             if ( mnFix16Angle )
             {
-                double a = mnFix16Angle * nPi180;
+                double a = mnFix16Angle * F_PI18000;
                 pTextObj->NbcRotate( rObjData.aBoundRect.Center(), mnFix16Angle,
                     sin( a ), cos( a ) );
             }
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index 2f92c28b5822..162500f5a984 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -1191,14 +1191,14 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, Svx
                     {
                         if ( rObjData.nSpFlags & ShapeFlag::FlipV )
                         {
-                            double a = 18000 * nPi180;
+                            double a = 18000 * F_PI18000;
                             pTObj->Rotate( rTextRect.Center(), 18000, sin( a ), cos( a ) );
                         }
                         if ( rObjData.nSpFlags & ShapeFlag::FlipH )
                             nAngle = 36000 - nAngle;
                         if ( nAngle )
                         {
-                            double a = nAngle * nPi180;
+                            double a = nAngle * F_PI18000;
                             pTObj->NbcRotate( rObjData.aBoundRect.Center(), nAngle, sin( a ), cos( a ) );
                         }
                     }
diff --git a/include/svx/svdtrans.hxx b/include/svx/svdtrans.hxx
index a27515e86327..c10f9f8fc2f0 100644
--- a/include/svx/svdtrans.hxx
+++ b/include/svx/svdtrans.hxx
@@ -33,17 +33,15 @@
 // The DrawingEngine's angles are specified in 1/100th degrees
 // We need to convert these angles to radians, in order to be able
 // to process them with trigonometric functions.
-// This is done, using the constant nPi180.
+// This is done, using the constant F_PI18000.
 //
 // Example usage:
 // nAngle ... is an angle in 1/100 Deg
 //
 // Which is converted, by this:
-//   double nSin=sin(nAngle*nPi180);
+//   double nSin=sin(nAngle*F_PI18000);
 //
 // To convert it back, we use division.
-const double nPi=3.14159265358979323846;
-const double nPi180=0.000174532925199432957692222; // If we have too few digits, we get tan(4500*nPi180)!=1.0
 
 // That maximum shear angle
 #define SDRMAXSHEAR 8900
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index f1a594912eec..2309488d2e6e 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -5687,8 +5687,8 @@ void Test::testAnchoredRotatedShape()
         pPage->InsertObject(pObj);
         Point aRef1(pObj->GetSnapRect().Center());
         int nAngle = 9000; //90 deg.
-        double nSin=sin(nAngle*nPi180);
-        double nCos=cos(nAngle*nPi180);
+        double nSin = sin(nAngle * F_PI18000);
+        double nCos = cos(nAngle * F_PI18000);
         pObj->Rotate(aRef1,nAngle,nSin,nCos);
 
         ScDrawLayer::SetCellAnchoredFromPosition(*pObj, *m_pDoc, 0, true);
diff --git a/svx/source/customshapes/EnhancedCustomShape3d.cxx b/svx/source/customshapes/EnhancedCustomShape3d.cxx
index aac531dd26a3..8d7a9d3350a5 100644
--- a/svx/source/customshapes/EnhancedCustomShape3d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape3d.cxx
@@ -280,7 +280,7 @@ SdrObject* EnhancedCustomShape3d::Create3DObject(
         long nObjectRotation(rSdrObjCustomShape.GetRotateAngle());
         if ( nObjectRotation )
         {
-            double a = ( 36000 - nObjectRotation ) * nPi180;
+            double a = (36000 - nObjectRotation) * F_PI18000;
             long dx = aSnapRect.Right() - aSnapRect.Left();
             long dy = aSnapRect.Bottom()- aSnapRect.Top();
             Point aP( aSnapRect.TopLeft() );
diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx
index e6509a6f1a2d..d5d052e8407b 100644
--- a/svx/source/svdraw/svddrgmt.cxx
+++ b/svx/source/svdraw/svddrgmt.cxx
@@ -1082,7 +1082,7 @@ void SdrDragMovHdl::MoveSdrDrag(const Point& rNoSnapPnt)
                     nNewAngle/=nSA;
                     nNewAngle*=nSA;
                     nNewAngle=NormAngle36000(nNewAngle);
-                    double a=(nNewAngle-nAngle)*nPi180;
+                    double a=(nNewAngle-nAngle)*F_PI18000;
                     double nSin=sin(a);
                     double nCos=cos(a);
                     RotatePoint(aPnt,aRef,nSin,nCos);
@@ -2058,7 +2058,7 @@ PointerStyle SdrDragResize::GetSdrDragPointer() const
 
 void SdrDragRotate::applyCurrentTransformationToSdrObject(SdrObject& rTarget)
 {
-    rTarget.Rotate(DragStat().GetRef1(), nAngle, sin(nAngle*nPi180), cos(nAngle*nPi180));
+    rTarget.Rotate(DragStat().GetRef1(), nAngle, sin(nAngle * F_PI18000), cos(nAngle * F_PI18000));
 }
 
 SdrDragRotate::SdrDragRotate(SdrDragView& rNewView)
@@ -2158,7 +2158,7 @@ void SdrDragRotate::MoveSdrDrag(const Point& rPnt_)
                 bRight=false;
 
             nAngle=nNewAngle;
-            double a=nAngle*nPi180;
+            double a = nAngle * F_PI18000;
             double nSin1=sin(a); // calculate now, so as little time as possible
             double nCos1=cos(a); // passes between Hide() and Show()
             Hide();
@@ -2374,7 +2374,7 @@ void SdrDragShear::MoveSdrDrag(const Point& rPnt)
         if (bUpSideDown) nNewAngle-=18000;
         if (bNeg) nTmpAngle=-nTmpAngle;
         bResize=true;
-        aNewFract = cos(nTmpAngle*nPi180);
+        aNewFract = cos(nTmpAngle * F_PI18000);
         aFact.ReduceInaccurate(10); // three decimals should be enough
     }
 
@@ -2388,7 +2388,7 @@ void SdrDragShear::MoveSdrDrag(const Point& rPnt)
     {
         nAngle=nNewAngle;
         aFact=aNewFract;
-        double a=nAngle*nPi180;
+        double a = nAngle * F_PI18000;
         double nTan1=tan(a); // calculate now, so as little time as possible passes between Hide() and Show()
         Hide();
         nTan=nTan1;
@@ -2413,7 +2413,7 @@ void SdrDragShear::applyCurrentTransformationToSdrObject(SdrObject& rTarget)
 
     if (nAngle!=0)
     {
-        rTarget.Shear(DragStat().GetRef1(),nAngle,tan(nAngle*nPi180),bVertical);
+        rTarget.Shear(DragStat().GetRef1(), nAngle, tan(nAngle * F_PI18000), bVertical);
     }
 }
 
@@ -3187,7 +3187,7 @@ void SdrDragCrook::MoveSdrDrag(const Point& rPnt)
             nPntWink = std::abs(nPntWink);
         }
 
-        double nUmfang = 2 * std::abs(nNewRad)*nPi;
+        double nUmfang = 2 * std::abs(nNewRad) * M_PI;
 
         if (bResize)
         {
diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx
index b0a53732e973..c6deecce28b6 100644
--- a/svx/source/svdraw/svdedtv1.cxx
+++ b/svx/source/svdraw/svdedtv1.cxx
@@ -311,8 +311,8 @@ void SdrEditView::RotateMarkedObj(const Point& rRef, long nAngle, bool bCopy)
     if (bCopy)
         CopyMarkedObj();
 
-    double nSin=sin(nAngle*nPi180);
-    double nCos=cos(nAngle*nPi180);
+    double nSin = sin(nAngle * F_PI18000);
+    double nCos = cos(nAngle * F_PI18000);
     const size_t nMarkCount(GetMarkedObjectCount());
 
     if(nMarkCount)
@@ -467,7 +467,7 @@ void SdrEditView::ShearMarkedObj(const Point& rRef, long nAngle, bool bVShear, b
     if (bCopy)
         CopyMarkedObj();
 
-    double nTan=tan(nAngle*nPi180);
+    double nTan = tan(nAngle * F_PI18000);
     const size_t nMarkCount=GetMarkedObjectCount();
     for (size_t nm=0; nm<nMarkCount; ++nm)
     {
@@ -557,7 +557,7 @@ void SdrEditView::ImpCrookObj(SdrObject* pO, const Point& rRef, const Point& rRa
         aCtr1 -= aCtr0;
 
         if(bRotOk)
-            pO->Rotate(aCtr0, FRound(nAngle/nPi180), nSin, nCos);
+            pO->Rotate(aCtr0, FRound(nAngle / F_PI18000), nSin, nCos);
 
         pO->Move(Size(aCtr1.X(),aCtr1.Y()));
     }
@@ -1559,10 +1559,10 @@ void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr)
             } else {
                 if (nNewShearAngle!=0 && nOldShearAngle!=0) {
                     // bug fix
-                    double nOld=tan(static_cast<double>(nOldShearAngle)*nPi180);
-                    double nNew=tan(static_cast<double>(nNewShearAngle)*nPi180);
+                    double nOld = tan(static_cast<double>(nOldShearAngle) * F_PI18000);
+                    double nNew = tan(static_cast<double>(nNewShearAngle) * F_PI18000);
                     nNew-=nOld;
-                    nNew=atan(nNew)/nPi180;
+                    nNew = atan(nNew) / F_PI18000;
                     nShearAngle=FRound(nNew);
                 } else {
                     nShearAngle=nNewShearAngle-nOldShearAngle;
diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx
index 5dbb948f7a5c..2c9c14b1f2c4 100644
--- a/svx/source/svdraw/svdfmtf.cxx
+++ b/svx/source/svdraw/svdfmtf.cxx
@@ -1055,7 +1055,7 @@ void ImpSdrGDIMetaFileImport::ImportText( const Point& rPos, const OUString& rSt
     if ( nAngle )
     {
         nAngle*=10;
-        double a=nAngle*nPi180;
+        double a = nAngle * F_PI18000;
         double nSin=sin(a);
         double nCos=cos(a);
         pText->NbcRotate(aPos,nAngle,nSin,nCos);
diff --git a/svx/source/svdraw/svdglev.cxx b/svx/source/svdraw/svdglev.cxx
index a160b4610027..6c1be3bb96c1 100644
--- a/svx/source/svdraw/svdglev.cxx
+++ b/svx/source/svdraw/svdglev.cxx
@@ -390,8 +390,8 @@ void SdrGlueEditView::RotateMarkedGluePoints(const Point& rRef, long nAngle, boo
     if (bCopy) aStr+=SvxResId(STR_EditWithCopy);
     BegUndo(aStr,GetDescriptionOfMarkedGluePoints(),SdrRepeatFunc::Rotate);
     if (bCopy) ImpCopyMarkedGluePoints();
-    double nSin=sin(nAngle*nPi180);
-    double nCos=cos(nAngle*nPi180);
+    double nSin = sin(nAngle * F_PI18000);
+    double nCos = cos(nAngle * F_PI18000);
     ImpTransformMarkedGluePoints(ImpRotate,&rRef,&nAngle,&nSin,&nCos);
     EndUndo();
     AdjustMarkHdl();
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index f183b888f0fc..977202efdd15 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -1991,7 +1991,7 @@ void SdrObject::NbcApplyNotPersistAttr(const SfxItemSet& rAttr)
         long n=static_cast<const SdrShearAngleItem*>(pPoolItem)->GetValue();
         n-=GetShearAngle();
         if (n!=0) {
-            double nTan=tan(n*nPi180);
+            double nTan = tan(n * F_PI18000);
             NbcShear(aRef1,n,nTan,false);
         }
     }
@@ -1999,25 +1999,25 @@ void SdrObject::NbcApplyNotPersistAttr(const SfxItemSet& rAttr)
         long n=static_cast<const SdrAngleItem*>(pPoolItem)->GetValue();
         n-=GetRotateAngle();
         if (n!=0) {
-            double nSin=sin(n*nPi180);
-            double nCos=cos(n*nPi180);
+            double nSin = sin(n * F_PI18000);
+            double nCos = cos(n * F_PI18000);
             NbcRotate(aRef1,n,nSin,nCos);
         }
     }
     if (rAttr.GetItemState(SDRATTR_ROTATEONE,true,&pPoolItem)==SfxItemState::SET) {
         long n=static_cast<const SdrRotateOneItem*>(pPoolItem)->GetValue();
-        double nSin=sin(n*nPi180);
-        double nCos=cos(n*nPi180);
+        double nSin = sin(n * F_PI18000);
+        double nCos = cos(n * F_PI18000);
         NbcRotate(aRef1,n,nSin,nCos);
     }
     if (rAttr.GetItemState(SDRATTR_HORZSHEARONE,true,&pPoolItem)==SfxItemState::SET) {
         long n=static_cast<const SdrHorzShearOneItem*>(pPoolItem)->GetValue();
-        double nTan=tan(n*nPi180);
+        double nTan = tan(n * F_PI18000);
         NbcShear(aRef1,n,nTan,false);
     }
     if (rAttr.GetItemState(SDRATTR_VERTSHEARONE,true,&pPoolItem)==SfxItemState::SET) {
         long n=static_cast<const SdrVertShearOneItem*>(pPoolItem)->GetValue();
-        double nTan=tan(n*nPi180);
+        double nTan = tan(n * F_PI18000);
         NbcShear(aRef1,n,nTan,true);
     }
 
diff --git a/svx/source/svdraw/svdocirc.cxx b/svx/source/svdraw/svdocirc.cxx
index 29611e2315ba..7a01a5742708 100644
--- a/svx/source/svdraw/svdocirc.cxx
+++ b/svx/source/svdraw/svdocirc.cxx
@@ -60,7 +60,7 @@ static Point GetAnglePnt(const tools::Rectangle& rR, long nAngle)
     long nHgt=rR.Bottom()-rR.Top();
     long nMaxRad=(std::max(nWdt,nHgt)+1) /2;
     double a;
-    a=nAngle*nPi180;
+    a = nAngle * F_PI18000;
     Point aRetval(FRound(cos(a)*nMaxRad),-FRound(sin(a)*nMaxRad));
     if (nWdt==0) aRetval.setX(0 );
     if (nHgt==0) aRetval.setY(0 );
@@ -880,13 +880,13 @@ void SdrCircObj::NbcMirror(const Point& rRef1, const Point& rRef2)
         long nMaxRad=(std::max(nWdt,nHgt)+1) /2;
         double a;
         // starting point
-        a=nStartAngle*nPi180;
+        a = nStartAngle * F_PI18000;
         aTmpPt1=Point(FRound(cos(a)*nMaxRad),-FRound(sin(a)*nMaxRad));
         if (nWdt==0) aTmpPt1.setX(0 );
         if (nHgt==0) aTmpPt1.setY(0 );
         aTmpPt1+=aCenter;
         // finishing point
-        a=nEndAngle*nPi180;
+        a = nEndAngle * F_PI18000;
         aTmpPt2=Point(FRound(cos(a)*nMaxRad),-FRound(sin(a)*nMaxRad));
         if (nWdt==0) aTmpPt2.setX(0 );
         if (nHgt==0) aTmpPt2.setY(0 );
diff --git a/svx/source/svdraw/svdomeas.cxx b/svx/source/svdraw/svdomeas.cxx
index 91cacf12ea97..6e5591a129e4 100644
--- a/svx/source/svdraw/svdomeas.cxx
+++ b/svx/source/svdraw/svdomeas.cxx
@@ -417,7 +417,7 @@ void SdrMeasureObj::ImpCalcGeometrics(const ImpMeasureRec& rRec, ImpMeasurePoly&
     rPol.nArrow2Len=nArrow2Len;
 
     rPol.nLineAngle=GetAngle(aDelt);
-    double a=rPol.nLineAngle*nPi180;
+    double a = rPol.nLineAngle * F_PI18000;
     double nLineSin=sin(a);
     double nLineCos=cos(a);
     rPol.nLineSin=nLineSin;
@@ -879,7 +879,7 @@ OUString SdrMeasureObj::getSpecialDragComment(const SdrDragStat& /*rDrag*/) cons
 void SdrMeasureObj::ImpEvalDrag(ImpMeasureRec& rRec, const SdrDragStat& rDrag) const
 {
     long nLineAngle=GetAngle(rRec.aPt2-rRec.aPt1);
-    double a=nLineAngle*nPi180;
+    double a = nLineAngle * F_PI18000;
     double nSin=sin(a);
     double nCos=cos(a);
 
diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx
index fc385efa83a4..fe7f07d8569b 100644
--- a/svx/source/svdraw/svdopath.cxx
+++ b/svx/source/svdraw/svdopath.cxx
@@ -320,20 +320,20 @@ void ImpPathCreateUser::CalcCircle(const Point& rP1, const Point& rP2, const Poi
     bool bRet=nTmpAngle!=9000 && nTmpAngle!=27000;
     long nRad=0;
     if (bRet) {
-        double cs=cos(nTmpAngle*nPi180);
+        double cs = cos(nTmpAngle * F_PI18000);
         double nR=static_cast<double>(GetLen(Point(dx,dy)))/cs/2;
         nRad=std::abs(FRound(nR));
     }
     if (dAngle<18000) {
         nCircStAngle=NormAngle36000(nTangAngle-9000);
         nCircRelAngle=NormAngle36000(2*dAngle);
-        aCircCenter.AdjustX(FRound(nRad*cos((nTangAngle+9000)*nPi180)) );
-        aCircCenter.AdjustY( -(FRound(nRad*sin((nTangAngle+9000)*nPi180))) );
+        aCircCenter.AdjustX(FRound(nRad * cos((nTangAngle + 9000) * F_PI18000)));
+        aCircCenter.AdjustY(-(FRound(nRad * sin((nTangAngle + 9000) * F_PI18000))));
     } else {
         nCircStAngle=NormAngle36000(nTangAngle+9000);
         nCircRelAngle=-NormAngle36000(36000-2*dAngle);
-        aCircCenter.AdjustX(FRound(nRad*cos((nTangAngle-9000)*nPi180)) );
-        aCircCenter.AdjustY( -(FRound(nRad*sin((nTangAngle-9000)*nPi180))) );
+        aCircCenter.AdjustX(FRound(nRad * cos((nTangAngle - 9000) * F_PI18000)));
+        aCircCenter.AdjustY(-(FRound(nRad * sin((nTangAngle - 9000) * F_PI18000))));
     }
     bAngleSnap=pView!=nullptr && pView->IsAngleSnapEnabled();
     if (bAngleSnap) {
@@ -451,7 +451,7 @@ void ImpPathCreateUser::CalcRect(const Point& rP1, const Point& rP2, const Point
         long nHypLen=aTmpPt.Y()-y;
         long nTangAngle=-GetAngle(rDir);
         // sin=g/h, g=h*sin
-        double a=nTangAngle*nPi180;
+        double a = nTangAngle * F_PI18000;
         double sn=sin(a);
         double cs=cos(a);
         double nGKathLen=nHypLen*sn;
@@ -2285,7 +2285,8 @@ void SdrPathObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fract
 void SdrPathObj::NbcRotate(const Point& rRef, long nAngle, double sn, double cs)
 {
     // Thank JOE, the angles are defined mirrored to the mathematical meanings
-    const basegfx::B2DHomMatrix aTrans(basegfx::utils::createRotateAroundPoint(rRef.X(), rRef.Y(), -nAngle * nPi180));
+    const basegfx::B2DHomMatrix aTrans(
+        basegfx::utils::createRotateAroundPoint(rRef.X(), rRef.Y(), -nAngle * F_PI18000));
     maPathPolygon.transform(aTrans);
 
     // #i19871# first modify locally, then call parent (to get correct SnapRect with GluePoints)
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index 0168db2cf199..10f42a96bb17 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -541,7 +541,7 @@ void SdrTextObj::ImpSetContourPolygon( SdrOutliner& rOutliner, tools::Rectangle
     if(aGeo.nRotationAngle)
     {
         // Unrotate!
-        aMatrix.rotate(-aGeo.nRotationAngle * nPi180);
+        aMatrix.rotate(-aGeo.nRotationAngle * F_PI18000);
     }
 
     aXorPolyPolygon.transform(aMatrix);
diff --git a/svx/source/svdraw/svdpdf.cxx b/svx/source/svdraw/svdpdf.cxx
index 1095a08e54e3..d027d1c0d3c2 100644
--- a/svx/source/svdraw/svdpdf.cxx
+++ b/svx/source/svdraw/svdpdf.cxx
@@ -938,7 +938,7 @@ void ImpSdrPdfImport::ImportText(const Point& rPos, const Size& rSize, const OUS
     if (nAngle)
     {
         nAngle *= 10;
-        double a = nAngle * nPi180;
+        double a = nAngle * F_PI18000;
         double nSin = sin(a);
         double nCos = cos(a);
         pText->NbcRotate(aPos, nAngle, nSin, nCos);
diff --git a/svx/source/svdraw/svdpoev.cxx b/svx/source/svdraw/svdpoev.cxx
index e04f8f8ca13c..f0b4f2bddfb0 100644
--- a/svx/source/svdraw/svdpoev.cxx
+++ b/svx/source/svdraw/svdpoev.cxx
@@ -641,8 +641,8 @@ void SdrPolyEditView::RotateMarkedPoints(const Point& rRef, long nAngle)
     ForceUndirtyMrkPnt();
     OUString aStr(SvxResId(STR_EditResize));
     BegUndo(aStr,GetDescriptionOfMarkedPoints(),SdrRepeatFunc::Rotate);
-    double nSin=sin(nAngle*nPi180);
-    double nCos=cos(nAngle*nPi180);
+    double nSin = sin(nAngle * F_PI18000);
+    double nCos = cos(nAngle * F_PI18000);
     ImpTransformMarkedPoints(ImpRotate,&rRef,&nAngle,&nSin,&nCos);
     EndUndo();
     AdjustMarkHdl();
diff --git a/svx/source/svdraw/svdtrans.cxx b/svx/source/svdraw/svdtrans.cxx
index 232280b8d5d8..14ec58c04cd3 100644
--- a/svx/source/svdraw/svdtrans.cxx
+++ b/svx/source/svdraw/svdtrans.cxx
@@ -126,7 +126,7 @@ void MirrorPoint(Point& rPnt, const Point& rRef1, const Point& rRef2)
         rPnt-=rRef1;
         long nPntWink=GetAngle(rPnt);
         long nAngle=2*(nRefWink-nPntWink);
-        double a=nAngle*nPi180;
+        double a = nAngle * F_PI18000;
         double nSin=sin(a);
         double nCos=cos(a);
         RotatePoint(rPnt,Point(),nSin,nCos);
@@ -391,7 +391,8 @@ long GetAngle(const Point& rPnt)
         if (rPnt.Y()>0) a=-9000;
         else a=9000;
     } else {
-        a=FRound(atan2(static_cast<double>(-rPnt.Y()),static_cast<double>(rPnt.X()))/nPi180);
+        a = FRound(atan2(static_cast<double>(-rPnt.Y()), static_cast<double>(rPnt.X()))
+                   / F_PI18000);
     }
     return a;
 }
@@ -452,7 +453,7 @@ void GeoStat::RecalcSinCos()
         nSin=0.0;
         nCos=1.0;
     } else {
-        double a=nRotationAngle*nPi180;
+        double a = nRotationAngle * F_PI18000;
         nSin=sin(a);
         nCos=cos(a);
     }
@@ -463,7 +464,7 @@ void GeoStat::RecalcTan()
     if (nShearAngle==0) {
         nTan=0.0;
     } else {
-        double a=nShearAngle*nPi180;
+        double a = nShearAngle * F_PI18000;
         nTan=tan(a);
     }
 }
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index 65ca35e38cd9..63f24d0f9e30 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -2347,8 +2347,8 @@ bool SvxShape::setPropertyValueImpl( const OUString&, const SfxItemPropertySimpl
             nAngle -= GetSdrObject()->GetRotateAngle();
             if (nAngle!=0)
             {
-                double nSin=sin(nAngle*nPi180);
-                double nCos=cos(nAngle*nPi180);
+                double nSin = sin(nAngle * F_PI18000);
+                double nCos = cos(nAngle * F_PI18000);
                 GetSdrObject()->Rotate(aRef1,nAngle,nSin,nCos);
             }
             return true;
@@ -2366,7 +2366,7 @@ bool SvxShape::setPropertyValueImpl( const OUString&, const SfxItemPropertySimpl
             if(nShear != 0 )
             {
                 Point aRef1(GetSdrObject()->GetSnapRect().Center());
-                double nTan=tan(nShear*nPi180);
+                double nTan = tan(nShear * F_PI18000);
                 GetSdrObject()->Shear(aRef1,nShear,nTan,false);
                 return true;
             }
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 4db2aaf145ff..6b77a7fd9821 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -916,7 +916,7 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt,
                         Point aPivot(rTextRect.TopLeft());
                         aPivot.AdjustX(nMinWH );
                         aPivot.AdjustY(nMinWH );
-                        double a = nTextRotationAngle * nPi180;
+                        double a = nTextRotationAngle * F_PI18000;
                         pObj->NbcRotate(aPivot, nTextRotationAngle, sin(a), cos(a));
                     }
                 }
@@ -952,7 +952,7 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt,
                 else if ( mnFix16Angle )
                 {
                     // rotate text with shape ?
-                    double a = mnFix16Angle * nPi180;
+                    double a = mnFix16Angle * F_PI18000;
                     pObj->NbcRotate( rObjData.aBoundRect.Center(), mnFix16Angle,
                                      sin( a ), cos( a ) );
                 }


More information about the Libreoffice-commits mailing list