diff -cNr old/chart2/source/controller/main/ObjectHierarchy.cxx new/chart2/source/controller/main/ObjectHierarchy.cxx *** old/chart2/source/controller/main/ObjectHierarchy.cxx Fri Aug 17 18:33:44 2007 --- new/chart2/source/controller/main/ObjectHierarchy.cxx Fri Aug 17 18:46:12 2007 *************** *** 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() ); ! ! sal_Int32 nNumberOfSeries = aSeriesSeq.getLength(); ! Reference< XChartType > xChartType( aChartTypeSeq[nCTIdx] ); ! sal_Int32 nColumnCount = ChartTypeHelper::getDisplayedNumberOfSeries( xChartType, nNumberOfSeries ); ! ! for( sal_Int32 nSeriesIdx=0; nSeriesIdx < nColumnCount; ++nSeriesIdx ) { OUString aSeriesParticle( ObjectIdentifier::createParticleForSeries( diff -cNr old/chart2/source/inc/ChartTypeHelper.hxx new/chart2/source/inc/ChartTypeHelper.hxx *** old/chart2/source/inc/ChartTypeHelper.hxx Tue Jul 3 21:41:20 2007 --- new/chart2/source/inc/ChartTypeHelper.hxx Fri Aug 17 18:35:36 2007 *************** *** 74,79 **** --- 74,80 ---- static ::com::sun::star::drawing::Direction3D getDefaultRealisticLightDirection( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >& 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 getDisplayedNumberOfSeries( 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 diff -cNr old/chart2/source/tools/ChartTypeHelper.cxx new/chart2/source/tools/ChartTypeHelper.cxx *** old/chart2/source/tools/ChartTypeHelper.cxx Wed Jul 25 16:55:52 2007 --- new/chart2/source/tools/ChartTypeHelper.cxx Fri Aug 17 18:42:16 2007 *************** *** 343,348 **** --- 343,361 ---- return AxisType::CATEGORY; } + sal_Int32 ChartTypeHelper::getDisplayedNumberOfSeries( const uno::Reference< + XChartType >& xChartType, sal_Int32 nNumberOfSeries ) + { + if( xChartType.is() ) + { + rtl::OUString aChartTypeName = xChartType->getChartType(); + if( aChartTypeName.equals(CHART2_SERVICE_NAME_CHARTTYPE_PIE) ) + return 1; + else + return nNumberOfSeries; + } + return nNumberOfSeries; + } //............................................................................. } //namespace chart //.............................................................................