diff options
author | Rüdiger Timm <rt@openoffice.org> | 2008-02-18 14:56:26 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2008-02-18 14:56:26 +0000 |
commit | 65752baea12a5d54a36717c7a64725d6b0b005d5 (patch) | |
tree | 07d0d5028a9e68ecddd2e07770ac4ab316c94598 /chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx | |
parent | 1ca474009239e452c776cd438ab7f9c154acd4ea (diff) |
INTEGRATION: CWS chart19 (1.4.12); FILE MERGED
2008/02/01 10:22:35 iha 1.4.12.3: #i85718# Undo for the new features Rotation direction and starting angle
2008/01/08 12:21:24 iha 1.4.12.2: #i37823# clockwise pie charts
2007/12/15 13:03:04 iha 1.4.12.1: #i16776# starting angle for pie charts
Diffstat (limited to 'chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx')
-rw-r--r-- | chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx | 68 |
1 files changed, 66 insertions, 2 deletions
diff --git a/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx b/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx index 98546b8df961..d147b1208a9d 100644 --- a/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx @@ -4,9 +4,9 @@ * * $RCSfile: SeriesOptionsItemConverter.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: vg $ $Date: 2007-10-22 16:52:03 $ + * last change: $Author: rt $ $Date: 2008-02-18 15:56:26 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -94,6 +94,9 @@ SeriesOptionsItemConverter::SeriesOptionsItemConverter( , m_bGroupBarsPerAxis(true) , m_bAllSeriesAttachedToSameAxis(true) , m_nAllSeriesAxisIndex(-1) + , m_bSupportingStartingAngle(false) + , m_nStartingAngle(90) + , m_bClockwise(false) { try { @@ -105,6 +108,14 @@ SeriesOptionsItemConverter::SeriesOptionsItemConverter( uno::Reference< beans::XPropertySet > xDiagramProperties( xDiagram, uno::UNO_QUERY ); uno::Reference< XChartType > xChartType( DiagramHelper::getChartTypeOfSeries( xDiagram , xDataSeries ) ); + m_xCooSys = DataSeriesHelper::getCoordinateSystemOfSeries( xDataSeries, xDiagram ); + if( m_xCooSys.is() ) + { + uno::Reference< chart2::XAxis > xAxis( AxisHelper::getAxis( 1, 0, m_xCooSys ) ); + chart2::ScaleData aScale( xAxis->getScaleData() ); + m_bClockwise = (aScale.Orientation == chart2::AxisOrientation_REVERSE); + } + sal_Int32 nDimensionCount = DiagramHelper::getDimension( xDiagram ); m_bSupportingOverlapAndGapWidthProperties = ChartTypeHelper::isSupportingOverlapAndGapWidthProperties( xChartType, nDimensionCount ); @@ -142,6 +153,12 @@ SeriesOptionsItemConverter::SeriesOptionsItemConverter( xDiagramProperties->getPropertyValue( C2U("GroupBarsPerAxis")) >>= m_bGroupBarsPerAxis; m_bAllSeriesAttachedToSameAxis = ChartTypeHelper::allSeriesAttachedToSameAxis( xChartType, m_nAllSeriesAxisIndex ); } + + m_bSupportingStartingAngle = ChartTypeHelper::isSupportingStartingAngle( xChartType ); + if( m_bSupportingStartingAngle ) + { + xDiagramProperties->getPropertyValue( C2U( "StartingAngle" ) ) >>= m_nStartingAngle; + } } catch( uno::Exception ex ) { @@ -221,6 +238,7 @@ bool SeriesOptionsItemConverter::ApplySpecialItem( USHORT nWhichId, const SfxIte m_aBarPositionSequence[nAxisIndex] = rBarPosition; xChartTypeProps->setPropertyValue( aPropName, uno::makeAny(m_aBarPositionSequence) ); + bChanged = true; } } } @@ -241,6 +259,7 @@ bool SeriesOptionsItemConverter::ApplySpecialItem( USHORT nWhichId, const SfxIte bOldConnectBars != m_bConnectBars ) { xDiagramProperties->setPropertyValue( C2U("ConnectBars"), uno::makeAny(m_bConnectBars) ); + bChanged = true; } } } @@ -259,10 +278,44 @@ bool SeriesOptionsItemConverter::ApplySpecialItem( USHORT nWhichId, const SfxIte bOldGroupBarsPerAxis != m_bGroupBarsPerAxis ) { xDiagramProperties->setPropertyValue( C2U("GroupBarsPerAxis"), uno::makeAny(m_bGroupBarsPerAxis) ); + bChanged = true; } } } break; + + case SCHATTR_STARTING_ANGLE: + { + if( m_bSupportingStartingAngle ) + { + m_nStartingAngle = static_cast< const SfxInt32Item & >( rItemSet.Get( nWhichId )).GetValue(); + uno::Reference< beans::XPropertySet > xDiagramProperties( ChartModelHelper::findDiagram(m_xChartModel), uno::UNO_QUERY ); + if( xDiagramProperties.is() ) + { + xDiagramProperties->setPropertyValue( C2U("StartingAngle"), uno::makeAny(m_nStartingAngle) ); + bChanged = true; + } + } + } + break; + + case SCHATTR_CLOCKWISE: + { + bool bClockwise = (static_cast< const SfxBoolItem & >( + rItemSet.Get( nWhichId )).GetValue() ); + if( m_xCooSys.is() ) + { + uno::Reference< chart2::XAxis > xAxis( AxisHelper::getAxis( 1, 0, m_xCooSys ) ); + if( xAxis.is() ) + { + chart2::ScaleData aScaleData( xAxis->getScaleData() ); + aScaleData.Orientation = bClockwise ? chart2::AxisOrientation_REVERSE : chart2::AxisOrientation_MATHEMATICAL; + xAxis->setScaleData( aScaleData ); + bChanged = true; + } + } + } + break; } return bChanged; } @@ -309,6 +362,17 @@ void SeriesOptionsItemConverter::FillSpecialItem( rOutItemSet.Put( SfxInt32Item(nWhichId, m_nAllSeriesAxisIndex)); break; } + case SCHATTR_STARTING_ANGLE: + { + if( m_bSupportingStartingAngle ) + rOutItemSet.Put( SfxInt32Item(nWhichId,m_nStartingAngle)); + break; + } + case SCHATTR_CLOCKWISE: + { + rOutItemSet.Put( SfxBoolItem(nWhichId,m_bClockwise) ); + break; + } default: break; } |