[Libreoffice-commits] core.git: filter/source svx/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Fri Jan 1 06:33:51 UTC 2021


 filter/source/msfilter/msdffimp.cxx |    3 +--
 svx/source/svdraw/svdfmtf.cxx       |    5 +----
 svx/source/svdraw/svdobj.cxx        |   12 +++---------
 svx/source/svdraw/svdpdf.cxx        |    5 +----
 4 files changed, 6 insertions(+), 19 deletions(-)

New commits:
commit 303de624f43cea9d0ead26d535e643328aa1e45f
Author:     Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Wed Dec 30 09:30:07 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Jan 1 07:33:08 2021 +0100

    use more NbcRotate utility method
    
    Change-Id: I74330033c1540c4ed8633dd176a88ed5cacb7c6b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108517
    Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index b94289983417..bed7bdcc283d 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -5428,8 +5428,7 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
                 Point aPivot(rTextRect.TopLeft());
                 aPivot.AdjustX(nMinWH );
                 aPivot.AdjustY(nMinWH );
-                double a = nTextRotationAngle * F_PI18000;
-                pTextObj->NbcRotate(aPivot, nTextRotationAngle, sin(a), cos(a));
+                pTextObj->SdrAttrObj::NbcRotate(aPivot, nTextRotationAngle);
             }
 
             // rotate text with shape?
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);
 }


More information about the Libreoffice-commits mailing list