diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2020-12-30 09:30:07 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-01-01 07:33:08 +0100 |
commit | 303de624f43cea9d0ead26d535e643328aa1e45f (patch) | |
tree | cfefe9c87a3357fd83e3f748d2e64f8494c7cb9f /svx | |
parent | 5a94a20229a1bd82a39006012694cdc9f02ffa31 (diff) |
use more NbcRotate utility method
Change-Id: I74330033c1540c4ed8633dd176a88ed5cacb7c6b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108517
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/svdraw/svdfmtf.cxx | 5 | ||||
-rw-r--r-- | svx/source/svdraw/svdobj.cxx | 12 | ||||
-rw-r--r-- | svx/source/svdraw/svdpdf.cxx | 5 |
3 files changed, 5 insertions, 17 deletions
diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx index 278b93c407a1..31624873f234 100644 --- a/svx/source/svdraw/svdfmtf.cxx +++ b/svx/source/svdraw/svdfmtf.cxx @@ -1057,10 +1057,7 @@ void ImpSdrGDIMetaFileImport::ImportText( const Point& rPos, const OUString& rSt if ( nAngle ) { nAngle*=10; - double a = nAngle * F_PI18000; - double nSin=sin(a); - double nCos=cos(a); - pText->NbcRotate(aPos,nAngle,nSin,nCos); + pText->SdrAttrObj::NbcRotate(aPos,nAngle); } InsertObj( pText, false ); } diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index 44fa531177cb..3dafbfe39d4b 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -1403,9 +1403,7 @@ void SdrObject::NbcResize(const Point& rRef, const Fraction& xFact, const Fracti void SdrObject::NbcRotate(const Point& rRef, tools::Long nAngle) { - if (nAngle == 0) - NbcRotate( rRef, nAngle, 0.0, 1.0 ); - else + if (nAngle) { double a = nAngle * F_PI18000; NbcRotate( rRef, nAngle, sin( a ), cos( a ) ); @@ -2013,16 +2011,12 @@ void SdrObject::NbcApplyNotPersistAttr(const SfxItemSet& rAttr) tools::Long n=static_cast<const SdrAngleItem*>(pPoolItem)->GetValue(); n-=GetRotateAngle(); if (n!=0) { - double nSin = sin(n * F_PI18000); - double nCos = cos(n * F_PI18000); - NbcRotate(aRef1,n,nSin,nCos); + NbcRotate(aRef1,n); } } if (rAttr.GetItemState(SDRATTR_ROTATEONE,true,&pPoolItem)==SfxItemState::SET) { tools::Long n=static_cast<const SdrRotateOneItem*>(pPoolItem)->GetValue(); - double nSin = sin(n * F_PI18000); - double nCos = cos(n * F_PI18000); - NbcRotate(aRef1,n,nSin,nCos); + NbcRotate(aRef1,n); } if (rAttr.GetItemState(SDRATTR_HORZSHEARONE,true,&pPoolItem)==SfxItemState::SET) { tools::Long n=static_cast<const SdrHorzShearOneItem*>(pPoolItem)->GetValue(); diff --git a/svx/source/svdraw/svdpdf.cxx b/svx/source/svdraw/svdpdf.cxx index e1ae905cef33..f9115175ce39 100644 --- a/svx/source/svdraw/svdpdf.cxx +++ b/svx/source/svdraw/svdpdf.cxx @@ -845,10 +845,7 @@ void ImpSdrPdfImport::InsertTextObject(const Point& rPos, const Size& rSize, con if (nAngle) { nAngle *= 10; - double a = nAngle * F_PI18000; - double nSin = sin(a); - double nCos = cos(a); - pText->NbcRotate(aPosition, nAngle, nSin, nCos); + pText->SdrAttrObj::NbcRotate(aPosition, nAngle); } InsertObj(pText, false); } |