From 0d5a0bf753dbc5ec3c3320a47972ccbe819787bb Mon Sep 17 00:00:00 2001 From: "Dr. David Alan Gilbert" Date: Sun, 24 Jan 2021 17:44:39 +0000 Subject: chart2: Merge some if's Spotted by cppchecker, some sets of if's that can be merged since they have identical conditions. Change-Id: I28c35767eb96e31ab059abcfc014423704c988f8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109862 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt --- chart2/source/view/axes/VAxisProperties.cxx | 3 +-- chart2/source/view/main/VLegend.cxx | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'chart2') diff --git a/chart2/source/view/axes/VAxisProperties.cxx b/chart2/source/view/axes/VAxisProperties.cxx index 27a4950a886b..c6e296e277ed 100644 --- a/chart2/source/view/axes/VAxisProperties.cxx +++ b/chart2/source/view/axes/VAxisProperties.cxx @@ -286,10 +286,9 @@ void AxisProperties::init( bool bCartesian ) { maLabelAlignment.mfLabelDirection *= -1.0; maLabelAlignment.mfInnerTickDirection *= -1.0; - } - if( bIsYAxisPosition ) maLabelAlignment.meAlignment = lcl_getLabelAlignmentForYAxis(*this); + } else maLabelAlignment.meAlignment = lcl_getLabelAlignmentForXAxis(*this); } diff --git a/chart2/source/view/main/VLegend.cxx b/chart2/source/view/main/VLegend.cxx index 704a48872bf5..77e6b5800dc5 100644 --- a/chart2/source/view/main/VLegend.cxx +++ b/chart2/source/view/main/VLegend.cxx @@ -348,10 +348,9 @@ awt::Size lcl_placeLegendEntries( //all good proceed with next entry continue; } - } - if( nCurrentColumn < nCurrentColumnCount ) + aColumnWidths[nCurrentColumn] = std::max( nNewWidth, aColumnWidths[nCurrentColumn] ); - else + } else aColumnWidths.push_back(nNewWidth); //do the columns still fit into the given size? -- cgit