summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2021-05-14 10:42:47 +0200
committerJulien Nabet <serval2412@yahoo.fr>2021-05-14 16:05:51 +0200
commitb6d6a3f34163eba45691387dfe2748f7a1788f6a (patch)
tree0b9a6269b55b5ccd87c620daf8bbd5b4ed4081bf /chart2
parentee2199a4356c9a74b4a3e817f7aef268efba5123 (diff)
Directly initialize vectors in VCartesianAxis.cxx
since we've got all the information from the beginning. Change-Id: I4045c8fd5ab5653cd390ceb29cfef76bd6c520a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115587 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/view/axes/VCartesianAxis.cxx12
1 files changed, 3 insertions, 9 deletions
diff --git a/chart2/source/view/axes/VCartesianAxis.cxx b/chart2/source/view/axes/VCartesianAxis.cxx
index ebd045a24845..fcb3391c693c 100644
--- a/chart2/source/view/axes/VCartesianAxis.cxx
+++ b/chart2/source/view/axes/VCartesianAxis.cxx
@@ -1275,9 +1275,7 @@ void VCartesianAxis::get2DAxisMainLine(
double fDeltaY = rEnd.getY() - rStart.getY();
//only those points are candidates which are lying on exactly one wall as these are outer edges
- tScreenPosAndLogicPosList aPosList;
- aPosList.push_back( getScreenPosAndLogicPos( fMinX, fYOnYPlane, fZOther ) );
- aPosList.push_back( getScreenPosAndLogicPos( fMinX, fYOther, fZOnZPlane ) );
+ tScreenPosAndLogicPosList aPosList { getScreenPosAndLogicPos( fMinX, fYOnYPlane, fZOther ), getScreenPosAndLogicPos( fMinX, fYOther, fZOnZPlane ) };
if( fabs(fDeltaY) > fabs(fDeltaX) )
{
@@ -1329,9 +1327,7 @@ void VCartesianAxis::get2DAxisMainLine(
double fDeltaY = rEnd.getY() - rStart.getY();
//only those points are candidates which are lying on exactly one wall as these are outer edges
- tScreenPosAndLogicPosList aPosList;
- aPosList.push_back( getScreenPosAndLogicPos( fXOnXPlane, fMinY, fZOther ) );
- aPosList.push_back( getScreenPosAndLogicPos( fXOther, fMinY, fZOnZPlane ) );
+ tScreenPosAndLogicPosList aPosList { getScreenPosAndLogicPos( fXOnXPlane, fMinY, fZOther ), getScreenPosAndLogicPos( fXOther, fMinY, fZOnZPlane ) };
if( fabs(fDeltaY) > fabs(fDeltaX) )
{
@@ -1408,9 +1404,7 @@ void VCartesianAxis::get2DAxisMainLine(
double fDeltaX = rEnd.getX() - rStart.getX();
//only those points are candidates which are lying on exactly one wall as these are outer edges
- tScreenPosAndLogicPosList aPosList;
- aPosList.push_back( getScreenPosAndLogicPos( fXOther, fYOnYPlane, fMinZ ) );
- aPosList.push_back( getScreenPosAndLogicPos( fXOnXPlane, fYOther, fMinZ ) );
+ tScreenPosAndLogicPosList aPosList { getScreenPosAndLogicPos( fXOther, fYOnYPlane, fMinZ ), getScreenPosAndLogicPos( fXOnXPlane, fYOther, fMinZ ) };
std::sort( aPosList.begin(), aPosList.end(), lcl_GreaterYPos() );
ScreenPosAndLogicPos aBestPos( aPosList[0] );