diff options
author | Balazs Varga <balazs.varga991@gmail.com> | 2019-07-31 15:58:09 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2019-08-01 10:48:06 +0200 |
commit | 0dab9b7c83099a192ec61486e7a9fd04aecd3686 (patch) | |
tree | 1a93c618ad29a1805ed3b1d4a032012ce2589665 /chart2 | |
parent | a912df26c6bd9251802f853775753d20f3b3de2b (diff) |
tdf#126244 Chart view: fix rotation of complex category labels
The first level of vertical category axis labels orientation
should be horizontal, other levels should be rotated to 90°.
Also do not allow text break for complex vertical category axis
labels.
Change-Id: I01a6d9f753e767927fa71e2967dc3e6bad270565
Reviewed-on: https://gerrit.libreoffice.org/76754
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
Tested-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/view/axes/VCartesianAxis.cxx | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/chart2/source/view/axes/VCartesianAxis.cxx b/chart2/source/view/axes/VCartesianAxis.cxx index 483411c4c605..34faa8bdac79 100644 --- a/chart2/source/view/axes/VCartesianAxis.cxx +++ b/chart2/source/view/axes/VCartesianAxis.cxx @@ -527,10 +527,13 @@ bool VCartesianAxis::isBreakOfLabelsAllowed( rAxisLabelProperties.fRotationAngleDegree == 90.0 || rAxisLabelProperties.fRotationAngleDegree == 270.0 ) ) return false; - if ( !m_aAxisProperties.m_bSwapXAndY ) + //no break for complex vertical category axis + if( !m_aAxisProperties.m_bSwapXAndY ) return bIsHorizontalAxis; - else + else if( m_aAxisProperties.m_bSwapXAndY && !m_aAxisProperties.m_bComplexCategories ) return bIsVerticalAxis; + else + return false; } namespace{ @@ -1677,7 +1680,11 @@ void VCartesianAxis::createLabels() { aComplexProps.bLineBreakAllowed = true; aComplexProps.bOverlapAllowed = aComplexProps.fRotationAngleDegree != 0.0; - + //Only the first level of complex vertical category axis labels orientation should be horizontal + if( nTextLevel > 0 && m_aAxisProperties.m_bSwapXAndY ) + { + aComplexProps.fRotationAngleDegree = 90.0; + } } AxisLabelProperties& rAxisLabelProperties = m_aAxisProperties.m_bComplexCategories ? aComplexProps : m_aAxisLabelProperties; while (!createTextShapes(m_xTextTarget, *apTickIter, rAxisLabelProperties, |