diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-10-14 12:48:42 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-10-14 13:01:43 +0200 |
commit | bf302000ea8849ac7ecd9162f3014bac9da4406e (patch) | |
tree | e5054d3b042ca71f00cd24c72ab68c0d3e54e77c /chart2/source/view/axes/VAxisProperties.cxx | |
parent | fixes and tests for o3tl::typed_flags (diff) | |
download | core-bf302000ea8849ac7ecd9162f3014bac9da4406e.tar.gz core-bf302000ea8849ac7ecd9162f3014bac9da4406e.zip |
Revert "Make VCartesianAxis::get2DAxisMainLine() truly const method."
This reverts commit 410c5bd58c36d9064a79520d5bc31cb32ead1326,
it causes CppunitTest_chart2_xshape to fail.
Diffstat (limited to 'chart2/source/view/axes/VAxisProperties.cxx')
-rw-r--r-- | chart2/source/view/axes/VAxisProperties.cxx | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/chart2/source/view/axes/VAxisProperties.cxx b/chart2/source/view/axes/VAxisProperties.cxx index 9b449d5a96d4..80c226114759 100644 --- a/chart2/source/view/axes/VAxisProperties.cxx +++ b/chart2/source/view/axes/VAxisProperties.cxx @@ -30,16 +30,11 @@ #include <com/sun/star/drawing/LineStyle.hpp> #include <com/sun/star/text/WritingMode2.hpp> +namespace chart +{ using namespace ::com::sun::star; using namespace ::com::sun::star::chart2; -namespace chart { - -AxisLabelAlignment::AxisLabelAlignment() : - mfLabelDirection(1.0), - mfInnerTickDirection(1.0), - meAlignment(LABEL_ALIGN_RIGHT_TOP) {} - sal_Int32 lcl_calcTickLengthForDepth(sal_Int32 nDepth,sal_Int32 nTickmarkStyle) { sal_Int32 nWidth = AXIS2D_TICKLENGTH; //@maybefuturetodo this length could be offered by the model @@ -117,7 +112,7 @@ TickmarkProperties AxisProperties::makeTickmarkProperties( nTickmarkStyle = m_nMinorTickmarks; } - if (maLabelAlignment.mfInnerTickDirection == 0.0) + if( m_fInnerDirectionSign == 0.0 ) { if( nTickmarkStyle != 0 ) nTickmarkStyle = 3; //inner and outer tickmarks @@ -133,7 +128,7 @@ TickmarkProperties AxisProperties::makeTickmarkProperties( TickmarkProperties AxisProperties::makeTickmarkPropertiesForComplexCategories( sal_Int32 nTickLength, sal_Int32 nTickStartDistanceToAxis, sal_Int32 /*nTextLevel*/ ) const { - sal_Int32 nTickmarkStyle = (maLabelAlignment.mfLabelDirection == maLabelAlignment.mfInnerTickDirection) ? 2/*outside*/ : 1/*inside*/; + sal_Int32 nTickmarkStyle = (m_fLabelDirectionSign==m_fInnerDirectionSign) ? 2/*outside*/ : 1/*inside*/; TickmarkProperties aTickmarkProperties; aTickmarkProperties.Length = nTickLength;// + nTextLevel*( lcl_calcTickLengthForDepth(0,nTickmarkStyle) ); @@ -163,6 +158,9 @@ AxisProperties::AxisProperties( const uno::Reference< XAxis >& xAxisModel , m_eTickmarkPos( ::com::sun::star::chart::ChartAxisMarkPosition_AT_LABELS_AND_AXIS ) , m_bCrossingAxisHasReverseDirection(false) , m_bCrossingAxisIsCategoryAxes(false) + , m_fLabelDirectionSign(1.0) + , m_fInnerDirectionSign(1.0) + , m_aLabelAlignment(LABEL_ALIGN_RIGHT_TOP) , m_bDisplayLabels( true ) , m_nNumberFormatKey(0) , m_nMajorTickmarks(1) @@ -187,7 +185,9 @@ AxisProperties::AxisProperties( const AxisProperties& rAxisProperties ) , m_eTickmarkPos( rAxisProperties.m_eTickmarkPos ) , m_bCrossingAxisHasReverseDirection( rAxisProperties.m_bCrossingAxisHasReverseDirection ) , m_bCrossingAxisIsCategoryAxes( rAxisProperties.m_bCrossingAxisIsCategoryAxes ) - , maLabelAlignment( rAxisProperties.maLabelAlignment ) + , m_fLabelDirectionSign( rAxisProperties.m_fLabelDirectionSign ) + , m_fInnerDirectionSign( rAxisProperties.m_fInnerDirectionSign ) + , m_aLabelAlignment( rAxisProperties.m_aLabelAlignment ) , m_bDisplayLabels( rAxisProperties.m_bDisplayLabels ) , m_nNumberFormatKey( rAxisProperties.m_nNumberFormatKey ) , m_nMajorTickmarks( rAxisProperties.m_nMajorTickmarks ) @@ -209,7 +209,7 @@ AxisProperties::AxisProperties( const AxisProperties& rAxisProperties ) LabelAlignment lcl_getLabelAlignmentForZAxis( const AxisProperties& rAxisProperties ) { LabelAlignment aRet( LABEL_ALIGN_RIGHT ); - if (rAxisProperties.maLabelAlignment.mfLabelDirection < 0) + if( rAxisProperties.m_fLabelDirectionSign<0 ) aRet = LABEL_ALIGN_LEFT; return aRet; } @@ -217,7 +217,7 @@ LabelAlignment lcl_getLabelAlignmentForZAxis( const AxisProperties& rAxisPropert LabelAlignment lcl_getLabelAlignmentForYAxis( const AxisProperties& rAxisProperties ) { LabelAlignment aRet( LABEL_ALIGN_RIGHT ); - if (rAxisProperties.maLabelAlignment.mfLabelDirection < 0) + if( rAxisProperties.m_fLabelDirectionSign<0 ) aRet = LABEL_ALIGN_LEFT; return aRet; } @@ -225,7 +225,7 @@ LabelAlignment lcl_getLabelAlignmentForYAxis( const AxisProperties& rAxisPropert LabelAlignment lcl_getLabelAlignmentForXAxis( const AxisProperties& rAxisProperties ) { LabelAlignment aRet( LABEL_ALIGN_BOTTOM ); - if (rAxisProperties.maLabelAlignment.mfLabelDirection < 0) + if( rAxisProperties.m_fLabelDirectionSign<0 ) aRet = LABEL_ALIGN_TOP; return aRet; } @@ -291,35 +291,35 @@ void AxisProperties::init( bool bCartesian ) m_bComplexCategories = true; if( ::com::sun::star::chart::ChartAxisPosition_END == m_eCrossoverType ) - maLabelAlignment.mfInnerTickDirection = m_bCrossingAxisHasReverseDirection ? 1.0 : -1.0; + m_fInnerDirectionSign = m_bCrossingAxisHasReverseDirection ? 1 : -1; else - maLabelAlignment.mfInnerTickDirection = m_bCrossingAxisHasReverseDirection ? -1.0 : 1.0; + m_fInnerDirectionSign = m_bCrossingAxisHasReverseDirection ? -1 : 1; if( ::com::sun::star::chart::ChartAxisLabelPosition_NEAR_AXIS == m_eLabelPos ) - maLabelAlignment.mfLabelDirection = maLabelAlignment.mfInnerTickDirection; + m_fLabelDirectionSign = m_fInnerDirectionSign; else if( ::com::sun::star::chart::ChartAxisLabelPosition_NEAR_AXIS_OTHER_SIDE == m_eLabelPos ) - maLabelAlignment.mfLabelDirection = -maLabelAlignment.mfInnerTickDirection; + m_fLabelDirectionSign = -m_fInnerDirectionSign; else if( ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_START == m_eLabelPos ) - maLabelAlignment.mfLabelDirection = m_bCrossingAxisHasReverseDirection ? -1 : 1; + m_fLabelDirectionSign = m_bCrossingAxisHasReverseDirection ? -1 : 1; else if( ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_END == m_eLabelPos ) - maLabelAlignment.mfLabelDirection = m_bCrossingAxisHasReverseDirection ? 1 : -1; + m_fLabelDirectionSign = m_bCrossingAxisHasReverseDirection ? 1 : -1; if( m_nDimensionIndex==2 ) - maLabelAlignment.meAlignment = lcl_getLabelAlignmentForZAxis(*this); + m_aLabelAlignment = lcl_getLabelAlignmentForZAxis(*this); else { bool bIsYAxisPosition = (m_nDimensionIndex==1 && !m_bSwapXAndY) || (m_nDimensionIndex==0 && m_bSwapXAndY); if( bIsYAxisPosition ) { - maLabelAlignment.mfLabelDirection *= -1.0; - maLabelAlignment.mfInnerTickDirection *= -1.0; + m_fLabelDirectionSign*=-1; + m_fInnerDirectionSign*=-1; } if( bIsYAxisPosition ) - maLabelAlignment.meAlignment = lcl_getLabelAlignmentForYAxis(*this); + m_aLabelAlignment = lcl_getLabelAlignmentForYAxis(*this); else - maLabelAlignment.meAlignment = lcl_getLabelAlignmentForXAxis(*this); + m_aLabelAlignment = lcl_getLabelAlignmentForXAxis(*this); } } |