chart2/source/view/axes/VCartesianAxis.cxx | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-)
New commits: commit b6d6a3f34163eba45691387dfe2748f7a1788f6a Author: Julien Nabet <[email protected]> AuthorDate: Fri May 14 10:42:47 2021 +0200 Commit: Julien Nabet <[email protected]> CommitDate: Fri May 14 16:05:51 2021 +0200 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 <[email protected]> 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] ); _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
