summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorBalazs Varga <balazs.varga991@gmail.com>2019-01-18 11:20:07 +0100
committerLászló Németh <nemeth@numbertext.org>2019-01-18 16:48:55 +0100
commit82913d296709ccf4d4f35d53835bcbf49286ba28 (patch)
tree15acf8713647c9a612642cf5e9cd37d25c759f27 /chart2
parent643edcb11d635e09042d82d191279b6b1c2f25a9 (diff)
tdf#122800 Chart view: Textbreak of X axis labels
Do not break the word into individual letters below each other in the X axis labels. Keep the default 45 degree (even if the textbreak is true) rotation if there is no enough space for a single word between two tickmark. Change-Id: I6f11e55b7ee8373210c1c417e64d552a6cd89812 Reviewed-on: https://gerrit.libreoffice.org/66580 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/view/axes/VCartesianAxis.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/chart2/source/view/axes/VCartesianAxis.cxx b/chart2/source/view/axes/VCartesianAxis.cxx
index ed31fabbb215..42b767ae42a9 100644
--- a/chart2/source/view/axes/VCartesianAxis.cxx
+++ b/chart2/source/view/axes/VCartesianAxis.cxx
@@ -835,14 +835,17 @@ bool VCartesianAxis::createTextShapes(
recordMaximumTextSize( pTickInfo->xTextShape, rAxisLabelProperties.fRotationAngleDegree );
+ // Label has multiple lines and the words are broken
if( nLimitedSpaceForText>0 && !rAxisLabelProperties.bOverlapAllowed
&& rAxisLabelProperties.fRotationAngleDegree == 0.0
- && m_aAxisProperties.m_bComplexCategories
&& lcl_hasWordBreak( pTickInfo->xTextShape ) )
{
// Label has multiple lines and belongs to a complex category
// axis. Rotate 90 degrees to try to avoid overlaps.
- rAxisLabelProperties.fRotationAngleDegree = 90;
+ if ( m_aAxisProperties.m_bComplexCategories )
+ {
+ rAxisLabelProperties.fRotationAngleDegree = 90;
+ }
rAxisLabelProperties.bLineBreakAllowed = false;
m_aAxisLabelProperties.fRotationAngleDegree = rAxisLabelProperties.fRotationAngleDegree;
removeTextShapesFromTicks();