From e95be04a73e977022455335d7cbf56804638f761 Mon Sep 17 00:00:00 2001 From: Jochen Nitschke Date: Fri, 3 Jun 2016 20:30:50 +0200 Subject: initialise PointSequenceSequence directly this list initialisation is short enough to remove the local helper function Change-Id: I17fab47e51fc0b1a0aa0462d517d7861f8a278e0 Reviewed-on: https://gerrit.libreoffice.org/25884 Tested-by: Jenkins Reviewed-by: Julien Nabet --- chart2/source/view/axes/VCartesianAxis.cxx | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'chart2') diff --git a/chart2/source/view/axes/VCartesianAxis.cxx b/chart2/source/view/axes/VCartesianAxis.cxx index 6d2ed91eddb5..a8561dc8bb1f 100644 --- a/chart2/source/view/axes/VCartesianAxis.cxx +++ b/chart2/source/view/axes/VCartesianAxis.cxx @@ -1021,17 +1021,6 @@ bool VCartesianAxis::createTextShapesSimple( return true; } -drawing::PointSequenceSequence lcl_makePointSequence( B2DVector& rStart, B2DVector& rEnd ) -{ - drawing::PointSequenceSequence aPoints(1); - aPoints[0].realloc(2); - aPoints[0][0].X = static_cast(rStart.getX()); - aPoints[0][0].Y = static_cast(rStart.getY()); - aPoints[0][1].X = static_cast(rEnd.getX()); - aPoints[0][1].Y = static_cast(rEnd.getY()); - return aPoints; -} - double VCartesianAxis::getAxisIntersectionValue() const { if (m_aAxisProperties.m_pfMainLinePositionAtOtherAxis) @@ -1860,7 +1849,9 @@ void VCartesianAxis::createShapes() AxisLabelAlignment aLabelAlign = m_aAxisProperties.maLabelAlignment; get2DAxisMainLine(aStart, aEnd, aLabelAlign, fExtraLineCrossesOtherAxis); m_aAxisProperties.maLabelAlignment = aLabelAlign; - drawing::PointSequenceSequence aPoints( lcl_makePointSequence(aStart,aEnd) ); + drawing::PointSequenceSequence aPoints{{ + {static_cast(aStart.getX()), static_cast(aStart.getY())}, + {static_cast(aEnd.getX()), static_cast(aEnd.getY())} }}; Reference< drawing::XShape > xShape = m_pShapeFactory->createLine2D( m_xGroupShape_Shapes, aPoints, &m_aAxisProperties.m_aLineProperties ); } -- cgit