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

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Sun Jan 3 16:18:20 UTC 2021


 filter/source/msfilter/msdffimp.cxx |    2 -
 include/svx/xpoly.hxx               |    6 ++---
 sd/source/ui/func/fucon3d.cxx       |    4 +--
 svx/source/svdraw/svdopath.cxx      |    4 +--
 svx/source/xoutdev/_xpoly.cxx       |   38 ++++++++++++++++++------------------
 5 files changed, 27 insertions(+), 27 deletions(-)

New commits:
commit 2eee8df0e89b7b2a156769c2ebdd562bf4d21f62
Author:     Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Sun Jan 3 15:05:00 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sun Jan 3 17:17:42 2021 +0100

    Degree10->Degree100 in XPolygon
    
    Since some of the call sites are passing in Degree100,
    let us preserve that accuracy.
    
    Change-Id: Idfc9c6dfcbc9e164085aacd0c775eac929f33d4c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108631
    Tested-by: Jenkins
    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 bddc9c2552c2..8129998aac6a 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -886,7 +886,7 @@ static basegfx::B2DPolyPolygon GetLineArrow( const sal_Int32 nLineWidth, const s
                                 Point( static_cast<sal_Int32>( fWidthMul * fLineWidth * 0.50 ), 0 ),
                                 static_cast<sal_Int32>( fWidthMul * fLineWidth * 0.50 ),
                                 static_cast<sal_Int32>( fLengthMul * fLineWidth * 0.50 ),
-                                0_deg10, 3600_deg10 ).getB2DPolygon() );
+                                0_deg100, 36000_deg100 ).getB2DPolygon() );
             rbArrowCenter = true;
             aArrowName.append("msArrowOvalEnd ");
         }
diff --git a/include/svx/xpoly.hxx b/include/svx/xpoly.hxx
index a2074ef8e42d..23a87341d807 100644
--- a/include/svx/xpoly.hxx
+++ b/include/svx/xpoly.hxx
@@ -49,9 +49,9 @@ class SVXCORE_DLLPUBLIC XPolygon final
     // auxiliary functions for Bezier conversion
     void    SubdivideBezier(sal_uInt16 nPos, bool bCalcFirst, double fT);
     void    GenBezArc(const Point& rCenter, tools::Long nRx, tools::Long nRy,
-                      tools::Long nXHdl, tools::Long nYHdl, Degree10 nStart, Degree10 nEnd,
+                      tools::Long nXHdl, tools::Long nYHdl, Degree100 nStart, Degree100 nEnd,
                       sal_uInt16 nQuad, sal_uInt16 nFirst);
-    static bool CheckAngles(Degree10& nStart, Degree10 nEnd, Degree10& nA1, Degree10& nA2);
+    static bool CheckAngles(Degree100& nStart, Degree100 nEnd, Degree100& nA1, Degree100& nA2);
 
 public:
     XPolygon( sal_uInt16 nSize=16 );
@@ -60,7 +60,7 @@ public:
     XPolygon( const tools::Polygon& rPoly );
     XPolygon( const tools::Rectangle& rRect, tools::Long nRx = 0, tools::Long nRy = 0 );
     XPolygon( const Point& rCenter, tools::Long nRx, tools::Long nRy,
-              Degree10 nStartAngle = 0_deg10, Degree10 nEndAngle = 3600_deg10,
+              Degree100 nStartAngle = 0_deg100, Degree100 nEndAngle = 36000_deg100,
               bool bClose = true );
 
     ~XPolygon();
