diff -cNr old/chart2/source/controller/main/ObjectHierarchy.cxx new/chart2/source/controller/main/ObjectHierarchy.cxx *** old/chart2/source/controller/main/ObjectHierarchy.cxx Wed May 23 02:08:18 2007 --- new/chart2/source/controller/main/ObjectHierarchy.cxx Thu Jul 26 16:08:00 2007 *************** *** 45,50 **** --- 45,51 ---- #include "chartview/ExplicitValueProvider.hxx" #include "macros.hxx" #include "LineProperties.hxx" + #include "servicenames_charttypes.hxx" #include #include *************** *** 274,312 **** 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 --- 275,342 ---- createDataSeriesTree( rContainer, xCooSysCnt ); // Axes ! sal_Bool bChartType = sal_False; ! Reference< XCoordinateSystemContainer > xCooSysContainer( xDiagram, uno::UNO_QUERY ); ! if( xCooSysContainer.is() ) ! { ! Sequence< Reference< XCoordinateSystem > > xCooSysList(xCooSysContainer->getCoordinateSystems()); ! for( sal_Int32 nCS = 0; nCS < xCooSysList.getLength(); ++nCS ) ! { ! Reference< XChartTypeContainer > xChartTypeContainer( xCooSysList[nCS], uno::UNO_QUERY); ! if( !xChartTypeContainer.is() ) ! continue; ! ! Sequence< Reference< XChartType > > xChartTypeList( xChartTypeContainer->getChartTypes() ); ! for(sal_Int32 nT = 0; nT < xChartTypeList.getLength(); ++nT) ! { ! Reference< XChartType > xChartType( xChartTypeList[nT] ); ! if( !xChartType.is() ) ! continue; ! rtl::OUString aChartType = xChartType->getChartType(); ! if( aChartType.match( CHART2_SERVICE_NAME_CHARTTYPE_PIE ) ) ! { ! bChartType = sal_True; ! break; ! } ! } ! } ! } ! if( !bChartType ) ! { ! 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