summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorBalazs Varga <balazs.varga991@gmail.com>2019-09-03 14:54:52 +0200
committerLászló Németh <nemeth@numbertext.org>2019-09-04 13:36:35 +0200
commit4b3a648a2fd7d733674f95bb7f20670c57e99252 (patch)
treeb47efad3e9b36bda99aed0c671ece1848d9729da /chart2
parentca6ddfcc9385f1c31531eae31dfa81a9dda246f0 (diff)
tdf#127304 Chart: fix rotation of multilevel axis labels
If the first level of horizontal category axis labels is rotated vertically, then the other levels should not be rotated. Regression from commit: 23c0b3e13f88d6d71d528777d4f86f50c0766672 (tdf#107074 uncommenting createLabels for the axis fixes the issue) Change-Id: Ia1978fdc345fa154cff2ea03d2a94475f73398a6 Reviewed-on: https://gerrit.libreoffice.org/78557 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.cxx12
1 files changed, 7 insertions, 5 deletions
diff --git a/chart2/source/view/axes/VCartesianAxis.cxx b/chart2/source/view/axes/VCartesianAxis.cxx
index 34faa8bdac79..4874f7f9575f 100644
--- a/chart2/source/view/axes/VCartesianAxis.cxx
+++ b/chart2/source/view/axes/VCartesianAxis.cxx
@@ -757,8 +757,8 @@ bool VCartesianAxis::createTextShapes(
}
}
- // Stores an array of text label strings in case of a normal
- // (non-complex) category axis.
+ // Stores an array of text label strings in case of a normal
+ // (non-complex) category axis.
const uno::Sequence<OUString>* pCategories = nullptr;
if( m_bUseTextLabels && !m_aAxisProperties.m_bComplexCategories )
pCategories = &m_aTextLabels;
@@ -1680,10 +1680,12 @@ 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 )
+ if( nTextLevel > 0 )
{
- aComplexProps.fRotationAngleDegree = 90.0;
+ if( m_aAxisProperties.m_bSwapXAndY )
+ aComplexProps.fRotationAngleDegree = 90.0;
+ else
+ aComplexProps.fRotationAngleDegree = 0.0;
}
}
AxisLabelProperties& rAxisLabelProperties = m_aAxisProperties.m_bComplexCategories ? aComplexProps : m_aAxisLabelProperties;