diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-10-28 16:12:28 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-10-29 06:50:51 +0200 |
commit | 1a58461bfa3e980f3113a8a16c09cddda0606e7b (patch) | |
tree | 7be7c682771b48cc9e49ae914cbcdacf60f454de /canvas/workben | |
parent | f6aef99057c08490af49aec0fd5f2601a83c4e76 (diff) |
Prepare for removal of non-const operator[] from Sequence in canvas
Change-Id: Ifb96e496b0994b5fc66975b7aea0a60bcb4a3a03
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124345
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'canvas/workben')
-rw-r--r-- | canvas/workben/canvasdemo.cxx | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/canvas/workben/canvasdemo.cxx b/canvas/workben/canvasdemo.cxx index 8efdee81f36a..031068adf9e9 100644 --- a/canvas/workben/canvasdemo.cxx +++ b/canvas/workben/canvasdemo.cxx @@ -211,27 +211,28 @@ class DemoRenderer int nLength = SAL_N_ELEMENTS( hilbert ); uno::Sequence< geometry::RealPoint2D > aPoints( nLength ); + auto pPoints = aPoints.getArray(); uno::Reference< rendering::XLinePolyPolygon2D > xPoly; - aPoints[0] = geometry::RealPoint2D( anchor_x, anchor_y ); + pPoints[0] = geometry::RealPoint2D( anchor_x, anchor_y ); for (int i = 0; i < nLength; i++ ) { switch( hilbert[i] ) { case 'u': - aPoints[i+1] = geometry::RealPoint2D( aPoints[i].X, + pPoints[i+1] = geometry::RealPoint2D( aPoints[i].X, aPoints[i].Y - SCALE ); break; case 'd': - aPoints[i+1] = geometry::RealPoint2D( aPoints[i].X, + pPoints[i+1] = geometry::RealPoint2D( aPoints[i].X, aPoints[i].Y + SCALE ); break; case 'l': - aPoints[i+1] = geometry::RealPoint2D( aPoints[i].X - SCALE, + pPoints[i+1] = geometry::RealPoint2D( aPoints[i].X - SCALE, aPoints[i].Y ); break; case 'r': - aPoints[i+1] = geometry::RealPoint2D( aPoints[i].X + SCALE, + pPoints[i+1] = geometry::RealPoint2D( aPoints[i].X + SCALE, aPoints[i].Y ); break; } @@ -385,10 +386,11 @@ class DemoRenderer //hacky hack hack uno::Sequence< geometry::RealBezierSegment2D > aBeziers (num_curves); + auto pBeziers = aBeziers.getArray(); uno::Reference< rendering::XBezierPolyPolygon2D > xPoly; for (int i= 0; i < num_curves; i++) - aBeziers[i]= geometry::RealBezierSegment2D( r * cos(i*2*M_PI/num_curves), //Px + pBeziers[i]= geometry::RealBezierSegment2D( r * cos(i*2*M_PI/num_curves), //Px r * sin(i*2*M_PI/num_curves), //py r * 2 * cos((i*2*M_PI + 2*M_PI)/num_curves), //C1x r * 2 * sin((i*2*M_PI + 2*M_PI)/num_curves), //C1y @@ -477,11 +479,12 @@ class DemoRenderer { //hacky hack hack uno::Sequence< geometry::RealPoint2D > aPoints (sides); + auto pPoints = aPoints.getArray(); uno::Reference< rendering::XLinePolyPolygon2D > xPoly; for (int i= 0; i < sides; i++) { - aPoints[i]= geometry::RealPoint2D( centerx + r * cos(i*2 * M_PI/sides), + pPoints[i]= geometry::RealPoint2D( centerx + r * cos(i*2 * M_PI/sides), centery + r * sin(i*2 * M_PI/sides)); } uno::Sequence< uno::Sequence< geometry::RealPoint2D > > aPolys { aPoints }; |