summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorBalazs Varga <balazs.varga991@gmail.com>2019-12-30 15:53:08 +0100
committerLászló Németh <nemeth@numbertext.org>2020-01-06 10:33:54 +0100
commitd53de6b0bfff08dfbde4fe305e2a9b7a60255458 (patch)
tree9dde5d693638321791743ed1b186ead6c4a9f4df /chart2
parentac4f30fdf808bfbb7c8f534661851d10301bbcad (diff)
tdf#128996 Chart: Fix disappeared vertical X axis labels
Regression from commit: 75ef0e41ea8a9096ac619356d2b837c5333b47e6 (tdf#125334 Chart: allow text break in bar chart axis labels) Change-Id: Ib935de74314b7dec489d94a4aa3c65072e18d9e0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86010 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/Tickmarks.cxx5
-rw-r--r--chart2/source/view/axes/Tickmarks.hxx1
-rw-r--r--chart2/source/view/axes/VCartesianAxis.cxx15
3 files changed, 10 insertions, 11 deletions
diff --git a/chart2/source/view/axes/Tickmarks.cxx b/chart2/source/view/axes/Tickmarks.cxx
index 45e311ce3cfa..e1dc3953bd11 100644
--- a/chart2/source/view/axes/Tickmarks.cxx
+++ b/chart2/source/view/axes/Tickmarks.cxx
@@ -204,6 +204,11 @@ sal_Int32 TickFactory2D::getTickScreenDistance( TickIter& rIter )
return pFirstTickInfo->getScreenDistanceBetweenTicks( *pSecondTickInfo );
}
+B2DVector TickFactory2D::getXaxisStartPos() const
+{
+ return m_aAxisStartScreenPosition2D;
+}
+
B2DVector TickFactory2D::getTickScreenPosition2D( double fScaledLogicTickValue ) const
{
B2DVector aRet(m_aAxisStartScreenPosition2D);
diff --git a/chart2/source/view/axes/Tickmarks.hxx b/chart2/source/view/axes/Tickmarks.hxx
index b0cb774dbf5d..34addbeb45db 100644
--- a/chart2/source/view/axes/Tickmarks.hxx
+++ b/chart2/source/view/axes/Tickmarks.hxx
@@ -135,6 +135,7 @@ public:
bool isHorizontalAxis() const;
bool isVerticalAxis() const;
+ ::basegfx::B2DVector getXaxisStartPos() const;
private:
::basegfx::B2DVector getTickScreenPosition2D( double fScaledLogicTickValue ) const;
diff --git a/chart2/source/view/axes/VCartesianAxis.cxx b/chart2/source/view/axes/VCartesianAxis.cxx
index 7257a6432605..49d4d860c435 100644
--- a/chart2/source/view/axes/VCartesianAxis.cxx
+++ b/chart2/source/view/axes/VCartesianAxis.cxx
@@ -745,22 +745,15 @@ bool VCartesianAxis::createTextShapes(
// 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;
- }
+ nLimitedSpaceForText = rAxisLabelProperties.m_aFontReferenceSize.Height - pTickFactory->getXaxisStartPos().getY();
+ m_aAxisProperties.m_bLimitSpaceForLabels = false;
}
// recalculate the nLimitedSpaceForText in case of vertical category axis if the text break is true
if ( m_aAxisProperties.m_bSwapXAndY && bIsVerticalAxis && rAxisLabelProperties.fRotationAngleDegree == 0.0 )
{
- nLimitedSpaceForText = rAxisLabelProperties.m_aMaximumSpaceForLabels.X;
+ nLimitedSpaceForText = pTickFactory->getXaxisStartPos().getX();
+ m_aAxisProperties.m_bLimitSpaceForLabels = false;
}
}