Kaydet (Commit) a1be31fd authored tarafından Markus Mohrhard's avatar Markus Mohrhard Kaydeden (comit) Tor Lillqvist

fdo#44832: Follow-up fix for axis labels for complex categories

Don't add special handling for second and following
categories.

[From Markus's patch email to the list, edited by tml]

This patch is not obvious and I'm not sure that it will not introduce
another regression. I don't fully understand why we need to add
special handling for labels of second and following categories.
üst d4fd86e3
...@@ -1338,11 +1338,6 @@ void VCartesianAxis::doStaggeringOfLabels( const AxisLabelProperties& rAxisLabel ...@@ -1338,11 +1338,6 @@ void VCartesianAxis::doStaggeringOfLabels( const AxisLabelProperties& rAxisLabel
if(apTickIter.get()) if(apTickIter.get())
{ {
double fRotationAngleDegree = m_aAxisLabelProperties.fRotationAngleDegree; double fRotationAngleDegree = m_aAxisLabelProperties.fRotationAngleDegree;
if( nTextLevel>0 )
{
lcl_shiftLables( *apTickIter.get(), aCummulatedLabelsDistance );
fRotationAngleDegree = 0.0;
}
aCummulatedLabelsDistance += lcl_getLabelsDistance( *apTickIter.get() aCummulatedLabelsDistance += lcl_getLabelsDistance( *apTickIter.get()
, pTickFactory2D->getDistanceAxisTickToText( m_aAxisProperties ) , pTickFactory2D->getDistanceAxisTickToText( m_aAxisProperties )
, fRotationAngleDegree ); , fRotationAngleDegree );
...@@ -1407,19 +1402,10 @@ void VCartesianAxis::createLabels() ...@@ -1407,19 +1402,10 @@ void VCartesianAxis::createLabels()
AxisLabelProperties aComplexProps(m_aAxisLabelProperties); AxisLabelProperties aComplexProps(m_aAxisLabelProperties);
if( m_aAxisProperties.m_bComplexCategories ) if( m_aAxisProperties.m_bComplexCategories )
{
if( nTextLevel==0 )
{ {
aComplexProps.bLineBreakAllowed = true; aComplexProps.bLineBreakAllowed = true;
aComplexProps.bOverlapAllowed = !::rtl::math::approxEqual( aComplexProps.fRotationAngleDegree, 0.0 ); aComplexProps.bOverlapAllowed = !::rtl::math::approxEqual( aComplexProps.fRotationAngleDegree, 0.0 );
}
else
{
aComplexProps.bOverlapAllowed = true;
aComplexProps.bRhythmIsFix = true;
aComplexProps.nRhythm = 1;
aComplexProps.fRotationAngleDegree = 0.0;
}
} }
AxisLabelProperties& rAxisLabelProperties = m_aAxisProperties.m_bComplexCategories ? aComplexProps : m_aAxisLabelProperties; AxisLabelProperties& rAxisLabelProperties = m_aAxisProperties.m_bComplexCategories ? aComplexProps : m_aAxisLabelProperties;
while( !createTextShapes( m_xTextTarget, *apTickIter.get(), rAxisLabelProperties, pTickFactory2D, nScreenDistanceBetweenTicks ) ) while( !createTextShapes( m_xTextTarget, *apTickIter.get(), rAxisLabelProperties, pTickFactory2D, nScreenDistanceBetweenTicks ) )
...@@ -1515,8 +1501,6 @@ void VCartesianAxis::updatePositions() ...@@ -1515,8 +1501,6 @@ void VCartesianAxis::updatePositions()
,static_cast<sal_Int32>(aTickScreenPos2D.getY())); ,static_cast<sal_Int32>(aTickScreenPos2D.getY()));
double fRotationAngleDegree = m_aAxisLabelProperties.fRotationAngleDegree; double fRotationAngleDegree = m_aAxisLabelProperties.fRotationAngleDegree;
if( nDepth>0 )
fRotationAngleDegree = 0.0;
// #i78696# use mathematically correct rotation now // #i78696# use mathematically correct rotation now
const double fRotationAnglePi(fRotationAngleDegree * (F_PI / -180.0)); const double fRotationAnglePi(fRotationAngleDegree * (F_PI / -180.0));
...@@ -1615,8 +1599,6 @@ void VCartesianAxis::createShapes() ...@@ -1615,8 +1599,6 @@ void VCartesianAxis::createShapes()
if( apTickIter.get() ) if( apTickIter.get() )
{ {
double fRotationAngleDegree = m_aAxisLabelProperties.fRotationAngleDegree; double fRotationAngleDegree = m_aAxisLabelProperties.fRotationAngleDegree;
if( nTextLevel>0 )
fRotationAngleDegree = 0.0;
B2DVector aLabelsDistance( lcl_getLabelsDistance( *apTickIter.get(), pTickFactory2D->getDistanceAxisTickToText( m_aAxisProperties, false ), fRotationAngleDegree ) ); B2DVector aLabelsDistance( lcl_getLabelsDistance( *apTickIter.get(), pTickFactory2D->getDistanceAxisTickToText( m_aAxisProperties, false ), fRotationAngleDegree ) );
sal_Int32 nCurrentLength = static_cast<sal_Int32>(aLabelsDistance.getLength()); sal_Int32 nCurrentLength = static_cast<sal_Int32>(aLabelsDistance.getLength());
aTickmarkPropertiesList.push_back( m_aAxisProperties.makeTickmarkPropertiesForComplexCategories( nOffset + nCurrentLength, 0, nTextLevel ) ); aTickmarkPropertiesList.push_back( m_aAxisProperties.makeTickmarkPropertiesForComplexCategories( nOffset + nCurrentLength, 0, nTextLevel ) );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment