diff options
author | Marco Cecchetti <marco.cecchetti@collabora.com> | 2015-07-31 22:14:41 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2015-10-07 09:07:48 +0000 |
commit | d52d448e7b34cb8c2457948489e6691049f4a571 (patch) | |
tree | 81cd0bb8391d32a243229c87f97ba4fb2ffd92d3 /chart2/source/view/axes/VCartesianAxis.cxx | |
parent | 6dd8193524a8a0208d7b424e396095f8e409cbc5 (diff) |
tdf#88154 workaround and unit test
Fixed 45-degree layout for axis labels, too.
Change-Id: I9764e281aeee0a439fa9eec1e3b0df840221b72f
Reviewed-on: https://gerrit.libreoffice.org/18889
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'chart2/source/view/axes/VCartesianAxis.cxx')
-rw-r--r-- | chart2/source/view/axes/VCartesianAxis.cxx | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/chart2/source/view/axes/VCartesianAxis.cxx b/chart2/source/view/axes/VCartesianAxis.cxx index a8022b355812..46feff4866d9 100644 --- a/chart2/source/view/axes/VCartesianAxis.cxx +++ b/chart2/source/view/axes/VCartesianAxis.cxx @@ -825,15 +825,20 @@ bool VCartesianAxis::createTextShapes( bool bOverlapsAfterAutoStagger = true; if( !bIsStaggered && isAutoStaggeringOfLabelsAllowed( rAxisLabelProperties, bIsHorizontalAxis, bIsVerticalAxis ) ) { - bIsStaggered = true; - rAxisLabelProperties.eStaggering = STAGGER_EVEN; - pLastVisibleNeighbourTickInfo = pPREPreviousVisibleTickInfo; - if( !pLastVisibleNeighbourTickInfo || - !lcl_doesShapeOverlapWithTickmark( pLastVisibleNeighbourTickInfo->xTextShape - , rAxisLabelProperties.fRotationAngleDegree - , pTickInfo->aTickScreenPosition - , bIsHorizontalAxis, bIsVerticalAxis ) ) - bOverlapsAfterAutoStagger = false; + // Compatibility option: starting from LibreOffice 5.1 the rotated + // layout is preferred to staggering for axis labels. + if( m_aAxisProperties.m_bTryStaggeringFirst || !(::rtl::math::approxEqual( rAxisLabelProperties.fRotationAngleDegree, 0.0 ) ) ) + { + bIsStaggered = true; + rAxisLabelProperties.eStaggering = STAGGER_EVEN; + pLastVisibleNeighbourTickInfo = pPREPreviousVisibleTickInfo; + if( !pLastVisibleNeighbourTickInfo || + !lcl_doesShapeOverlapWithTickmark( pLastVisibleNeighbourTickInfo->xTextShape + , rAxisLabelProperties.fRotationAngleDegree + , pTickInfo->aTickScreenPosition + , bIsHorizontalAxis, bIsVerticalAxis ) ) + bOverlapsAfterAutoStagger = false; + } } if (bOverlapsAfterAutoStagger) |