summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2021-11-18 17:43:46 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2021-11-19 09:59:43 +0100
commit37429f2690a96491ad0e4fa2a04f2fa88a66da87 (patch)
tree9963c1f531f22306edaf2ce8b41d5636f5e191f3 /svx
parent0afd2d3bfa9d55249ffd1408681ff04decf2d8fa (diff)
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>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/customshapes/EnhancedCustomShape2d.cxx22
-rw-r--r--svx/source/dialog/dlgctl3d.cxx16
-rw-r--r--svx/source/dialog/frmsel.cxx2
-rw-r--r--svx/source/engine3d/view3d.cxx2
-rw-r--r--svx/source/sdr/contact/viewcontactofe3dlathe.cxx4
-rw-r--r--svx/source/sdr/contact/viewcontactofe3dsphere.cxx4
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx2
-rw-r--r--svx/source/sdr/primitive2d/sdrframeborderprimitive2d.cxx6
-rw-r--r--svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx10
-rw-r--r--svx/source/svdraw/svdhdl.cxx2
-rw-r--r--svx/source/svdraw/svdocapt.cxx2
-rw-r--r--svx/source/svdraw/svdocirc.cxx4
-rw-r--r--svx/source/svdraw/svdopath.cxx2
13 files changed, 39 insertions, 39 deletions
diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx
index ccd15f479b4f..2fb4df76bd1e 100644
--- a/svx/source/customshapes/EnhancedCustomShape2d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx
@@ -831,7 +831,7 @@ double EnhancedCustomShape2d::GetEnumFunc( const ExpressionFunct eFunc ) const
double fRet = 0.0;
switch( eFunc )
{
- case ExpressionFunct::EnumPi : fRet = F_PI; break;
+ case ExpressionFunct::EnumPi : fRet = M_PI; break;
case ExpressionFunct::EnumLeft : fRet = static_cast<double>(nCoordLeft); break;
case ExpressionFunct::EnumTop : fRet = static_cast<double>(nCoordTop); break;
case ExpressionFunct::EnumRight : fRet = (static_cast<double>(nCoordLeft) + static_cast<double>(nCoordWidth)) * fXRatio; break;
@@ -1760,8 +1760,8 @@ bool EnhancedCustomShape2d::SetHandleControllerPosition( const sal_uInt32 nIndex
if (ftmpX != 0.0 || ftmpY != 0.0)
faA = atan2(ftmpY, ftmpX); // range ]-pi..pi], here -pi < faA < -pi/2
// screen 270 deg = mathematic coordinate system -pi/2
- double fha(-F_PI2 - faA); // positive circle angle difference to 270 deg
- if (abs(fha) == F_PI2) // should not happen, but ensure no tan(90deg)
+ double fha(-M_PI_2 - faA); // positive circle angle difference to 270 deg
+ if (abs(fha) == M_PI_2) // should not happen, but ensure no tan(90deg)
fha = 0.12; // dummy value
double flFD(2 * std::min(frw, frh) * tan(fha) - fth);
if (fss != 0.0)
@@ -2477,11 +2477,11 @@ void EnhancedCustomShape2d::CreateSubPath(
{
if (aEnd.getY()<aStart.getY()) // left, up
{
- aArc = basegfx::utils::createPolygonFromEllipseSegment(aCenter, fRadiusX, fRadiusY, F_PI2, F_PI);
+ aArc = basegfx::utils::createPolygonFromEllipseSegment(aCenter, fRadiusX, fRadiusY, M_PI_2, M_PI);
}
else // left, down
{
- aArc = basegfx::utils::createPolygonFromEllipseSegment(aCenter, fRadiusX, fRadiusY, F_PI, 1.5*F_PI);
+ aArc = basegfx::utils::createPolygonFromEllipseSegment(aCenter, fRadiusX, fRadiusY, M_PI, 1.5*M_PI);
aArc.flip();
}
}
@@ -2489,12 +2489,12 @@ void EnhancedCustomShape2d::CreateSubPath(
{
if (aEnd.getY()<aStart.getY()) // right, up
{
- aArc = basegfx::utils::createPolygonFromEllipseSegment(aCenter, fRadiusX, fRadiusY, 0.0, F_PI2);
+ aArc = basegfx::utils::createPolygonFromEllipseSegment(aCenter, fRadiusX, fRadiusY, 0.0, M_PI_2);
aArc.flip();
}
else // right, down
{
- aArc = basegfx::utils::createPolygonFromEllipseSegment(aCenter, fRadiusX, fRadiusY, 1.5*F_PI, F_2PI);
+ aArc = basegfx::utils::createPolygonFromEllipseSegment(aCenter, fRadiusX, fRadiusY, 1.5*M_PI, F_2PI);
}
}
}
@@ -2505,23 +2505,23 @@ void EnhancedCustomShape2d::CreateSubPath(
{
if (aEnd.getY()<aStart.getY()) // up, left
{
- aArc = basegfx::utils::createPolygonFromEllipseSegment(aCenter, fRadiusX, fRadiusY, 1.5*F_PI, F_2PI);
+ aArc = basegfx::utils::createPolygonFromEllipseSegment(aCenter, fRadiusX, fRadiusY, 1.5*M_PI, F_2PI);
aArc.flip();
}
else // down, left
{
- aArc = basegfx::utils::createPolygonFromEllipseSegment(aCenter, fRadiusX, fRadiusY, 0.0, F_PI2);
+ aArc = basegfx::utils::createPolygonFromEllipseSegment(aCenter, fRadiusX, fRadiusY, 0.0, M_PI_2);
}
}
else // aEnd.getX()>=aStart.getX()
{
if (aEnd.getY()<aStart.getY()) // up, right
{
- aArc = basegfx::utils::createPolygonFromEllipseSegment(aCenter, fRadiusX, fRadiusY, F_PI, 1.5*F_PI);
+ aArc = basegfx::utils::createPolygonFromEllipseSegment(aCenter, fRadiusX, fRadiusY, M_PI, 1.5*M_PI);
}
else // down, right
{
- aArc = basegfx::utils::createPolygonFromEllipseSegment(aCenter, fRadiusX, fRadiusY, F_PI2, F_PI);
+ aArc = basegfx::utils::createPolygonFromEllipseSegment(aCenter, fRadiusX, fRadiusY, M_PI_2, M_PI);
aArc.flip();
}
}
diff --git a/svx/source/dialog/dlgctl3d.cxx b/svx/source/dialog/dlgctl3d.cxx
index d2aab7f954d7..504e65e6c7a6 100644
--- a/svx/source/dialog/dlgctl3d.cxx
+++ b/svx/source/dialog/dlgctl3d.cxx
@@ -299,7 +299,7 @@ void Svx3DLightControl::Construct2()
basegfx::B3DPolygon a3DCircle(basegfx::utils::createB3DPolygonFromB2DPolygon(a2DCircle));
basegfx::B3DHomMatrix aTransform;
- aTransform.rotate(F_PI2, 0.0, 0.0);
+ aTransform.rotate(M_PI_2, 0.0, 0.0);
aTransform.translate(0.0, -RADIUS_LAMP_PREVIEW_SIZE, 0.0);
a3DCircle.transform(aTransform);
@@ -314,7 +314,7 @@ void Svx3DLightControl::Construct2()
a2DHalfCircle.append(basegfx::B2DPoint(RADIUS_LAMP_PREVIEW_SIZE, 0.0));
a2DHalfCircle.append(basegfx::B2DPoint(RADIUS_LAMP_PREVIEW_SIZE, -RADIUS_LAMP_PREVIEW_SIZE));
a2DHalfCircle.append(basegfx::utils::createPolygonFromEllipseSegment(
- basegfx::B2DPoint(0.0, 0.0), RADIUS_LAMP_PREVIEW_SIZE, RADIUS_LAMP_PREVIEW_SIZE, F_2PI - F_PI2, F_PI2));
+ basegfx::B2DPoint(0.0, 0.0), RADIUS_LAMP_PREVIEW_SIZE, RADIUS_LAMP_PREVIEW_SIZE, F_2PI - M_PI_2, M_PI_2));
basegfx::B3DPolygon a3DHalfCircle(basegfx::utils::createB3DPolygonFromB2DPolygon(a2DHalfCircle));
// create object for it
@@ -609,14 +609,14 @@ bool Svx3DLightControl::MouseMove(const MouseEvent& rMEvt)
}
// cut vertical
- if(fNewRotX < -F_PI2)
+ if(fNewRotX < -M_PI_2)
{
- fNewRotX = -F_PI2;
+ fNewRotX = -M_PI_2;
}
- if(fNewRotX > F_PI2)
+ if(fNewRotX > M_PI_2)
{
- fNewRotX = F_PI2;
+ fNewRotX = M_PI_2;
}
SetRotation(fNewRotX, fNewRotY, mfSaveActionStartRotZ);
@@ -712,7 +712,7 @@ void Svx3DLightControl::GetPosition(double& rHor, double& rVer)
{
basegfx::B3DVector aDirection(GetLightDirection(maSelectedLight));
aDirection.normalize();
- rHor = basegfx::rad2deg(atan2(-aDirection.getX(), -aDirection.getZ()) + F_PI); // 0..360.0
+ rHor = basegfx::rad2deg(atan2(-aDirection.getX(), -aDirection.getZ()) + M_PI); // 0..360.0
rVer = basegfx::rad2deg(atan2(aDirection.getY(), aDirection.getXZLength())); // -90.0..90.0
}
if(IsGeometrySelected())
@@ -727,7 +727,7 @@ void Svx3DLightControl::SetPosition(double fHor, double fVer)
if(IsSelectionValid())
{
// set selected light's direction
- fHor = basegfx::deg2rad(fHor) - F_PI; // -PI..PI
+ fHor = basegfx::deg2rad(fHor) - M_PI; // -PI..PI
fVer = basegfx::deg2rad(fVer); // -PI2..PI2
basegfx::B3DVector aDirection(cos(fVer) * -sin(fHor), sin(fVer), cos(fVer) * -cos(fHor));
aDirection.normalize();
diff --git a/svx/source/dialog/frmsel.cxx b/svx/source/dialog/frmsel.cxx
index 7871ae95249a..b2ab3d7ce523 100644
--- a/svx/source/dialog/frmsel.cxx
+++ b/svx/source/dialog/frmsel.cxx
@@ -425,7 +425,7 @@ void FrameSelectorImpl::InitBorderGeometry()
basegfx::fround(aCellRange.getMinX()), basegfx::fround(aCellRange.getMinY()),
basegfx::fround(aCellRange.getMaxX()), basegfx::fround(aCellRange.getMaxY()));
const double fHorDiagAngle(atan2(fabs(aCellRange.getHeight()), fabs(aCellRange.getWidth())));
- const double fVerDiagAngle(fHorDiagAngle > 0.0 ? F_PI2 - fHorDiagAngle : 0.0);
+ const double fVerDiagAngle(fHorDiagAngle > 0.0 ? M_PI_2 - fHorDiagAngle : 0.0);
const tools::Long nDiagFocusOffsX(basegfx::fround(-mnFocusOffs / tan(fHorDiagAngle) + mnFocusOffs / sin(fHorDiagAngle)));
const tools::Long nDiagFocusOffsY(basegfx::fround(-mnFocusOffs / tan(fVerDiagAngle) + mnFocusOffs / sin(fVerDiagAngle)));
diff --git a/svx/source/engine3d/view3d.cxx b/svx/source/engine3d/view3d.cxx
index bf693bce10d1..8f339f5b747e 100644
--- a/svx/source/engine3d/view3d.cxx
+++ b/svx/source/engine3d/view3d.cxx
@@ -864,7 +864,7 @@ void E3dView::ConvertMarkedObjTo3D(bool bExtrude, const basegfx::B2DPoint& rPnt1
// Rotation around control point #1 with set angle
// for 3D coordinates
basegfx::B2DPoint aDiff(rPnt1 - rPnt2);
- fRot3D = atan2(aDiff.getY(), aDiff.getX()) - F_PI2;
+ fRot3D = atan2(aDiff.getY(), aDiff.getX()) - M_PI_2;
if(basegfx::fTools::equalZero(fabs(fRot3D)))
fRot3D = 0.0;
diff --git a/svx/source/sdr/contact/viewcontactofe3dlathe.cxx b/svx/source/sdr/contact/viewcontactofe3dlathe.cxx
index 4cf299259c4f..0d9d0714aa56 100644
--- a/svx/source/sdr/contact/viewcontactofe3dlathe.cxx
+++ b/svx/source/sdr/contact/viewcontactofe3dlathe.cxx
@@ -64,7 +64,7 @@ namespace sdr::contact
const basegfx::B2DRange aPolyPolygonRange(basegfx::utils::getRange(aPolyPolygon));
const basegfx::B2DVector aTextureSize(
- F_PI * fabs(aPolyPolygonRange.getCenter().getX()), // PI * d
+ M_PI * fabs(aPolyPolygonRange.getCenter().getX()), // PI * d
fPolygonMaxLength);
// get more data
@@ -72,7 +72,7 @@ namespace sdr::contact
const sal_uInt32 nVerticalSegments(GetE3dLatheObj().GetVerticalSegments());
const double fDiagonal(static_cast<double>(GetE3dLatheObj().GetPercentDiagonal()) / 100.0);
const double fBackScale(static_cast<double>(GetE3dLatheObj().GetBackScale()) / 100.0);
- const double fRotation((static_cast<double>(GetE3dLatheObj().GetEndAngle()) / 1800.0) * F_PI);
+ const double fRotation((static_cast<double>(GetE3dLatheObj().GetEndAngle()) / 1800.0) * M_PI);
const bool bSmoothNormals(GetE3dLatheObj().GetSmoothNormals()); // Plane itself
const bool bSmoothLids(GetE3dLatheObj().GetSmoothLids()); // Front/back
const bool bCharacterMode(GetE3dLatheObj().GetCharacterMode());
diff --git a/svx/source/sdr/contact/viewcontactofe3dsphere.cxx b/svx/source/sdr/contact/viewcontactofe3dsphere.cxx
index 671a5b670297..e77d7a43e15f 100644
--- a/svx/source/sdr/contact/viewcontactofe3dsphere.cxx
+++ b/svx/source/sdr/contact/viewcontactofe3dsphere.cxx
@@ -63,8 +63,8 @@ namespace sdr::contact
// calculate texture size, use radii for (2 * PI * r) to get a perfect
// mapping on the sphere
const basegfx::B2DVector aTextureSize(
- F_PI * ((aSphereSize.getX() + aSphereSize.getZ()) / 2.0), // PI * d
- F_PI2 * aSphereSize.getY()); // half outline, (PI * d)/2 -> PI/2 * d
+ M_PI * ((aSphereSize.getX() + aSphereSize.getZ()) / 2.0), // PI * d
+ M_PI_2 * aSphereSize.getY()); // half outline, (PI * d)/2 -> PI/2 * d
// create primitive and add
const drawinglayer::primitive3d::Primitive3DReference xReference(
diff --git a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx
index a28e06f589e3..6a4e22ec7af0 100644
--- a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx
@@ -94,7 +94,7 @@ namespace sdr::contact
if(GetCustomShapeObj().IsMirroredY())
{
basegfx::B2DHomMatrix aRotMatrix(basegfx::utils::createRotateAroundPoint(
- aObjectRange.getCenterX(), aObjectRange.getCenterY(), F_PI));
+ aObjectRange.getCenterX(), aObjectRange.getCenterY(), M_PI));
aTextRange.transform(aRotMatrix);
}
}
diff --git a/svx/source/sdr/primitive2d/sdrframeborderprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrframeborderprimitive2d.cxx
index 8b40bc78fab3..448640591ce6 100644
--- a/svx/source/sdr/primitive2d/sdrframeborderprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrframeborderprimitive2d.cxx
@@ -209,8 +209,8 @@ namespace
return;
// create angle between both. angle() needs vectors pointing away from the same point,
- // so take the mirrored one. Add F_PI to get from -pi..+pi to [0..F_PI2] for sorting
- const double fAngle(basegfx::B2DVector(-rMyVector.getX(), -rMyVector.getY()).angle(rOtherVector) + F_PI);
+ // so take the mirrored one. Add M_PI to get from -pi..+pi to [0..M_PI_2] for sorting
+ const double fAngle(basegfx::B2DVector(-rMyVector.getX(), -rMyVector.getY()).angle(rOtherVector) + M_PI);
maEntries.emplace_back(
rStyle,
rOtherVector,
@@ -433,7 +433,7 @@ namespace
{
// sort: min to start, max to end
std::sort(aCutSets.begin(), aCutSets.end());
- const bool bOtherUpper(rStyleCandidate.getAngle() > F_PI);
+ const bool bOtherUpper(rStyleCandidate.getAngle() > M_PI);
// check if we need min or max
// bUpper bOtherUpper MinMax
diff --git a/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx
index aba7bf008fd6..32ad5764db7e 100644
--- a/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx
@@ -100,10 +100,10 @@ namespace drawinglayer::primitive2d
if(getTextRotation())
{
- aTextMatrix.rotate(-F_PI2);
- fTestAngle -= (F_PI2);
+ aTextMatrix.rotate(-M_PI_2);
+ fTestAngle -= (M_PI_2);
- if(getTextAutoAngle() && fTestAngle < -F_PI)
+ if(getTextAutoAngle() && fTestAngle < -M_PI)
{
fTestAngle += F_2PI;
}
@@ -111,7 +111,7 @@ namespace drawinglayer::primitive2d
if(getTextAutoAngle())
{
- if(fTestAngle > (F_PI / 4.0) || fTestAngle < (-F_PI * (3.0 / 4.0)))
+ if(fTestAngle > (M_PI / 4.0) || fTestAngle < (-M_PI * (3.0 / 4.0)))
{
bAutoUpsideDown = true;
}
@@ -403,7 +403,7 @@ namespace drawinglayer::primitive2d
// handle auto text rotation
if(bAutoUpsideDown)
{
- aChange.rotate(F_PI);
+ aChange.rotate(M_PI);
}
// move from aTextRange.TopLeft to fTextX, fTextY
diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx
index c509a069f715..d0c61f808ef3 100644
--- a/svx/source/svdraw/svdhdl.cxx
+++ b/svx/source/svdraw/svdhdl.cxx
@@ -2488,7 +2488,7 @@ void translateRotationToMirroring(basegfx::B2DVector & scale, double * rotate) {
// with getSmallValue here, the original which uses rtl::math::approxEqual
// is too correct here. Maybe this changes with enhanced precision in aw080
// to the better so that this can be reduced to the more precise call again
- if(basegfx::fTools::equal(fabs(*rotate), F_PI, 0.000000001))
+ if(basegfx::fTools::equal(fabs(*rotate), M_PI, 0.000000001))
{
scale.setX(scale.getX() * -1.0);
scale.setY(scale.getY() * -1.0);
diff --git a/svx/source/svdraw/svdocapt.cxx b/svx/source/svdraw/svdocapt.cxx
index 9e811de8bf4e..54889a9dde28 100644
--- a/svx/source/svdraw/svdocapt.cxx
+++ b/svx/source/svdraw/svdocapt.cxx
@@ -710,7 +710,7 @@ void handleNegativeScale(basegfx::B2DTuple & scale, double * rotate) {
{
scale.setX(fabs(scale.getX()));
scale.setY(fabs(scale.getY()));
- *rotate = fmod(*rotate + F_PI, F_2PI);
+ *rotate = fmod(*rotate + M_PI, F_2PI);
}
}
diff --git a/svx/source/svdraw/svdocirc.cxx b/svx/source/svdraw/svdocirc.cxx
index 9dc3a1d2d812..4275daa86187 100644
--- a/svx/source/svdraw/svdocirc.cxx
+++ b/svx/source/svdraw/svdocirc.cxx
@@ -262,8 +262,8 @@ basegfx::B2DPolygon SdrCircObj::ImpCalcXPolyCirc(const SdrCircKind eCircleKind,
{
// mirror start, end for geometry creation since model coordinate system is mirrored in Y
// #i111715# increase numerical correctness by first dividing and not using F_PI1800
- const double fStart((((36000 - nEnd.get()) % 36000) / 18000.0) * F_PI);
- const double fEnd((((36000 - nStart.get()) % 36000) / 18000.0) * F_PI);
+ const double fStart((((36000 - nEnd.get()) % 36000) / 18000.0) * M_PI);
+ const double fEnd((((36000 - nStart.get()) % 36000) / 18000.0) * M_PI);
// create circle segment. This is not closed by default
aCircPolygon = basegfx::utils::createPolygonFromEllipseSegment(
diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx
index 33845217c79d..17cf7f4a431e 100644
--- a/svx/source/svdraw/svdopath.cxx
+++ b/svx/source/svdraw/svdopath.cxx
@@ -2907,7 +2907,7 @@ void SdrPathObj::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const b
{
aScale.setX(fabs(aScale.getX()));
aScale.setY(fabs(aScale.getY()));
- fRotate = fmod(fRotate + F_PI, F_2PI);
+ fRotate = fmod(fRotate + M_PI, F_2PI);
}
// copy poly