diff options
Diffstat (limited to 'svx')
28 files changed, 84 insertions, 87 deletions
diff --git a/svx/source/customshapes/EnhancedCustomShape3d.cxx b/svx/source/customshapes/EnhancedCustomShape3d.cxx index 4d3cb9de7cb1..bbad9f60753a 100644 --- a/svx/source/customshapes/EnhancedCustomShape3d.cxx +++ b/svx/source/customshapes/EnhancedCustomShape3d.cxx @@ -277,7 +277,7 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( Degree100 nObjectRotation(rSdrObjCustomShape.GetRotateAngle()); if ( nObjectRotation ) { - double a = (36000 - nObjectRotation.get()) * F_PI18000; + double a = toRadians(36000_deg100 - nObjectRotation); tools::Long dx = aSnapRect.Right() - aSnapRect.Left(); tools::Long dy = aSnapRect.Bottom()- aSnapRect.Top(); Point aP( aSnapRect.TopLeft() ); diff --git a/svx/source/sdr/contact/viewcontactofe3dlathe.cxx b/svx/source/sdr/contact/viewcontactofe3dlathe.cxx index 0d9d0714aa56..bcaa1c367f97 100644 --- a/svx/source/sdr/contact/viewcontactofe3dlathe.cxx +++ b/svx/source/sdr/contact/viewcontactofe3dlathe.cxx @@ -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) * M_PI); + const double fRotation(basegfx::deg2rad<10>(GetE3dLatheObj().GetEndAngle())); 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/viewcontactofgraphic.cxx b/svx/source/sdr/contact/viewcontactofgraphic.cxx index 7450b25be1a4..8e284f7ae79d 100644 --- a/svx/source/sdr/contact/viewcontactofgraphic.cxx +++ b/svx/source/sdr/contact/viewcontactofgraphic.cxx @@ -341,7 +341,7 @@ namespace sdr::contact // fill object matrix const double fShearX(-rGeoStat.mfTanShearAngle); - const double fRotate(nRotationAngle ? (36000 - nRotationAngle.get()) * F_PI18000 : 0.0); + const double fRotate(nRotationAngle ? toRadians(36000_deg100 - nRotationAngle) : 0.0); const basegfx::B2DHomMatrix aObjectMatrix(basegfx::utils::createScaleShearXRotateTranslateB2DHomMatrix( aObjectRange.getWidth(), aObjectRange.getHeight(), fShearX, fRotate, diff --git a/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx b/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx index d3198802a706..44eea3a13fd4 100644 --- a/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx @@ -74,7 +74,7 @@ namespace sdr::contact basegfx::B2DHomMatrix aObjectMatrix(basegfx::utils::createScaleShearXRotateTranslateB2DHomMatrix( aObjectRange.getWidth(), aObjectRange.getHeight(), -rGeoStat.mfTanShearAngle, - rGeoStat.nRotationAngle ? (36000 - rGeoStat.nRotationAngle.get()) * F_PI18000 : 0.0, + rGeoStat.nRotationAngle ? toRadians(36000_deg100 - rGeoStat.nRotationAngle) : 0.0, aObjectRange.getMinX(), aObjectRange.getMinY())); // calculate corner radius diff --git a/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx b/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx index 7462c1080a2e..e150a6be7377 100644 --- a/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx @@ -57,7 +57,7 @@ namespace sdr::contact basegfx::utils::createScaleShearXRotateTranslateB2DHomMatrix( aObjectRange.getWidth(), aObjectRange.getHeight(), -rGeoStat.mfTanShearAngle, - rGeoStat.nRotationAngle ? (36000 - rGeoStat.nRotationAngle.get()) * F_PI18000 : 0.0, + rGeoStat.nRotationAngle ? toRadians(36000_deg100 - rGeoStat.nRotationAngle) : 0.0, aObjectRange.getMinX(), aObjectRange.getMinY())); // create primitive data @@ -77,10 +77,10 @@ namespace sdr::contact } else { - const sal_Int32 nNewStart(rItemSet.Get(SDRATTR_CIRCSTARTANGLE).GetValue()); - const sal_Int32 nNewEnd(rItemSet.Get(SDRATTR_CIRCENDANGLE).GetValue()); - const double fStart(((36000 - nNewEnd) % 36000) * F_PI18000); - const double fEnd(((36000 - nNewStart) % 36000) * F_PI18000); + const auto nNewStart(rItemSet.Get(SDRATTR_CIRCSTARTANGLE).GetValue()); + const auto nNewEnd(rItemSet.Get(SDRATTR_CIRCENDANGLE).GetValue()); + const double fStart(toRadians((36000_deg100 - nNewEnd) % 36000_deg100)); + const double fEnd(toRadians((36000_deg100 - nNewStart) % 36000_deg100)); const bool bCloseSegment(OBJ_CARC != nIdentifier); const bool bCloseUsingCenter(OBJ_SECT == nIdentifier); diff --git a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx index 6a4e22ec7af0..879f36971f85 100644 --- a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx @@ -73,7 +73,7 @@ namespace sdr::contact if(rGeoStat.nRotationAngle) { - aRotMatrix.rotate((36000 - rGeoStat.nRotationAngle.get()) * F_PI18000); + aRotMatrix.rotate(toRadians(36000_deg100 - rGeoStat.nRotationAngle)); } aRotMatrix.translate(aObjectRange.getMinimum().getX(), aObjectRange.getMinimum().getY()); @@ -202,7 +202,7 @@ namespace sdr::contact if(rGeoStat.nRotationAngle) { - aTextBoxMatrix.rotate((36000 - rGeoStat.nRotationAngle.get()) * F_PI18000); + aTextBoxMatrix.rotate(toRadians(36000_deg100 - rGeoStat.nRotationAngle)); } // give text it's target position diff --git a/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx b/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx index 610c483cbec8..a9ee47a30af3 100644 --- a/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx @@ -62,7 +62,7 @@ basegfx::B2DHomMatrix ViewContactOfSdrOle2Obj::createObjectTransform() const // create object matrix const GeoStat& rGeoStat(GetOle2Obj().GetGeoStat()); const double fShearX(-rGeoStat.mfTanShearAngle); - const double fRotate(rGeoStat.nRotationAngle ? (36000 - rGeoStat.nRotationAngle.get()) * F_PI18000 : 0.0); + const double fRotate(rGeoStat.nRotationAngle ? toRadians(36000_deg100 - rGeoStat.nRotationAngle) : 0.0); return basegfx::utils::createScaleShearXRotateTranslateB2DHomMatrix( aObjectRange.getWidth(), aObjectRange.getHeight(), diff --git a/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx b/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx index 694c3ea32947..b326fd8af787 100644 --- a/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx @@ -158,7 +158,7 @@ namespace sdr::contact aObjectMatrix = basegfx::utils::createScaleShearXRotateTranslateB2DHomMatrix( fScaleX, fScaleY, -rGeoStat.mfTanShearAngle, - rGeoStat.nRotationAngle ? (36000 - rGeoStat.nRotationAngle.get()) * F_PI18000 : 0.0, + rGeoStat.nRotationAngle ? toRadians(36000_deg100 - rGeoStat.nRotationAngle) : 0.0, aObjectRange.getMinX(), aObjectRange.getMinY()); // create unit polygon from object's absolute path diff --git a/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx b/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx index e1b8d69cd906..a8f1c3aeb125 100644 --- a/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx @@ -57,7 +57,7 @@ drawinglayer::primitive2d::Primitive2DContainer ViewContactOfSdrRectObj::createV basegfx::B2DHomMatrix aObjectMatrix(basegfx::utils::createScaleShearXRotateTranslateB2DHomMatrix( aObjectRange.getWidth(), aObjectRange.getHeight(), -rGeoStat.mfTanShearAngle, - rGeoStat.nRotationAngle ? (36000 - rGeoStat.nRotationAngle.get()) * F_PI18000 : 0.0, + rGeoStat.nRotationAngle ? toRadians(36000_deg100 - rGeoStat.nRotationAngle) : 0.0, aObjectRange.getMinX(), aObjectRange.getMinY())); // calculate corner radius diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx index 7193dc4a663c..1b4f0abbac97 100644 --- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx +++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx @@ -483,7 +483,7 @@ namespace drawinglayer::primitive2d static_cast<double>(aXGradient.GetBorder()) * 0.01, static_cast<double>(aXGradient.GetXOffset()) * 0.01, static_cast<double>(aXGradient.GetYOffset()) * 0.01, - static_cast<double>(aXGradient.GetAngle().get()) * F_PI1800, + toRadians(aXGradient.GetAngle()), aStart, aEnd, rSet.Get(XATTR_GRADIENTSTEPCOUNT).GetValue()); @@ -498,7 +498,7 @@ namespace drawinglayer::primitive2d aHatch = attribute::FillHatchAttribute( XHatchStyleToHatchStyle(rHatch.GetHatchStyle()), static_cast<double>(rHatch.GetDistance()), - static_cast<double>(rHatch.GetAngle().get()) * F_PI1800, + toRadians(rHatch.GetAngle()), aColorB.getBColor(), 3, // same default as VCL, a minimum of three discrete units (pixels) offset rSet.Get(XATTR_FILLBACKGROUND).GetValue()); @@ -644,7 +644,7 @@ namespace drawinglayer::primitive2d static_cast<double>(rGradient.GetBorder()) * 0.01, static_cast<double>(rGradient.GetXOffset()) * 0.01, static_cast<double>(rGradient.GetYOffset()) * 0.01, - static_cast<double>(rGradient.GetAngle().get()) * F_PI1800, + toRadians(rGradient.GetAngle()), basegfx::BColor(fStartLum, fStartLum, fStartLum), basegfx::BColor(fEndLum, fEndLum, fEndLum)); } diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx index bdba8aa0d7f4..1bbd4cbd46d9 100644 --- a/svx/source/svdraw/svddrgmt.cxx +++ b/svx/source/svdraw/svddrgmt.cxx @@ -1067,7 +1067,7 @@ void SdrDragMovHdl::MoveSdrDrag(const Point& rNoSnapPnt) nNewAngle/=nSA; nNewAngle*=nSA; nNewAngle=NormAngle36000(nNewAngle); - double a=(nNewAngle-nAngle).get()*F_PI18000; + double a=toRadians(nNewAngle-nAngle); double nSin=sin(a); double nCos=cos(a); RotatePoint(aPnt,aRef,nSin,nCos); @@ -2141,7 +2141,7 @@ void SdrDragRotate::MoveSdrDrag(const Point& rPnt_) bRight=false; nAngle=nNewAngle; - double a = nAngle.get() * F_PI18000; + double a = toRadians(nAngle); double nSin1=sin(a); // calculate now, so as little time as possible double nCos1=cos(a); // passes between Hide() and Show() Hide(); @@ -2356,7 +2356,7 @@ void SdrDragShear::MoveSdrDrag(const Point& rPnt) if (bUpSideDown) nNewAngle -= 18000_deg100; if (bNeg) nTmpAngle=-nTmpAngle; bResize=true; - aNewFract = cos(nTmpAngle.get() * F_PI18000); + aNewFract = cos(toRadians(nTmpAngle)); aFact.ReduceInaccurate(10); // three decimals should be enough } @@ -2370,7 +2370,7 @@ void SdrDragShear::MoveSdrDrag(const Point& rPnt) { nAngle=nNewAngle; aFact=aNewFract; - double a = nAngle.get() * F_PI18000; + double a = toRadians(nAngle); double nTan1=tan(a); // calculate now, so as little time as possible passes between Hide() and Show() Hide(); nTan=nTan1; diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx index 852d160ccd98..0cc7cc0019a8 100644 --- a/svx/source/svdraw/svdedtv1.cxx +++ b/svx/source/svdraw/svdedtv1.cxx @@ -310,8 +310,8 @@ void SdrEditView::RotateMarkedObj(const Point& rRef, Degree100 nAngle, bool bCop if (bCopy) CopyMarkedObj(); - double nSin = sin(nAngle.get() * F_PI18000); - double nCos = cos(nAngle.get() * F_PI18000); + double nSin = sin(toRadians(nAngle)); + double nCos = cos(toRadians(nAngle)); const size_t nMarkCount(GetMarkedObjectCount()); if(nMarkCount) @@ -468,7 +468,7 @@ void SdrEditView::ShearMarkedObj(const Point& rRef, Degree100 nAngle, bool bVShe if (bCopy) CopyMarkedObj(); - double nTan = tan(nAngle.get() * F_PI18000); + double nTan = tan(toRadians(nAngle)); const size_t nMarkCount=GetMarkedObjectCount(); for (size_t nm=0; nm<nMarkCount; ++nm) { @@ -559,7 +559,7 @@ void SdrEditView::ImpCrookObj(SdrObject* pO, const Point& rRef, const Point& rRa aCtr1 -= aCtr0; if(bRotOk) - pO->Rotate(aCtr0, Degree100(FRound(nAngle / F_PI18000)), nSin, nCos); + pO->Rotate(aCtr0, Degree100(FRound(basegfx::rad2deg<100>(nAngle))), nSin, nCos); pO->Move(Size(aCtr1.X(),aCtr1.Y())); } @@ -1643,10 +1643,10 @@ void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr, bool addPageMargin } else { if (nNewShearAngle!=0_deg100 && nOldShearAngle!=0_deg100) { // bug fix - double nOld = tan(static_cast<double>(nOldShearAngle.get()) * F_PI18000); - double nNew = tan(static_cast<double>(nNewShearAngle.get()) * F_PI18000); + double nOld = tan(toRadians(nOldShearAngle)); + double nNew = tan(toRadians(nNewShearAngle)); nNew-=nOld; - nNew = atan(nNew) / F_PI18000; + nNew = basegfx::rad2deg<100>(atan(nNew)); nShearAngle=Degree100(FRound(nNew)); } else { nShearAngle=nNewShearAngle-nOldShearAngle; diff --git a/svx/source/svdraw/svdglev.cxx b/svx/source/svdraw/svdglev.cxx index 78c92f778840..67c64eb1a8df 100644 --- a/svx/source/svdraw/svdglev.cxx +++ b/svx/source/svdraw/svdglev.cxx @@ -390,8 +390,8 @@ void SdrGlueEditView::RotateMarkedGluePoints(const Point& rRef, Degree100 nAngle if (bCopy) aStr+=SvxResId(STR_EditWithCopy); BegUndo(aStr,GetDescriptionOfMarkedGluePoints(),SdrRepeatFunc::Rotate); if (bCopy) ImpCopyMarkedGluePoints(); - double nSin = sin(nAngle.get() * F_PI18000); - double nCos = cos(nAngle.get() * F_PI18000); + double nSin = sin(toRadians(nAngle)); + double nCos = cos(toRadians(nAngle)); ImpTransformMarkedGluePoints(ImpRotate,&rRef,&nAngle,&nSin,&nCos); EndUndo(); AdjustMarkHdl(); diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx index d0c61f808ef3..f20daeabac4f 100644 --- a/svx/source/svdraw/svdhdl.cxx +++ b/svx/source/svdraw/svdhdl.cxx @@ -1831,7 +1831,7 @@ void ImpTextframeHdl::CreateB2dIAObject() fTransparence, 3.0, 3.0, - nRotationAngle.get() * -F_PI18000, + -toRadians(nRotationAngle), true)); // allow animation; the Handle is not shown at text edit time pNewOverlayObject->setHittable(false); diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx index ffbfe6456e54..3b1612b15f68 100644 --- a/svx/source/svdraw/svdoashp.cxx +++ b/svx/source/svdraw/svdoashp.cxx @@ -1585,17 +1585,17 @@ void SdrObjCustomShape::NbcRotate( const Point& rRef, Degree100 nAngle, double s maGeo.nRotationAngle = 0_deg100; // resetting aGeo data maGeo.RecalcSinCos(); - tools::Long nW = static_cast<tools::Long>( fObjectRotation * 100 ); // applying our object rotation + Degree100 nW(static_cast<sal_Int32>( fObjectRotation * 100 )); // applying our object rotation if ( bMirroredX ) - nW = 36000 - nW; + nW = 36000_deg100 - nW; if ( bMirroredY ) - nW = 18000 - nW; - nW = nW % 36000; - if ( nW < 0 ) - nW = 36000 + nW; - SdrTextObj::NbcRotate( maRect.TopLeft(), Degree100(nW), // applying text rotation - sin( nW * F_PI18000 ), - cos( nW * F_PI18000 ) ); + nW = 18000_deg100 - nW; + nW = nW % 36000_deg100; + if ( nW < 0_deg100 ) + nW = 36000_deg100 + nW; + SdrTextObj::NbcRotate( maRect.TopLeft(), nW, // applying text rotation + sin( toRadians(nW) ), + cos( toRadians(nW) ) ); int nSwap = 0; if ( bMirroredX ) @@ -3034,7 +3034,7 @@ void SdrObjCustomShape::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, // #i123181# The fix for #121932# here was wrong, the trunk version does not correct the // mirrored shear values, neither at the object level, nor on the API or XML level. Taking // back the mirroring of the shear angle - aGeoStat.nShearAngle = Degree100(FRound(basegfx::rad2deg(atan(fShearX)) * 100.0)); + aGeoStat.nShearAngle = Degree100(FRound(basegfx::rad2deg<100>(atan(fShearX)))); aGeoStat.RecalcTan(); Shear(Point(), aGeoStat.nShearAngle, aGeoStat.mfTanShearAngle, false); } @@ -3047,7 +3047,7 @@ void SdrObjCustomShape::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, // #i78696# // fRotate is mathematically correct, but aGeoStat.nRotationAngle is // mirrored -> mirror value here - aGeoStat.nRotationAngle = NormAngle36000(Degree100(FRound(-fRotate / F_PI18000))); + aGeoStat.nRotationAngle = NormAngle36000(Degree100(FRound(-basegfx::rad2deg<100>(fRotate)))); aGeoStat.RecalcSinCos(); Rotate(Point(), aGeoStat.nRotationAngle, aGeoStat.mfSinRotationAngle, aGeoStat.mfCosRotationAngle); } diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index 35aaebc13f09..957ea2e38ebc 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -1461,7 +1461,7 @@ void SdrObject::NbcRotate(const Point& rRef, Degree100 nAngle) { if (nAngle) { - double a = nAngle.get() * F_PI18000; + double a = toRadians(nAngle); NbcRotate( rRef, nAngle, sin( a ), cos( a ) ); } } @@ -2079,7 +2079,7 @@ void SdrObject::NbcApplyNotPersistAttr(const SfxItemSet& rAttr) Degree100 n=static_cast<const SdrShearAngleItem*>(pPoolItem)->GetValue(); n-=GetShearAngle(); if (n) { - double nTan = tan(n.get() * F_PI18000); + double nTan = tan(toRadians(n)); NbcShear(aRef1,n,nTan,false); } } @@ -2096,12 +2096,12 @@ void SdrObject::NbcApplyNotPersistAttr(const SfxItemSet& rAttr) } if (rAttr.GetItemState(SDRATTR_HORZSHEARONE,true,&pPoolItem)==SfxItemState::SET) { Degree100 n=static_cast<const SdrHorzShearOneItem*>(pPoolItem)->GetValue(); - double nTan = tan(n.get() * F_PI18000); + double nTan = tan(toRadians(n)); NbcShear(aRef1,n,nTan,false); } if (rAttr.GetItemState(SDRATTR_VERTSHEARONE,true,&pPoolItem)==SfxItemState::SET) { Degree100 n=static_cast<const SdrVertShearOneItem*>(pPoolItem)->GetValue(); - double nTan = tan(n.get() * F_PI18000); + double nTan = tan(toRadians(n)); NbcShear(aRef1,n,nTan,true); } diff --git a/svx/source/svdraw/svdocirc.cxx b/svx/source/svdraw/svdocirc.cxx index 4275daa86187..6f320d6d4ae7 100644 --- a/svx/source/svdraw/svdocirc.cxx +++ b/svx/source/svdraw/svdocirc.cxx @@ -56,7 +56,7 @@ static Point GetAnglePnt(const tools::Rectangle& rR, Degree100 nAngle) tools::Long nWdt=rR.Right()-rR.Left(); tools::Long nHgt=rR.Bottom()-rR.Top(); tools::Long nMaxRad=(std::max(nWdt,nHgt)+1) /2; - double a = nAngle.get() * F_PI18000; + double a = toRadians(nAngle); Point aRetval(FRound(cos(a)*nMaxRad),-FRound(sin(a)*nMaxRad)); if (nWdt==0) aRetval.setX(0 ); if (nHgt==0) aRetval.setY(0 ); @@ -261,9 +261,8 @@ basegfx::B2DPolygon SdrCircObj::ImpCalcXPolyCirc(const SdrCircKind eCircleKind, else { // 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) * M_PI); - const double fEnd((((36000 - nStart.get()) % 36000) / 18000.0) * M_PI); + const double fStart(toRadians((36000_deg100 - nEnd) % 36000_deg100)); + const double fEnd(toRadians((36000_deg100 - nStart) % 36000_deg100)); // create circle segment. This is not closed by default aCircPolygon = basegfx::utils::createPolygonFromEllipseSegment( @@ -301,7 +300,7 @@ basegfx::B2DPolygon SdrCircObj::ImpCalcXPolyCirc(const SdrCircKind eCircleKind, // shear, rotate and back to top left (if needed) aMatrix = basegfx::utils::createShearXRotateTranslateB2DHomMatrix( -maGeo.mfTanShearAngle, - maGeo.nRotationAngle ? (36000_deg100 - maGeo.nRotationAngle).get() * F_PI18000 : 0.0, + maGeo.nRotationAngle ? toRadians(36000_deg100 - maGeo.nRotationAngle) : 0.0, aTopLeft) * aMatrix; // apply transformation @@ -885,15 +884,14 @@ void SdrCircObj::NbcMirror(const Point& rRef1, const Point& rRef2) tools::Long nWdt=maRect.GetWidth()-1; tools::Long nHgt=maRect.GetHeight()-1; tools::Long nMaxRad=(std::max(nWdt,nHgt)+1) /2; - double a; // starting point - a = nStartAngle.get() * F_PI18000; + double a = toRadians(nStartAngle); 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.get() * F_PI18000; + a = toRadians(nEndAngle); 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 6c2c4b1860b8..09601cae6f17 100644 --- a/svx/source/svdraw/svdomeas.cxx +++ b/svx/source/svdraw/svdomeas.cxx @@ -429,7 +429,7 @@ void SdrMeasureObj::ImpCalcGeometrics(const ImpMeasureRec& rRec, ImpMeasurePoly& rPol.nArrow2Len=nArrow2Len; rPol.nLineAngle=GetAngle(aDelt); - double a = rPol.nLineAngle.get() * F_PI18000; + double a = toRadians(rPol.nLineAngle); double nLineSin=sin(a); double nLineCos=cos(a); rPol.nLineSin=nLineSin; @@ -873,7 +873,7 @@ OUString SdrMeasureObj::getSpecialDragComment(const SdrDragStat& /*rDrag*/) cons void SdrMeasureObj::ImpEvalDrag(ImpMeasureRec& rRec, const SdrDragStat& rDrag) const { Degree100 nLineAngle=GetAngle(rRec.aPt2-rRec.aPt1); - double a = nLineAngle.get() * F_PI18000; + double a = toRadians(nLineAngle); double nSin=sin(a); double nCos=cos(a); diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx index efeefc79dcea..553c299b9831 100644 --- a/svx/source/svdraw/svdopath.cxx +++ b/svx/source/svdraw/svdopath.cxx @@ -322,20 +322,20 @@ void ImpPathCreateUser::CalcCircle(const Point& rP1, const Point& rP2, const Poi bool bRet=nTmpAngle!=9000_deg100 && nTmpAngle!=27000_deg100; tools::Long nRad=0; if (bRet) { - double cs = cos(nTmpAngle.get() * F_PI18000); + double cs = cos(toRadians(nTmpAngle)); double nR=static_cast<double>(GetLen(Point(dx,dy)))/cs/2; nRad=std::abs(FRound(nR)); } if (dAngle<18000_deg100) { nCircStAngle=NormAngle36000(nTangAngle-9000_deg100); nCircRelAngle=NormAngle36000(2_deg100*dAngle); - aCircCenter.AdjustX(FRound(nRad * cos((nTangAngle.get() + 9000) * F_PI18000))); - aCircCenter.AdjustY(-(FRound(nRad * sin((nTangAngle.get() + 9000) * F_PI18000)))); + aCircCenter.AdjustX(FRound(nRad * cos(toRadians(nTangAngle + 9000_deg100)))); + aCircCenter.AdjustY(-(FRound(nRad * sin(toRadians(nTangAngle + 9000_deg100))))); } else { nCircStAngle=NormAngle36000(nTangAngle+9000_deg100); nCircRelAngle=-NormAngle36000(36000_deg100-2_deg100*dAngle); - aCircCenter.AdjustX(FRound(nRad * cos((nTangAngle.get() - 9000) * F_PI18000))); - aCircCenter.AdjustY(-(FRound(nRad * sin((nTangAngle.get() - 9000) * F_PI18000)))); + aCircCenter.AdjustX(FRound(nRad * cos(toRadians(nTangAngle - 9000_deg100)))); + aCircCenter.AdjustY(-(FRound(nRad * sin(toRadians(nTangAngle - 9000_deg100))))); } bAngleSnap=pView!=nullptr && pView->IsAngleSnapEnabled(); if (bAngleSnap) { @@ -453,7 +453,7 @@ void ImpPathCreateUser::CalcRect(const Point& rP1, const Point& rP2, const Point tools::Long nHypLen=aTmpPt.Y()-y; Degree100 nTangAngle=-GetAngle(rDir); // sin=g/h, g=h*sin - double a = nTangAngle.get() * F_PI18000; + double a = toRadians(nTangAngle); double sn=sin(a); double cs=cos(a); double nGKathLen=nHypLen*sn; @@ -2305,7 +2305,7 @@ void SdrPathObj::NbcRotate(const Point& rRef, Degree100 nAngle, double sn, doubl { // Thank JOE, the angles are defined mirrored to the mathematical meanings const basegfx::B2DHomMatrix aTrans( - basegfx::utils::createRotateAroundPoint(rRef.X(), rRef.Y(), -nAngle.get() * F_PI18000)); + basegfx::utils::createRotateAroundPoint(rRef.X(), rRef.Y(), -toRadians(nAngle))); maPathPolygon.transform(aTrans); // #i19871# first modify locally, then call parent (to get correct SnapRect with GluePoints) @@ -2819,14 +2819,14 @@ bool SdrPathObj::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DP if(maGeo.nShearAngle || maGeo.nRotationAngle) { // get rotate and shear in drawingLayer notation - fRotate = maGeo.nRotationAngle.get() * F_PI18000; - fShearX = maGeo.nShearAngle.get() * F_PI18000; + fRotate = toRadians(maGeo.nRotationAngle); + fShearX = toRadians(maGeo.nShearAngle); // build mathematically correct (negative shear and rotate) object transform // containing shear and rotate to extract unsheared, unrotated polygon basegfx::B2DHomMatrix aObjectMatrix; aObjectMatrix.shearX(-maGeo.mfTanShearAngle); - aObjectMatrix.rotate((36000 - maGeo.nRotationAngle.get()) * F_PI18000); + aObjectMatrix.rotate(toRadians(36000_deg100 - maGeo.nRotationAngle)); // create inverse from it and back-transform polygon basegfx::B2DHomMatrix aInvObjectMatrix(aObjectMatrix); @@ -2962,7 +2962,7 @@ void SdrPathObj::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const b if(!basegfx::fTools::equalZero(fShearX)) { aTransform.shearX(tan(-atan(fShearX))); - maGeo.nShearAngle = Degree100(FRound(atan(fShearX) / F_PI18000)); + maGeo.nShearAngle = Degree100(FRound(basegfx::rad2deg<100>(atan(fShearX)))); maGeo.RecalcTan(); } @@ -2976,7 +2976,7 @@ void SdrPathObj::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const b // #i78696# // fRotate is mathematically correct, but aGeoStat.nRotationAngle is // mirrored -> mirror value here - maGeo.nRotationAngle = NormAngle36000(Degree100(FRound(-fRotate / F_PI18000))); + maGeo.nRotationAngle = NormAngle36000(Degree100(FRound(-basegfx::rad2deg<100>(fRotate)))); maGeo.RecalcSinCos(); } diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index be570fff6089..30c5524288e9 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -577,7 +577,7 @@ void SdrTextObj::ImpSetContourPolygon( SdrOutliner& rOutliner, tools::Rectangle if(maGeo.nRotationAngle) { // Unrotate! - aMatrix.rotate(-maGeo.nRotationAngle.get() * F_PI18000); + aMatrix.rotate(-toRadians(maGeo.nRotationAngle)); } aXorPolyPolygon.transform(aMatrix); @@ -1649,7 +1649,7 @@ void SdrTextObj::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const b if(!basegfx::fTools::equalZero(fShearX)) { GeoStat aGeoStat; - aGeoStat.nShearAngle = Degree100(FRound(basegfx::rad2deg(atan(fShearX)) * 100.0)); + aGeoStat.nShearAngle = Degree100(FRound(basegfx::rad2deg<100>(atan(fShearX)))); aGeoStat.RecalcTan(); Shear(Point(), aGeoStat.nShearAngle, aGeoStat.mfTanShearAngle, false); } @@ -1662,7 +1662,7 @@ void SdrTextObj::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const b // #i78696# // fRotate is matematically correct, but aGeoStat.nRotationAngle is // mirrored -> mirror value here - aGeoStat.nRotationAngle = NormAngle36000(Degree100(FRound(-fRotate / F_PI18000))); + aGeoStat.nRotationAngle = NormAngle36000(Degree100(FRound(-basegfx::rad2deg<100>(fRotate)))); aGeoStat.RecalcSinCos(); Rotate(Point(), aGeoStat.nRotationAngle, aGeoStat.mfSinRotationAngle, aGeoStat.mfCosRotationAngle); } diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index ce6fa2206326..607a2546d1d5 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -176,7 +176,7 @@ namespace // apply font rotate if(rInfo.mrFont.GetOrientation()) { - aNewTransform.rotate(-rInfo.mrFont.GetOrientation().get() * F_PI1800); + aNewTransform.rotate(-toRadians(rInfo.mrFont.GetOrientation())); } // look for escapement, if necessary, translate accordingly diff --git a/svx/source/svdraw/svdotextpathdecomposition.cxx b/svx/source/svdraw/svdotextpathdecomposition.cxx index 8f04b356cef7..42d332c53420 100644 --- a/svx/source/svdraw/svdotextpathdecomposition.cxx +++ b/svx/source/svdraw/svdotextpathdecomposition.cxx @@ -379,7 +379,7 @@ namespace else // XFormTextShadow::Slant { double fScaleValue(maSdrFormTextAttribute.getFormTextShdwYVal() / 100.0); - double fShearValue(-maSdrFormTextAttribute.getFormTextShdwXVal() * F_PI1800); + double fShearValue(-basegfx::deg2rad<10>(maSdrFormTextAttribute.getFormTextShdwXVal())); aNewShadowTransform.scale(1.0, fScaleValue); aNewShadowTransform.shearX(sin(fShearValue)); diff --git a/svx/source/svdraw/svdpoev.cxx b/svx/source/svdraw/svdpoev.cxx index f6fafcf088d6..bcf9168a47cf 100644 --- a/svx/source/svdraw/svdpoev.cxx +++ b/svx/source/svdraw/svdpoev.cxx @@ -642,8 +642,8 @@ void SdrPolyEditView::RotateMarkedPoints(const Point& rRef, Degree100 nAngle) ForceUndirtyMrkPnt(); OUString aStr(SvxResId(STR_EditResize)); BegUndo(aStr,GetDescriptionOfMarkedPoints(),SdrRepeatFunc::Rotate); - double nSin = sin(nAngle.get() * F_PI18000); - double nCos = cos(nAngle.get() * F_PI18000); + double nSin = sin(toRadians(nAngle)); + double nCos = cos(toRadians(nAngle)); ImpTransformMarkedPoints(ImpRotate,&rRef,&nAngle,&nSin,&nCos); EndUndo(); AdjustMarkHdl(); diff --git a/svx/source/svdraw/svdtrans.cxx b/svx/source/svdraw/svdtrans.cxx index 6af3a49ea873..c0a8aa2605f7 100644 --- a/svx/source/svdraw/svdtrans.cxx +++ b/svx/source/svdraw/svdtrans.cxx @@ -128,7 +128,7 @@ void MirrorPoint(Point& rPnt, const Point& rRef1, const Point& rRef2) rPnt-=rRef1; Degree100 nPntAngle=GetAngle(rPnt); Degree100 nAngle=2_deg100*(nRefAngle-nPntAngle); - double a = nAngle.get() * F_PI18000; + double a = toRadians(nAngle); double nSin=sin(a); double nCos=cos(a); RotatePoint(rPnt,Point(),nSin,nCos); @@ -393,8 +393,7 @@ Degree100 GetAngle(const Point& rPnt) if (rPnt.Y()>0) a=-9000_deg100; else a=9000_deg100; } else { - a = Degree100(FRound(atan2(static_cast<double>(-rPnt.Y()), static_cast<double>(rPnt.X())) - / F_PI18000)); + a = Degree100(FRound(basegfx::rad2deg<100>(atan2(static_cast<double>(-rPnt.Y()), static_cast<double>(rPnt.X()))))); } return a; } @@ -456,7 +455,7 @@ void GeoStat::RecalcSinCos() mfSinRotationAngle=0.0; mfCosRotationAngle=1.0; } else { - double a = nRotationAngle.get() * F_PI18000; + double a = toRadians(nRotationAngle); mfSinRotationAngle=sin(a); mfCosRotationAngle=cos(a); } @@ -467,7 +466,7 @@ void GeoStat::RecalcTan() if (nShearAngle==0_deg100) { mfTanShearAngle=0.0; } else { - double a = nShearAngle.get() * F_PI18000; + double a = toRadians(nShearAngle); mfTanShearAngle=tan(a); } } diff --git a/svx/source/table/viewcontactoftableobj.cxx b/svx/source/table/viewcontactoftableobj.cxx index 88b2071b2363..a79882e03a52 100644 --- a/svx/source/table/viewcontactoftableobj.cxx +++ b/svx/source/table/viewcontactoftableobj.cxx @@ -373,7 +373,7 @@ namespace sdr::contact // create object matrix const GeoStat& rGeoStat(rTableObj.GetGeoStat()); const double fShearX(-rGeoStat.mfTanShearAngle); - const double fRotate(rGeoStat.nRotationAngle ? (36000 - rGeoStat.nRotationAngle.get()) * F_PI18000 : 0.0); + const double fRotate(rGeoStat.nRotationAngle ? toRadians(36000_deg100 - rGeoStat.nRotationAngle) : 0.0); const basegfx::B2DHomMatrix aObjectMatrix(basegfx::utils::createScaleShearXRotateTranslateB2DHomMatrix( aObjectRange.getWidth(), aObjectRange.getHeight(), fShearX, fRotate, aObjectRange.getMinX(), aObjectRange.getMinY())); @@ -437,7 +437,7 @@ namespace sdr::contact // create object matrix const GeoStat& rGeoStat(rTableObj.GetGeoStat()); const double fShearX(-rGeoStat.mfTanShearAngle); - const double fRotate(rGeoStat.nRotationAngle ? (36000 - rGeoStat.nRotationAngle.get()) * F_PI18000 : 0.0); + const double fRotate(rGeoStat.nRotationAngle ? toRadians(36000_deg100 - rGeoStat.nRotationAngle) : 0.0); const basegfx::B2DHomMatrix aObjectMatrix(basegfx::utils::createScaleShearXRotateTranslateB2DHomMatrix( aObjectRange.getWidth(), aObjectRange.getHeight(), fShearX, fRotate, aObjectRange.getMinX(), aObjectRange.getMinY())); diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index 5965bb11cd2a..98a104c49fc8 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -2326,8 +2326,8 @@ bool SvxShape::setPropertyValueImpl( const OUString&, const SfxItemPropertyMapEn nAngle -= GetSdrObject()->GetRotateAngle(); if (nAngle) { - double nSin = sin(nAngle.get() * F_PI18000); - double nCos = cos(nAngle.get() * F_PI18000); + double nSin = sin(toRadians(nAngle)); + double nCos = cos(toRadians(nAngle)); GetSdrObject()->Rotate(aRef1,nAngle,nSin,nCos); } return true; @@ -2346,7 +2346,7 @@ bool SvxShape::setPropertyValueImpl( const OUString&, const SfxItemPropertyMapEn if(nShear) { Point aRef1(GetSdrObject()->GetSnapRect().Center()); - double nTan = tan(nShear.get() * F_PI18000); + double nTan = tan(toRadians(nShear)); GetSdrObject()->Shear(aRef1,nShear,nTan,false); return true; } diff --git a/svx/source/xoutdev/xtabgrdt.cxx b/svx/source/xoutdev/xtabgrdt.cxx index 5010ff2e49bd..76438afdcb9a 100644 --- a/svx/source/xoutdev/xtabgrdt.cxx +++ b/svx/source/xoutdev/xtabgrdt.cxx @@ -158,7 +158,7 @@ BitmapEx XGradientList::CreateBitmap( tools::Long nIndex, const Size& rSize ) co static_cast<double>(rGradient.GetBorder()) * 0.01, static_cast<double>(rGradient.GetXOffset()) * 0.01, static_cast<double>(rGradient.GetYOffset()) * 0.01, - static_cast<double>(rGradient.GetAngle().get()) * F_PI1800, + toRadians(rGradient.GetAngle()), aStart, aEnd); diff --git a/svx/source/xoutdev/xtabhtch.cxx b/svx/source/xoutdev/xtabhtch.cxx index 19bc8b737887..f71540012b93 100644 --- a/svx/source/xoutdev/xtabhtch.cxx +++ b/svx/source/xoutdev/xtabhtch.cxx @@ -119,7 +119,7 @@ BitmapEx XHatchList::CreateBitmap( tools::Long nIndex, const Size& rSize) const const drawinglayer::attribute::FillHatchAttribute aFillHatch( aHatchStyle, static_cast<double>(rHatch.GetDistance()) * fScaleValue, - static_cast<double>(rHatch.GetAngle().get()) * F_PI1800, + toRadians(rHatch.GetAngle()), rHatch.GetColor().getBColor(), 3, // same default as VCL, a minimum of three discrete units (pixels) offset false); |