summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2019-02-26 10:18:39 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2019-02-26 10:12:29 +0100
commit3caf379f1c6398548c65bb7a83e3911d9a8bc444 (patch)
treec2068e498094b99865ed8e59b6b0f65fee908683 /svx
parentb8f83e285af000ed1ebf211c2021cc065724ea37 (diff)
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@collabora.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/customshapes/EnhancedCustomShape3d.cxx2
-rw-r--r--svx/source/svdraw/svddrgmt.cxx14
-rw-r--r--svx/source/svdraw/svdedtv1.cxx14
-rw-r--r--svx/source/svdraw/svdfmtf.cxx2
-rw-r--r--svx/source/svdraw/svdglev.cxx4
-rw-r--r--svx/source/svdraw/svdobj.cxx14
-rw-r--r--svx/source/svdraw/svdocirc.cxx6
-rw-r--r--svx/source/svdraw/svdomeas.cxx4
-rw-r--r--svx/source/svdraw/svdopath.cxx15
-rw-r--r--svx/source/svdraw/svdotext.cxx2
-rw-r--r--svx/source/svdraw/svdpdf.cxx2
-rw-r--r--svx/source/svdraw/svdpoev.cxx4
-rw-r--r--svx/source/svdraw/svdtrans.cxx9
-rw-r--r--svx/source/unodraw/unoshape.cxx6
14 files changed, 50 insertions, 48 deletions
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;
}