diff -upNr old/chart2/source/controller/main/ObjectHierarchy.cxx new/chart2/source/controller/main/ObjectHierarchy.cxx --- old/chart2/source/controller/main/ObjectHierarchy.cxx 2007-05-23 02:08:18.000000000 +0800 +++ new/chart2/source/controller/main/ObjectHierarchy.cxx 2007-08-14 17:47:20.000000000 +0800 @@ -45,6 +45,7 @@ #include "chartview/ExplicitValueProvider.hxx" #include "macros.hxx" #include "LineProperties.hxx" +#include "ChartTypeHelper.hxx" #include #include @@ -274,31 +275,38 @@ void ImplObjectHierarchy::createDiagramT 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 ) ) - { + 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 ) - { + 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 ) ) { @@ -306,15 +314,18 @@ void ImplObjectHierarchy::createDiagramT rContainer.push_back( ObjectIdentifier::createClassifiedIdentifierForGrid( xAxis, xChartModel, nSubGrid ) ); } - } - } - + } + } + } // Wall - rContainer.push_back( - ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DIAGRAM_WALL, rtl::OUString())); - + if( bHasWall ) + { + rContainer.push_back( + ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DIAGRAM_WALL, rtl::OUString())); + } + // Floor - if( DiagramHelper::getDimension( xDiagram ) == 3 ) + if( bHasWall && DiagramHelper::getDimension( xDiagram ) == 3 ) { Reference< beans::XPropertySet > xFloor( xDiagram->getFloor()); if( xFloor.is())