drawinglayer/source/tools/emfphelperdata.cxx |   12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

New commits:
commit 12e23067fd0acad3e06df50cefaa0a2cd73df3b5
Author:     Bartosz Kosiorek <gan...@poczta.onet.pl>
AuthorDate: Mon Apr 24 05:08:00 2023 +0200
Commit:     Bartosz Kosiorek <gan...@poczta.onet.pl>
CommitDate: Mon Apr 24 08:24:09 2023 +0200

    EMF+ Minor optimization and clean up code of DrawBeziers
    
    Change-Id: Id560b3d3a6182270853fd05a6f2d1e44452c0013
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150894
    Tested-by: Jenkins
    Reviewed-by: Bartosz Kosiorek <gan...@poczta.onet.pl>

diff --git a/drawinglayer/source/tools/emfphelperdata.cxx 
b/drawinglayer/source/tools/emfphelperdata.cxx
index 94c4c32f026f..a1e9b3b7adce 100644
--- a/drawinglayer/source/tools/emfphelperdata.cxx
+++ b/drawinglayer/source/tools/emfphelperdata.cxx
@@ -1340,7 +1340,6 @@ namespace emfplushelper
                     {
                         sal_uInt32 aCount;
                         float x1, y1, x2, y2, x3, y3, x4, y4;
-                        ::basegfx::B2DPoint aStartPoint, aControlPointA, 
aControlPointB, aEndPoint;
                         ::basegfx::B2DPolygon aPolygon;
                         rMS.ReadUInt32(aCount);
                         SAL_INFO("drawinglayer.emf", "EMF+\t DrawBeziers slot: 
" << (flags & 0xff));
@@ -1359,8 +1358,7 @@ namespace emfplushelper
 
                         ReadPoint(rMS, x1, y1, flags);
                         // We need to add first starting point
-                        aStartPoint = Map(x1, y1);
-                        aPolygon.append(aStartPoint);
+                        aPolygon.append(Map(x1, y1));
                         SAL_INFO("drawinglayer.emf",
                                  "EMF+\t Bezier starting point: " << x1 << "," 
<< y1);
                         for (sal_uInt32 i = 4; i <= aCount; i += 3)
@@ -1372,13 +1370,7 @@ namespace emfplushelper
                             SAL_INFO("drawinglayer.emf",
                                      "EMF+\t Bezier points: " << x2 << "," << 
y2 << " " << x3 << ","
                                                               << y3 << " " << 
x4 << "," << y4);
-
-                            aControlPointA = Map(x2, y2);
-                            aControlPointB = Map(x3, y3);
-                            aEndPoint = Map(x4, y4);
-                            aPolygon.appendBezierSegment(aControlPointA, 
aControlPointB, aEndPoint);
-                            // The ending coordinate of one Bezier curve is 
the starting coordinate of the next.
-                            aStartPoint = aEndPoint;
+                            aPolygon.appendBezierSegment(Map(x2, y2), Map(x3, 
y3), Map(x4, y4));
                         }
                         
EMFPPlusDrawPolygon(::basegfx::B2DPolyPolygon(aPolygon), flags & 0xff);
                         break;

Reply via email to