diff --git a/sd/source/ui/func/fucon3d.cxx b/sd/source/ui/func/fucon3d.cxx
index 119ca5779716..32ec30b8fc48 100644
--- a/sd/source/ui/func/fucon3d.cxx
+++ b/sd/source/ui/func/fucon3d.cxx
@@ -107,7 +107,7 @@ E3dCompoundObject* FuConstruct3dObject::ImpCreateBasic3DShape()
 
         case SID_3D_SHELL:
         {
-            XPolygon aXPoly(Point (0, 1250), 2500, 2500, 0_deg10, 900_deg10, false);
+            XPolygon aXPoly(Point (0, 1250), 2500, 2500, 0_deg100, 9000_deg100, false);
             aXPoly.Scale(5.0, 5.0);
 
             ::basegfx::B2DPolygon aB2DPolygon(aXPoly.getB2DPolygon());
@@ -128,7 +128,7 @@ E3dCompoundObject* FuConstruct3dObject::ImpCreateBasic3DShape()
 
         case SID_3D_HALF_SPHERE:
         {
-            XPolygon aXPoly(Point (0, 1250), 2500, 2500, 0_deg10, 900_deg10, false);
+            XPolygon aXPoly(Point (0, 1250), 2500, 2500, 0_deg100, 9000_deg100, false);
             aXPoly.Scale(5.0, 5.0);
 
             aXPoly.Insert(0, Point (2400*5, 1250*5), PolyFlags::Normal);
diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx
index b7655a4a7b00..c9e4a55071a3 100644
--- a/svx/source/svdraw/svdopath.cxx
+++ b/svx/source/svdraw/svdopath.cxx
@@ -357,13 +357,13 @@ XPolygon ImpPathCreateUser::GetCirclePoly() const
 {
     if (nCircRelAngle>=0_deg100) {
         XPolygon aXP(aCircCenter,nCircRadius,nCircRadius,
-                     toDegree10(nCircStAngle), toDegree10(nCircStAngle+nCircRelAngle),false);
+                     nCircStAngle, nCircStAngle+nCircRelAngle,false);
         aXP[0]=aCircStart; aXP.SetFlags(0,PolyFlags::Smooth);
         if (!bAngleSnap) aXP[aXP.GetPointCount()-1]=aCircEnd;
         return aXP;
     } else {
         XPolygon aXP(aCircCenter,nCircRadius,nCircRadius,
-                     toDegree10(NormAngle36000(nCircStAngle+nCircRelAngle)), toDegree10(nCircStAngle),false);
+                     NormAngle36000(nCircStAngle+nCircRelAngle), nCircStAngle,false);
         sal_uInt16 nCount=aXP.GetPointCount();
         for (sal_uInt16 nNum=nCount/2; nNum>0;) {
             nNum--; // reverse XPoly's order of points
diff --git a/svx/source/xoutdev/_xpoly.cxx b/svx/source/xoutdev/_xpoly.cxx
index 65b64650dd48..43c4dfb64605 100644
--- a/svx/source/xoutdev/_xpoly.cxx
+++ b/svx/source/xoutdev/_xpoly.cxx
@@ -261,7 +261,7 @@ XPolygon::XPolygon(const tools::Rectangle& rRect, tools::Long nRx, tools::Long n
                         aCenter.AdjustY( -nRy );
                         break;
             }
-            GenBezArc(aCenter, nRx, nRy, nXHdl, nYHdl, 0_deg10, 900_deg10, nQuad, nPos);
+            GenBezArc(aCenter, nRx, nRy, nXHdl, nYHdl, 0_deg100, 9000_deg100, nQuad, nPos);
             pImpXPolygon->pFlagAry[nPos  ] = PolyFlags::Smooth;
             pImpXPolygon->pFlagAry[nPos+3] = PolyFlags::Smooth;
             nPos += 4;
@@ -280,12 +280,12 @@ XPolygon::XPolygon(const tools::Rectangle& rRect, tools::Long nRx, tools::Long n
 
 /// create an ellipse (curve) as Bézier polygon
 XPolygon::XPolygon(const Point& rCenter, tools::Long nRx, tools::Long nRy,
-                   Degree10 nStartAngle, Degree10 nEndAngle, bool bClose)
+                   Degree100 nStartAngle, Degree100 nEndAngle, bool bClose)
     : pImpXPolygon( 17 )
 {
-    nStartAngle %= 3600_deg10;
-    if ( nEndAngle > 3600_deg10 ) nEndAngle %= 3600_deg10;
-    bool bFull = (nStartAngle == 0_deg10 && nEndAngle == 3600_deg10);
+    nStartAngle %= 36000_deg100;
+    if ( nEndAngle > 36000_deg100 ) nEndAngle %= 36000_deg100;
+    bool bFull = (nStartAngle == 0_deg100 && nEndAngle == 36000_deg100);
 
     // factor for control points of the Bézier curve: 8/3 * (sin(45g) - 0.5)
     tools::Long    nXHdl = static_cast<tools::Long>(0.552284749 * nRx);
@@ -295,8 +295,8 @@ XPolygon::XPolygon(const Point& rCenter, tools::Long nRx, tools::Long nRy,
 
     do
     {
-        Degree10 nA1, nA2;
-        sal_uInt16 nQuad = nStartAngle.get() / 900;
+        Degree100 nA1, nA2;
+        sal_uInt16 nQuad = nStartAngle.get() / 9000;
         if ( nQuad == 4 ) nQuad = 0;
         bLoopEnd = CheckAngles(nStartAngle, nEndAngle, nA1, nA2);
         GenBezArc(rCenter, nRx, nRy, nXHdl, nYHdl, nA1, nA2, nQuad, nPos);
@@ -537,7 +537,7 @@ void XPolygon::SubdivideBezier(sal_uInt16 nPos, bool bCalcFirst, double fT)
 
 /// Generate a Bézier arc
 void XPolygon::GenBezArc(const Point& rCenter, tools::Long nRx, tools::Long nRy,
-                         tools::Long nXHdl, tools::Long nYHdl, Degree10 nStart, Degree10 nEnd,
+                         tools::Long nXHdl, tools::Long nYHdl, Degree100 nStart, Degree100 nEnd,
                          sal_uInt16 nQuad, sal_uInt16 nFirst)
 {
     Point* pPoints = pImpXPolygon->pPointAry.get();
@@ -576,23 +576,23 @@ void XPolygon::GenBezArc(const Point& rCenter, tools::Long nRx, tools::Long nRy,
         pPoints[nFirst+1].AdjustX( nXHdl );
         pPoints[nFirst+2].AdjustY( nYHdl );
     }
-    if ( nStart > 0_deg10 )
-        SubdivideBezier(nFirst, false, static_cast<double>(nStart.get()) / 900);
-    if ( nEnd < 900_deg10 )
-        SubdivideBezier(nFirst, true, static_cast<double>((nEnd-nStart).get()) / (900_deg10-nStart).get());
+    if ( nStart > 0_deg100 )
+        SubdivideBezier(nFirst, false, static_cast<double>(nStart.get()) / 9000);
+    if ( nEnd < 9000_deg100 )
+        SubdivideBezier(nFirst, true, static_cast<double>((nEnd-nStart).get()) / (9000_deg100-nStart).get());
     SetFlags(nFirst+1, PolyFlags::Control);
     SetFlags(nFirst+2, PolyFlags::Control);
 }
 
-bool XPolygon::CheckAngles(Degree10& nStart, Degree10 nEnd, Degree10& nA1, Degree10& nA2)
+bool XPolygon::CheckAngles(Degree100& nStart, Degree100 nEnd, Degree100& nA1, Degree100& nA2)
 {
-    if ( nStart == 3600_deg10 ) nStart = 0_deg10;
-    if ( nEnd == 0_deg10 ) nEnd = 3600_deg10;
-    Degree10 nStPrev = nStart;
-    Degree10 nMax((nStart.get() / 900 + 1) * 900);
-    Degree10 nMin = nMax - 900_deg10;
+    if ( nStart == 36000_deg100 ) nStart = 0_deg100;
+    if ( nEnd == 0_deg100 ) nEnd = 36000_deg100;
+    Degree100 nStPrev = nStart;
+    Degree100 nMax((nStart.get() / 9000 + 1) * 9000);
+    Degree100 nMin = nMax - 9000_deg100;
 
-    if ( nEnd >= nMax || nEnd <= nStart )   nA2 = 900_deg10;
+    if ( nEnd >= nMax || nEnd <= nStart )   nA2 = 9000_deg100;
     else                                    nA2 = nEnd - nMin;
     nA1 = nStart - nMin;
     nStart = nMax;


More information about the Libreoffice-commits mailing list