summaryrefslogtreecommitdiff
path: root/chart2/source/view/axes/VCartesianAxis.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'chart2/source/view/axes/VCartesianAxis.cxx')
-rw-r--r--chart2/source/view/axes/VCartesianAxis.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/chart2/source/view/axes/VCartesianAxis.cxx b/chart2/source/view/axes/VCartesianAxis.cxx
index 42b767ae42a9..e058101524df 100644
--- a/chart2/source/view/axes/VCartesianAxis.cxx
+++ b/chart2/source/view/axes/VCartesianAxis.cxx
@@ -727,6 +727,21 @@ bool VCartesianAxis::createTextShapes(
nReduce = 1;
nLimitedSpaceForText -= nReduce;
}
+
+ // recalculate the nLimitedSpaceForText in case of 90 and 270 degree if the text break is true
+ if ( rAxisLabelProperties.fRotationAngleDegree == 90.0 || rAxisLabelProperties.fRotationAngleDegree == 270.0 )
+ {
+ if ( rAxisLabelProperties.m_aFontReferenceSize.Height - rAxisLabelProperties.m_aMaximumSpaceForLabels.Height > 2 * rAxisLabelProperties.m_aMaximumSpaceForLabels.Y )
+ {
+ const sal_Int32 nFullHeight = rAxisLabelProperties.m_aFontReferenceSize.Height;
+ sal_Int32 nMaxLabelsHeight = nFullHeight - ( rAxisLabelProperties.m_aMaximumSpaceForLabels.Height + rAxisLabelProperties.m_aMaximumSpaceForLabels.Y );
+ nLimitedSpaceForText = nMaxLabelsHeight;
+ }
+ else
+ {
+ nLimitedSpaceForText = -1;
+ }
+ }
}
// Stores an array of text label strings in case of a normal