Index: source/controller/main/ObjectHierarchy.cxx =================================================================== RCS file: /cvs/graphics/chart2/source/controller/main/ObjectHierarchy.cxx,v retrieving revision 1.2 diff -c -r1.2 ObjectHierarchy.cxx *** source/controller/main/ObjectHierarchy.cxx 22 May 2007 18:08:17 -0000 1.2 --- source/controller/main/ObjectHierarchy.cxx 17 Aug 2007 15:07:42 -0000 *************** *** 45,50 **** --- 45,51 ---- #include "chartview/ExplicitValueProvider.hxx" #include "macros.hxx" #include "LineProperties.hxx" + #include "ChartTypeHelper.hxx" #include #include *************** *** 274,320 **** createDataSeriesTree( rContainer, xCooSysCnt ); // Axes ! Sequence< Reference< XAxis > > aAxes( AxisHelper::getAllAxisOfDiagram( xDiagram ) ); ! ::std::transform( aAxes.getConstArray(), aAxes.getConstArray() + aAxes.getLength(), ! ::std::back_inserter( rContainer ), ! lcl_ObjectToCID( xChartDoc )); ! ! // Grids ! Reference< frame::XModel > xChartModel( xChartDoc, uno::UNO_QUERY ); ! for( sal_Int32 nA=0; nA xAxis( aAxes[nA] ); ! if(!xAxis.is()) ! continue; ! ! Reference< beans::XPropertySet > xGridProperties( xAxis->getGridProperties() ); ! if( AxisHelper::isGridVisible( xGridProperties ) ) ! { ! //main grid ! rContainer.push_back( ! ObjectIdentifier::createClassifiedIdentifierForGrid( xAxis, xChartModel ) ); ! } ! ! Sequence< Reference< beans::XPropertySet > > aSubGrids( xAxis->getSubGridProperties() );; ! sal_Int32 nSubGrid = 0; ! for( nSubGrid = 0; nSubGrid < aSubGrids.getLength(); ++nSubGrid ) ! { ! Reference< beans::XPropertySet > xSubGridProperties( aSubGrids[nSubGrid] ); ! if( AxisHelper::isGridVisible( xSubGridProperties ) ) ! { ! //sub grid ! rContainer.push_back( ! ObjectIdentifier::createClassifiedIdentifierForGrid( xAxis, xChartModel, nSubGrid ) ); ! } ! } ! } ! // Wall ! rContainer.push_back( ! ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DIAGRAM_WALL, rtl::OUString())); // Floor ! if( DiagramHelper::getDimension( xDiagram ) == 3 ) { Reference< beans::XPropertySet > xFloor( xDiagram->getFloor()); if( xFloor.is()) --- 275,331 ---- createDataSeriesTree( rContainer, xCooSysCnt ); // Axes ! sal_Int32 nDimensionCount = DiagramHelper::getDimension( xDiagram ); ! uno::Reference< chart2::XChartType > xChartType( DiagramHelper::getChartTypeByIndex( xDiagram, 0 ) ); ! bool bSupportsAxesGrids = ChartTypeHelper::isSupportingMainAxis( xChartType, nDimensionCount, 0 ); ! bool bIsThreeD = ( nDimensionCount == 3 ); ! bool bHasWall = DiagramHelper::isSupportingFloorAndWall( xDiagram ); ! if( bSupportsAxesGrids ) ! { ! Sequence< Reference< XAxis > > aAxes( AxisHelper::getAllAxisOfDiagram( xDiagram ) ); ! ::std::transform( aAxes.getConstArray(), aAxes.getConstArray() + aAxes.getLength(), ! ::std::back_inserter( rContainer ), ! lcl_ObjectToCID( xChartDoc )); ! ! // Grids ! Reference< frame::XModel > xChartModel( xChartDoc, uno::UNO_QUERY ); ! for( sal_Int32 nA=0; nA xAxis( aAxes[nA] ); ! if(!xAxis.is()) ! continue; ! ! Reference< beans::XPropertySet > xGridProperties( xAxis->getGridProperties() ); ! if( AxisHelper::isGridVisible( xGridProperties ) ) ! { ! //main grid ! rContainer.push_back( ! ObjectIdentifier::createClassifiedIdentifierForGrid( xAxis, xChartModel ) ); ! } ! ! Sequence< Reference< beans::XPropertySet > > aSubGrids( xAxis->getSubGridProperties() );; ! sal_Int32 nSubGrid = 0; ! for( nSubGrid = 0; nSubGrid < aSubGrids.getLength(); ++nSubGrid ) ! { ! Reference< beans::XPropertySet > xSubGridProperties( aSubGrids[nSubGrid] ); ! if( AxisHelper::isGridVisible( xSubGridProperties ) ) ! { ! //sub grid ! rContainer.push_back( ! ObjectIdentifier::createClassifiedIdentifierForGrid( xAxis, xChartModel, nSubGrid ) ); ! } ! } ! } ! } // Wall ! if( bHasWall ) ! { ! rContainer.push_back( ! ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DIAGRAM_WALL, rtl::OUString())); ! } // Floor ! if( bHasWall && bIsThreeD ) { Reference< beans::XPropertySet > xFloor( xDiagram->getFloor()); if( xFloor.is()) *************** *** 340,346 **** { Reference< XDataSeriesContainer > xDSCnt( aChartTypeSeq[nCTIdx], uno::UNO_QUERY_THROW ); Sequence< Reference< XDataSeries > > aSeriesSeq( xDSCnt->getDataSeries() ); ! for( sal_Int32 nSeriesIdx=0; nSeriesIdx xDSCnt( aChartTypeSeq[nCTIdx], uno::UNO_QUERY_THROW ); Sequence< Reference< XDataSeries > > aSeriesSeq( xDSCnt->getDataSeries() ); ! const sal_Int32 nNumberOfSeries = ! ChartTypeHelper::getNumberOfDisplayedSeries( aChartTypeSeq[nCTIdx], aSeriesSeq.getLength()); ! ! for( sal_Int32 nSeriesIdx=0; nSeriesIdx& xChartType ); static sal_Int32 getDefaultDirectLightColor( bool bSimple, const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >& xChartType ); static sal_Int32 getDefaultAmbientLightColor( bool bSimple, const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >& xChartType ); + static sal_Int32 getNumberOfDisplayedSeries( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >& xChartType, sal_Int32 nNumberOfSeries ); static bool noBordersForSimpleScheme( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >& xChartType ); static sal_Int32 //one of ::com::sun::star::chart2::AxisType Index: source/tools/ChartTypeHelper.cxx =================================================================== RCS file: /cvs/graphics/chart2/source/tools/ChartTypeHelper.cxx,v retrieving revision 1.14 diff -c -r1.14 ChartTypeHelper.cxx *** source/tools/ChartTypeHelper.cxx 25 Jul 2007 08:55:51 -0000 1.14 --- source/tools/ChartTypeHelper.cxx 17 Aug 2007 15:07:42 -0000 *************** *** 343,348 **** --- 343,375 ---- return AxisType::CATEGORY; } + sal_Int32 ChartTypeHelper::getNumberOfDisplayedSeries( + const uno::Reference< XChartType >& xChartType, + sal_Int32 nNumberOfSeries ) + { + if( xChartType.is() ) + { + try + { + rtl::OUString aChartTypeName = xChartType->getChartType(); + if( aChartTypeName.equals(CHART2_SERVICE_NAME_CHARTTYPE_PIE)) + { + uno::Reference< beans::XPropertySet > xChartTypeProp( xChartType, uno::UNO_QUERY_THROW ); + bool bDonut = false; + if( (xChartTypeProp->getPropertyValue( C2U("UseRings")) >>= bDonut) + && !bDonut ) + { + return 1; + } + } + } + catch( const uno::Exception & ex ) + { + ASSERT_EXCEPTION( ex ); + } + } + return nNumberOfSeries; + } //............................................................................. } //namespace chart //.............................................................................