From 303de624f43cea9d0ead26d535e643328aa1e45f Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 30 Dec 2020 09:30:07 +0200 Subject: use more NbcRotate utility method Change-Id: I74330033c1540c4ed8633dd176a88ed5cacb7c6b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108517 Tested-by: Noel Grandin Reviewed-by: Noel Grandin --- svx/source/svdraw/svdfmtf.cxx | 5 +---- svx/source/svdraw/svdobj.cxx | 12 +++--------- svx/source/svdraw/svdpdf.cxx | 5 +---- 3 files changed, 5 insertions(+), 17 deletions(-) (limited to 'svx') 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(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(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(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); } -- cgit