From 18e39cf9c9ca0bcbe56a87d27a2171007aeb31a6 Mon Sep 17 00:00:00 2001 From: Ingrid Halama Date: Fri, 23 Jan 2004 09:06:59 +0000 Subject: only labels for first polar radius axis --- chart2/source/view/axes/VAxisProperties.cxx | 19 +++++++++++-------- chart2/source/view/axes/VAxisProperties.hxx | 13 ++++++------- chart2/source/view/axes/VCartesianAxis.cxx | 11 ++++++----- chart2/source/view/axes/VPolarAxis.cxx | 14 +++++++++----- 4 files changed, 32 insertions(+), 25 deletions(-) (limited to 'chart2') diff --git a/chart2/source/view/axes/VAxisProperties.cxx b/chart2/source/view/axes/VAxisProperties.cxx index 4ee64ab3f8c0..f1a354d71bc6 100644 --- a/chart2/source/view/axes/VAxisProperties.cxx +++ b/chart2/source/view/axes/VAxisProperties.cxx @@ -2,9 +2,9 @@ * * $RCSfile: VAxisProperties.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: iha $ $Date: 2004-01-22 19:20:33 $ + * last change: $Author: iha $ $Date: 2004-01-23 10:06:56 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -196,6 +196,7 @@ AxisProperties::AxisProperties( const uno::Reference< XAxis >& xAxisModel , m_fInnerDirectionSign(1.0) , m_bLabelsOutside(true) , m_aLabelAlignment(LABEL_ALIGN_RIGHT_TOP) + , m_bDisplayLabels( true ) // , m_eRelativeLabelPosition(LEFTORBOTTOM_OF_AXIS) , m_nMajorTickmarks(1) , m_nMinorTickmarks(1) @@ -213,6 +214,7 @@ AxisProperties::AxisProperties( const AxisProperties& rAxisProperties ) , m_fInnerDirectionSign( rAxisProperties.m_fInnerDirectionSign ) , m_bLabelsOutside( rAxisProperties.m_bLabelsOutside ) , m_aLabelAlignment( rAxisProperties.m_aLabelAlignment ) + , m_bDisplayLabels( rAxisProperties.m_bDisplayLabels ) // , m_eRelativeLabelPosition( rAxisProperties.m_eRelativeLabelPosition ) , m_nMajorTickmarks( rAxisProperties.m_nMajorTickmarks ) , m_nMinorTickmarks( rAxisProperties.m_nMinorTickmarks ) @@ -287,12 +289,15 @@ void AxisProperties::init( bool bCartesian ) if( !xProp.is() ) return; - //init LineProperties - m_aLineProperties.initFromPropertySet( xProp ); - - //init TickmarkProperties try { + //init LineProperties + m_aLineProperties.initFromPropertySet( xProp ); + + //init display labels + xProp->getPropertyValue( C2U( "DisplayLabels" ) ) >>= m_bDisplayLabels; + + //init TickmarkProperties xProp->getPropertyValue( C2U( "MajorTickmarks" ) ) >>= m_nMajorTickmarks; xProp->getPropertyValue( C2U( "MinorTickmarks" ) ) >>= m_nMinorTickmarks; @@ -319,7 +324,6 @@ void AxisProperties::init( bool bCartesian ) AxisLabelProperties::AxisLabelProperties() : aNumberFormat() - , bDisplayLabels( true ) , eStaggering( SIDE_BY_SIDE ) , bLineBreakAllowed( true ) , bOverlapAllowed( false ) @@ -353,7 +357,6 @@ void AxisLabelProperties::init( const uno::Reference< XAxis >& xAxisModel ) //@todo get number format from calc } - xProp->getPropertyValue( C2U( "DisplayLabels" ) ) >>= this->bDisplayLabels; xProp->getPropertyValue( C2U( "TextBreak" ) ) >>= this->bLineBreakAllowed; xProp->getPropertyValue( C2U( "TextOverlap" ) ) >>= this->bOverlapAllowed; xProp->getPropertyValue( C2U( "StackCharacters" ) ) >>= this->bStackCharacters; diff --git a/chart2/source/view/axes/VAxisProperties.hxx b/chart2/source/view/axes/VAxisProperties.hxx index 0c3fea9a57ee..f9242a1491c3 100644 --- a/chart2/source/view/axes/VAxisProperties.hxx +++ b/chart2/source/view/axes/VAxisProperties.hxx @@ -2,9 +2,9 @@ * * $RCSfile: VAxisProperties.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: iha $ $Date: 2004-01-22 19:20:33 $ + * last change: $Author: iha $ $Date: 2004-01-23 10:06:57 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -114,8 +114,6 @@ struct AxisLabelProperties drafts::com::sun::star::chart2::NumberFormat aNumberFormat; - sal_Bool bDisplayLabels; - AxisLabelStaggering eStaggering; sal_Bool bLineBreakAllowed; @@ -142,11 +140,12 @@ struct AxisProperties bool m_bIsMainAxis;//not secondary axis double* m_pfMainLinePositionAtOtherAxis; double* m_pfExrtaLinePositionAtOtherAxis; - //this direction is used to indicate in which direction inner tickmarks are to be drawn - double m_fInnerDirectionSign; - bool m_bLabelsOutside; + //this direction is used to indicate in which direction inner tickmarks are to be drawn + double m_fInnerDirectionSign; + bool m_bLabelsOutside; LabelAlignment m_aLabelAlignment; + sal_Bool m_bDisplayLabels; // enum RelativeLabelPosition { NONE, LEFTORBOTTOM_OF_DIAGRAM, RIGHTORTOP_OF_DIAGRAM, diff --git a/chart2/source/view/axes/VCartesianAxis.cxx b/chart2/source/view/axes/VCartesianAxis.cxx index ae0c9f72ddc7..5bc0060777e1 100644 --- a/chart2/source/view/axes/VCartesianAxis.cxx +++ b/chart2/source/view/axes/VCartesianAxis.cxx @@ -2,9 +2,9 @@ * * $RCSfile: VCartesianAxis.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: iha $ $Date: 2004-01-22 19:20:34 $ + * last change: $Author: iha $ $Date: 2004-01-23 10:06:57 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -804,10 +804,11 @@ void SAL_CALL VCartesianAxis::createShapes() } //----------------------------------------- //create labels - AxisLabelProperties aAxisLabelProperties; - aAxisLabelProperties.init(m_aAxisProperties.m_xAxisModel); - if( aAxisLabelProperties.bDisplayLabels ) + if( m_aAxisProperties.m_bDisplayLabels ) { + AxisLabelProperties aAxisLabelProperties; + aAxisLabelProperties.init(m_aAxisProperties.m_xAxisModel); + //create tick mark text shapes while( !createTextShapes( xGroupShape_Shapes, aAllTickInfos , aAxisLabelProperties, apTickmarkHelper.get() diff --git a/chart2/source/view/axes/VPolarAxis.cxx b/chart2/source/view/axes/VPolarAxis.cxx index 001a12154dc5..be9e6d9edab0 100644 --- a/chart2/source/view/axes/VPolarAxis.cxx +++ b/chart2/source/view/axes/VPolarAxis.cxx @@ -2,9 +2,9 @@ * * $RCSfile: VPolarAxis.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: iha $ $Date: 2004-01-23 09:38:08 $ + * last change: $Author: iha $ $Date: 2004-01-23 10:06:59 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -225,10 +225,11 @@ void VPolarAxis::create2DAngleAxis( const uno::Reference< drawing::XShapes >& xT //----------------------------------------- //create labels - AxisLabelProperties aAxisLabelProperties; - aAxisLabelProperties.init(m_aAxisProperties.m_xAxisModel); - if( aAxisLabelProperties.bDisplayLabels ) + if( m_aAxisProperties.m_bDisplayLabels ) { + AxisLabelProperties aAxisLabelProperties; + aAxisLabelProperties.init(m_aAxisProperties.m_xAxisModel); + FixedNumberFormatter aFixedNumberFormatter( m_pNumberFormatterWrapper, aAxisLabelProperties.aNumberFormat ); @@ -271,6 +272,9 @@ void VPolarAxis::create2DRadiusAxis( const uno::Reference< drawing::XShapes >& x { pTickInfo->updateUnscaledValue( xInverseScaling ); aAxisProperties.m_pfMainLinePositionAtOtherAxis = new double( pTickInfo->fUnscaledTickValue ); + if(nTick) + aAxisProperties.m_bDisplayLabels=false; + //------------------- VCartesianAxis aAxis(aAxisProperties,m_pNumberFormatterWrapper ,2,new PolarPlottingPositionHelper(false)); -- cgit