diff options
author | Dr. David Alan Gilbert <dave@treblig.org> | 2021-01-24 17:44:39 +0000 |
---|---|---|
committer | Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> | 2021-01-25 07:57:44 +0100 |
commit | 0d5a0bf753dbc5ec3c3320a47972ccbe819787bb (patch) | |
tree | f19629728a9c4ddf5d541c4a4d6567b535f6930f /chart2/source/view | |
parent | 4e55bf7553fd90639769184e7027f275d31ca0b1 (diff) |
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 <samuel.mehrbrodt@allotropia.de>
Diffstat (limited to 'chart2/source/view')
-rw-r--r-- | chart2/source/view/axes/VAxisProperties.cxx | 3 | ||||
-rw-r--r-- | chart2/source/view/main/VLegend.cxx | 5 |
2 files changed, 3 insertions, 5 deletions
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? |